1717#pragma once
1818
1919#include < android/hardware/graphics/common/1.1/types.h>
20+ #include < android/hardware/graphics/composer/2.1/types.h>
2021#include < android/hardware/graphics/composer/2.4/IComposer.h>
2122#include < android/hardware/graphics/composer/2.4/IComposerClient.h>
23+ #include < android/hardware/graphics/composer/2.4/types.h>
2224
2325#include < aidl/android/hardware/graphics/common/DisplayHotplugEvent.h>
2426#include < aidl/android/hardware/graphics/common/Hdr.h>
2527#include < aidl/android/hardware/graphics/composer3/Composition.h>
2628#include < aidl/android/hardware/graphics/composer3/DisplayCapability.h>
2729#include < aidl/android/hardware/graphics/composer3/DisplayConfiguration.h>
30+ #include < aidl/android/hardware/graphics/composer3/IComposerClient.h>
2831#include < aidl/android/hardware/graphics/composer3/VrrConfig.h>
2932
33+ #include < ftl/enum.h>
34+
3035#define ERROR_HAS_CHANGES 5
3136
3237namespace android {
@@ -46,7 +51,6 @@ using types::V1_2::ColorMode;
4651using types::V1_2::Dataspace;
4752using types::V1_2::PixelFormat;
4853
49- using V2_1::Error;
5054using V2_4::IComposer;
5155using V2_4::IComposerCallback;
5256using V2_4::IComposerClient;
@@ -78,6 +82,22 @@ using Hdr = aidl::android::hardware::graphics::common::Hdr;
7882using DisplayConfiguration = V3_0::DisplayConfiguration;
7983using VrrConfig = V3_0::VrrConfig;
8084
85+ enum class Error : int32_t {
86+ NONE = static_cast <int32_t >(V2_1::Error::NONE),
87+ BAD_CONFIG = static_cast <int32_t >(V2_1::Error::BAD_CONFIG),
88+ BAD_DISPLAY = static_cast <int32_t >(V2_1::Error::BAD_DISPLAY),
89+ BAD_LAYER = static_cast <int32_t >(V2_1::Error::BAD_LAYER),
90+ BAD_PARAMETER = static_cast <int32_t >(V2_1::Error::BAD_PARAMETER),
91+ NO_RESOURCES = static_cast <int32_t >(V2_1::Error::NO_RESOURCES),
92+ NOT_VALIDATED = static_cast <int32_t >(V2_1::Error::NOT_VALIDATED),
93+ UNSUPPORTED = static_cast <int32_t >(V2_1::Error::UNSUPPORTED),
94+ SEAMLESS_NOT_ALLOWED = static_cast <int32_t >(V2_4::Error::SEAMLESS_NOT_ALLOWED),
95+ SEAMLESS_NOT_POSSIBLE = static_cast <int32_t >(V2_4::Error::SEAMLESS_NOT_POSSIBLE),
96+ CONFIG_FAILED = V3_0::IComposerClient::EX_CONFIG_FAILED,
97+ PICTURE_PROFILE_MAX_EXCEEDED = V3_0::IComposerClient::EX_PICTURE_PROFILE_MAX_EXCEEDED,
98+ ftl_last = PICTURE_PROFILE_MAX_EXCEEDED
99+ };
100+
81101} // namespace hardware::graphics::composer::hal
82102
83103inline bool hasChangesError (hardware::graphics::composer::hal::Error error) {
@@ -210,7 +230,11 @@ inline std::string to_string(hardware::graphics::composer::hal::V2_4::Error erro
210230}
211231
212232inline std::string to_string (hardware::graphics::composer::hal::Error error) {
213- return to_string (static_cast <hardware::graphics::composer::hal::V2_4::Error>(error));
233+ // 5 is reserved for historical reason, during validation 5 means has changes.
234+ if (hasChangesError (error)) {
235+ return " HAS_CHANGES" ;
236+ }
237+ return ftl::enum_string (error);
214238}
215239
216240// For utils::Dumper ADL.
0 commit comments