drm_hwcomposer: Add getter/setter for Colorspace
Optionally, get the Colorspace drm property and populate an enum mapping
for the property types. Add implementation to HwcDisplay::SetColorMode
to set this property and map between HAL_COLOR_MODE types to Colorspace
formats.
Change-Id: Id532e94207c1b1a2623b7d77db239735df18b30f
Signed-off-by: Sasha McIntosh <sashamcintosh@google.com>
diff --git a/drm/DrmConnector.h b/drm/DrmConnector.h
index 6140e6c..8063fd8 100644
--- a/drm/DrmConnector.h
+++ b/drm/DrmConnector.h
@@ -27,6 +27,8 @@
#include "DrmProperty.h"
#include "DrmUnique.h"
+#include "compositor/ColorInfo.h"
+
namespace android {
class DrmDevice;
@@ -94,6 +96,14 @@
return edid_property_;
}
+ auto &GetColorspaceProperty() const {
+ return colorspace_property_;
+ }
+
+ auto GetColorspacePropertyValue(Colorspace c) {
+ return colorspace_enum_map_[c];
+ }
+
auto &GetContentTypeProperty() const {
return content_type_property_;
}
@@ -138,10 +148,13 @@
DrmProperty dpms_property_;
DrmProperty crtc_id_property_;
DrmProperty edid_property_;
+ DrmProperty colorspace_property_;
DrmProperty content_type_property_;
DrmProperty writeback_pixel_formats_;
DrmProperty writeback_fb_id_;
DrmProperty writeback_out_fence_;
+
+ std::map<Colorspace, uint64_t> colorspace_enum_map_;
};
} // namespace android