drm_hwcomposer: Add support for color transform matrix
1. Add and wire-up CRTC CTM property support.
2. Add custom Android property to select behavior for cases
where DRM can't handle color transform matrix.
The "vendor.hwc.drm.ctm" property can be set to:
- DRM_OR_GPU (default) - Use GPU if CTM is not supported by DRM.
- DRM_OR_IGNORE - Ignore CTM if DRM doesn't support it.
The last option is useful for Android 13 and later where default
color transformation matrix is not an identity matrix.
At the moment I do not have any devices with CTM support, therefore
I can test only DRM_OR_IGNORE option.
Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
diff --git a/drm/DrmCrtc.h b/drm/DrmCrtc.h
index 64fb56f..96443cd 100644
--- a/drm/DrmCrtc.h
+++ b/drm/DrmCrtc.h
@@ -58,6 +58,10 @@
return out_fence_ptr_property_;
}
+ auto &GetCtmProperty() const {
+ return ctm_property_;
+ }
+
private:
DrmCrtc(DrmModeCrtcUnique crtc, uint32_t index)
: crtc_(std::move(crtc)), index_in_res_array_(index){};
@@ -66,6 +70,8 @@
const uint32_t index_in_res_array_;
+ DrmProperty ctm_property_;
+
DrmProperty active_property_;
DrmProperty mode_property_;
DrmProperty out_fence_ptr_property_;