OSDN Git Service

drm_hwcomposer: Add simplistic SetLayerColor implementation
authorRoman Kovalivskyi <roman.kovalivskyi@globallogic.com>
Wed, 11 Dec 2019 15:48:44 +0000 (17:48 +0200)
committerRoman Kovalivskyi <roman.kovalivskyi@globallogic.com>
Mon, 16 Dec 2019 15:54:03 +0000 (17:54 +0200)
VTS tests for SET_LAYER_COLOR fails for now since SetLayerColor is
unsupported function. Tis commit tries to address this issue. We can't
fully implement it for now, therefore simplistic implementation that
just saves argument for future uses and satisfies the interface could
be used instead, for now.

Commit da5839cf9258 ("drm_hwcomposer: Add support for GetColorModes &
SetCursorPosition") implements GetColorModes and SetCursorPosition in
the same fashion, simply by adding fields that store this values for
future uses, therefore we assume that it is okay to use this approach
here too.

Signed-off-by: Roman Kovalivskyi <roman.kovalivskyi@globallogic.com>
drmhwctwo.cpp
include/drmhwctwo.h

index c34c0b7..a1f8232 100644 (file)
@@ -921,8 +921,10 @@ HWC2::Error DrmHwcTwo::HwcLayer::SetLayerBuffer(buffer_handle_t buffer,
 }
 
 HWC2::Error DrmHwcTwo::HwcLayer::SetLayerColor(hwc_color_t color) {
-  // TODO: Punt to client composition here?
-  return unsupported(__func__, color);
+  // TODO: Put to client composition here?
+  supported(__func__);
+  layer_color_ = color;
+  return HWC2::Error::None;
 }
 
 HWC2::Error DrmHwcTwo::HwcLayer::SetLayerCompositionType(int32_t type) {
index 90cffa4..361bce9 100644 (file)
@@ -124,6 +124,7 @@ class DrmHwcTwo : public hwc2_device_t {
     hwc_frect_t source_crop_;
     int32_t cursor_x_;
     int32_t cursor_y_;
+    hwc_color_t layer_color_;
     HWC2::Transform transform_ = HWC2::Transform::None;
     uint32_t z_order_ = 0;
     android_dataspace_t dataspace_ = HAL_DATASPACE_UNKNOWN;