OSDN Git Service

drm_hwcomposer: Implement SetColorModeWithIntent stub
authorAndrii Chepurnyi <andrii_chepurnyi@epam.com>
Wed, 29 Apr 2020 20:15:28 +0000 (23:15 +0300)
committerJohn Stultz <john.stultz@linaro.org>
Fri, 3 Jul 2020 20:14:38 +0000 (20:14 +0000)
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

drmhwctwo.cpp
include/drmhwctwo.h

index 4b02b6e..ae9d5da 100644 (file)
@@ -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:
index ca85fb5..712510b 100644 (file)
@@ -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,