diff options
author | Andrii Chepurnyi <andrii_chepurnyi@epam.com> | 2020-04-24 14:20:24 +0300 |
---|---|---|
committer | John Stultz <john.stultz@linaro.org> | 2020-07-03 20:14:25 +0000 |
commit | 50d37455a37f15689dd78b8756c016a0e22cbd94 (patch) | |
tree | 40b5fa7283965bbeb78037502b3d5e38578c3ea8 | |
parent | eb012298f3109e2faa651e881362aca8bc243d8f (diff) |
drm_hwcomposer: Implement GetRenderIntents stub
Fix VTS test GraphicsComposerHidlTest.GetRenderIntentsBadDisplay.
Signed-off-by: Andrii Chepurnyi <andrii_chepurnyi@epam.com>
Signed-off-by: John Stultz <john.stultz@linaro.org>
Change-Id: I5ceec735b5684581178070e75d96f5961b774f5f
-rw-r--r-- | drmhwctwo.cpp | 27 | ||||
-rw-r--r-- | include/drmhwctwo.h | 4 |
2 files changed, 31 insertions, 0 deletions
diff --git a/drmhwctwo.cpp b/drmhwctwo.cpp index 8338f59..4b02b6e 100644 --- a/drmhwctwo.cpp +++ b/drmhwctwo.cpp @@ -1029,6 +1029,26 @@ HWC2::Error DrmHwcTwo::HwcDisplay::GetDisplayCapabilities( } #endif /* PLATFORM_SDK_VERSION > 28 */ +#if PLATFORM_SDK_VERSION > 27 + +HWC2::Error DrmHwcTwo::HwcDisplay::GetRenderIntents( + int32_t mode, uint32_t *outNumIntents, + int32_t * /*android_render_intent_v1_1_t*/ outIntents) { + if (mode != HAL_COLOR_MODE_NATIVE) { + return HWC2::Error::BadParameter; + } + + if (outIntents == nullptr) { + *outNumIntents = 1; + return HWC2::Error::None; + } + *outNumIntents = 1; + outIntents[0] = HAL_RENDER_INTENT_COLORIMETRIC; + return HWC2::Error::None; +} + +#endif /* PLATFORM_SDK_VERSION > 27 */ + HWC2::Error DrmHwcTwo::HwcLayer::SetCursorPosition(int32_t x, int32_t y) { supported(__func__); cursor_x_ = x; @@ -1345,6 +1365,13 @@ hwc2_function_pointer_t DrmHwcTwo::HookDevGetFunction( return ToHook<HWC2_PFN_VALIDATE_DISPLAY>( DisplayHook<decltype(&HwcDisplay::ValidateDisplay), &HwcDisplay::ValidateDisplay, uint32_t *, uint32_t *>); +#if PLATFORM_SDK_VERSION > 27 + case HWC2::FunctionDescriptor::GetRenderIntents: + return ToHook<HWC2_PFN_GET_RENDER_INTENTS>( + DisplayHook<decltype(&HwcDisplay::GetRenderIntents), + &HwcDisplay::GetRenderIntents, int32_t, uint32_t *, + int32_t *>); +#endif #if PLATFORM_SDK_VERSION > 28 case HWC2::FunctionDescriptor::GetDisplayIdentificationData: return ToHook<HWC2_PFN_GET_DISPLAY_IDENTIFICATION_DATA>( diff --git a/include/drmhwctwo.h b/include/drmhwctwo.h index 2bbe334..ca85fb5 100644 --- a/include/drmhwctwo.h +++ b/include/drmhwctwo.h @@ -190,6 +190,10 @@ class DrmHwcTwo : public hwc2_device_t { uint32_t *num_elements, hwc2_layer_t *layers, int32_t *layer_requests); HWC2::Error GetDisplayType(int32_t *type); +#if PLATFORM_SDK_VERSION > 27 + HWC2::Error GetRenderIntents(int32_t mode, uint32_t *outNumIntents, + int32_t *outIntents); +#endif #if PLATFORM_SDK_VERSION > 28 HWC2::Error GetDisplayIdentificationData(uint8_t *outPort, uint32_t *outDataSize, |