diff options
author | Sean Paul <seanpaul@chromium.org> | 2017-05-04 18:03:11 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2017-05-04 18:03:12 +0000 |
commit | b2a9617bc88bb5cf5ffd999e9aa8009eeac5ae21 (patch) | |
tree | 52c0f8e5ccd7c3d9724bbb24fe4e0d2f91838ef3 | |
parent | ba494c8efc0a210b1bd4af6358b60f52900dd8af (diff) | |
parent | da5839cf9258f7b06b78c8a22e5749e390603b11 (diff) | |
download | drm_hwcomposer-b2a9617bc88bb5cf5ffd999e9aa8009eeac5ae21.tar.gz |
Merge "drm_hwcomposer: Add support for GetColorModes & SetCursorPosition"
-rw-r--r-- | drmhwctwo.cpp | 22 | ||||
-rw-r--r-- | drmhwctwo.h | 3 |
2 files changed, 19 insertions, 6 deletions
diff --git a/drmhwctwo.cpp b/drmhwctwo.cpp index b13fce1..8c853f4 100644 --- a/drmhwctwo.cpp +++ b/drmhwctwo.cpp @@ -315,8 +315,13 @@ HWC2::Error DrmHwcTwo::HwcDisplay::GetClientTargetSupport(uint32_t width, HWC2::Error DrmHwcTwo::HwcDisplay::GetColorModes(uint32_t *num_modes, int32_t *modes) { supported(__func__); - // TODO: android_color_mode_t isn't defined yet! - return unsupported(__func__, num_modes, modes); + if (!modes) + *num_modes = 1; + + if (modes) + *modes = HAL_COLOR_MODE_NATIVE; + + return HWC2::Error::None; } HWC2::Error DrmHwcTwo::HwcDisplay::GetDisplayAttribute(hwc2_config_t config, @@ -626,8 +631,12 @@ HWC2::Error DrmHwcTwo::HwcDisplay::SetClientTarget(buffer_handle_t target, HWC2::Error DrmHwcTwo::HwcDisplay::SetColorMode(int32_t mode) { supported(__func__); - // TODO: android_color_mode_t isn't defined yet! - return unsupported(__func__, mode); + + if (mode != HAL_COLOR_MODE_NATIVE) + return HWC2::Error::Unsupported; + + color_mode_ = mode; + return HWC2::Error::None; } HWC2::Error DrmHwcTwo::HwcDisplay::SetColorTransform(const float *matrix, @@ -702,8 +711,9 @@ HWC2::Error DrmHwcTwo::HwcDisplay::ValidateDisplay(uint32_t *num_types, HWC2::Error DrmHwcTwo::HwcLayer::SetCursorPosition(int32_t x, int32_t y) { supported(__func__); - // TODO: Implement proper cursor support - return unsupported(__func__, x, y); + cursor_x_ = x; + cursor_y_ = y; + return HWC2::Error::None; } HWC2::Error DrmHwcTwo::HwcLayer::SetLayerBlendMode(int32_t mode) { diff --git a/drmhwctwo.h b/drmhwctwo.h index 038412d..0490e2a 100644 --- a/drmhwctwo.h +++ b/drmhwctwo.h @@ -118,6 +118,8 @@ class DrmHwcTwo : public hwc2_device_t { hwc_rect_t display_frame_; float alpha_ = 1.0f; hwc_frect_t source_crop_; + int32_t cursor_x_; + int32_t cursor_y_; HWC2::Transform transform_ = HWC2::Transform::None; uint32_t z_order_ = 0; android_dataspace_t dataspace_ = HAL_DATASPACE_UNKNOWN; @@ -205,6 +207,7 @@ class DrmHwcTwo : public hwc2_device_t { HwcLayer client_layer_; UniqueFd retire_fence_; UniqueFd next_retire_fence_; + int32_t color_mode_; uint32_t frame_no_ = 0; }; |