diff options
author | Sean Paul <seanpaul@chromium.org> | 2017-05-04 18:15:23 +0000 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2017-05-04 18:15:23 +0000 |
commit | 9a003f37b36d300603f1560e0004f858a2fb9771 (patch) | |
tree | 005ba2aaabefee5595829f1e10fd7564e2d6ffd3 | |
parent | 64cacd753bf0425737bfaf40e55077059c8da6bd (diff) | |
parent | 5c2a2479c1b75bb659495da0c0e3a5f80db1d722 (diff) | |
download | drm_hwcomposer-9a003f37b36d300603f1560e0004f858a2fb9771.tar.gz |
Merge "drm_hwcomposer: Add support for GetColorModes & SetCursorPosition" am: b2a9617bc8 am: c604f0a549
am: 5c2a2479c1
Change-Id: Id881dc357afb32dbe4f66a855d72568e4f0d0aac
-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; }; |