summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrii Chepurnyi <andrii_chepurnyi@epam.com>2020-04-29 23:15:28 +0300
committerJohn Stultz <john.stultz@linaro.org>2020-07-03 20:14:38 +0000
commit857a53f88435373ac92afaa91f523687a3f1b04c (patch)
tree7ef0957348cce6db9a4a06f184db2fe668243953
parent50d37455a37f15689dd78b8756c016a0e22cbd94 (diff)
drm_hwcomposer: Implement SetColorModeWithIntent stub
Fix VTS test GraphicsComposerHidlTest.SetColorMode_2_2BadParameter. Signed-off-by: Andrii Chepurnyi <andrii_chepurnyi@epam.com> Signed-off-by: John Stultz <john.stultz@linaro.org> Change-Id: Ia8ae6c0d7cb2a6bf09c205a04963ed359c5126a3
-rw-r--r--drmhwctwo.cpp14
-rw-r--r--include/drmhwctwo.h1
2 files changed, 15 insertions, 0 deletions
diff --git a/drmhwctwo.cpp b/drmhwctwo.cpp
index 4b02b6e..ae9d5da 100644
--- a/drmhwctwo.cpp
+++ b/drmhwctwo.cpp
@@ -1047,6 +1047,16 @@ HWC2::Error DrmHwcTwo::HwcDisplay::GetRenderIntents(
return HWC2::Error::None;
}
+HWC2::Error DrmHwcTwo::HwcDisplay::SetColorModeWithIntent(int32_t mode,
+ int32_t intent) {
+ if (mode != HAL_COLOR_MODE_NATIVE)
+ return HWC2::Error::BadParameter;
+ if (intent != HAL_RENDER_INTENT_COLORIMETRIC)
+ return HWC2::Error::BadParameter;
+ color_mode_ = mode;
+ return HWC2::Error::None;
+}
+
#endif /* PLATFORM_SDK_VERSION > 27 */
HWC2::Error DrmHwcTwo::HwcLayer::SetCursorPosition(int32_t x, int32_t y) {
@@ -1371,6 +1381,10 @@ hwc2_function_pointer_t DrmHwcTwo::HookDevGetFunction(
DisplayHook<decltype(&HwcDisplay::GetRenderIntents),
&HwcDisplay::GetRenderIntents, int32_t, uint32_t *,
int32_t *>);
+ case HWC2::FunctionDescriptor::SetColorModeWithRenderIntent:
+ return ToHook<HWC2_PFN_SET_COLOR_MODE_WITH_RENDER_INTENT>(
+ DisplayHook<decltype(&HwcDisplay::SetColorModeWithIntent),
+ &HwcDisplay::SetColorModeWithIntent, int32_t, int32_t>);
#endif
#if PLATFORM_SDK_VERSION > 28
case HWC2::FunctionDescriptor::GetDisplayIdentificationData:
diff --git a/include/drmhwctwo.h b/include/drmhwctwo.h
index ca85fb5..712510b 100644
--- a/include/drmhwctwo.h
+++ b/include/drmhwctwo.h
@@ -193,6 +193,7 @@ class DrmHwcTwo : public hwc2_device_t {
#if PLATFORM_SDK_VERSION > 27
HWC2::Error GetRenderIntents(int32_t mode, uint32_t *outNumIntents,
int32_t *outIntents);
+ HWC2::Error SetColorModeWithIntent(int32_t mode, int32_t intent);
#endif
#if PLATFORM_SDK_VERSION > 28
HWC2::Error GetDisplayIdentificationData(uint8_t *outPort,