summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKalyan Kondapally <kalyan.kondapally@intel.com>2016-11-10 10:59:50 -0800
committerRobert Foss <robert.foss@collabora.com>2017-03-20 15:11:44 -0400
commitf104749ab9e383d8c53bcfa27a4e811c8798b2b7 (patch)
tree463b9c526b24f4b2e3f16a3ebdf82a54f3e55401
parente484c7ffc646232980325a226c2bff780f247d3d (diff)
downloaddrm_hwcomposer-f104749ab9e383d8c53bcfa27a4e811c8798b2b7.tar.gz
drm_hwcomposer-f104749ab9e383d8c53bcfa27a4e811c8798b2b7.tar.xz
drm_hwcomposer: Add support for GetColorModes & SetCursorPosition
For now we just return HAL_COLOR_MODE_NATIVE and store cursor position. Bug ID: #7 Test: None. Change-Id: Id6a7e157dbd9fc41fc53c0e33a6eb523632b9b7a Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
-rw-r--r--drmhwctwo.cpp18
-rw-r--r--drmhwctwo.h3
2 files changed, 15 insertions, 6 deletions
diff --git a/drmhwctwo.cpp b/drmhwctwo.cpp
index 75fdf00..8f37995 100644
--- a/drmhwctwo.cpp
+++ b/drmhwctwo.cpp
@@ -319,8 +319,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,
@@ -630,8 +635,8 @@ 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);
+ color_mode_ = mode;
+ return HWC2::Error::None;
}
HWC2::Error DrmHwcTwo::HwcDisplay::SetColorTransform(const float *matrix,
@@ -706,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;
};