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/DrmAtomicStateManager.h b/drm/DrmAtomicStateManager.h
index e456a91..6e32a37 100644
--- a/drm/DrmAtomicStateManager.h
+++ b/drm/DrmAtomicStateManager.h
@@ -35,6 +35,7 @@
std::optional<DrmMode> display_mode;
std::optional<bool> active;
std::shared_ptr<DrmKmsPlan> composition;
+ std::shared_ptr<drm_color_ctm> color_matrix;
/* out */
SharedFd out_fence;
@@ -75,6 +76,7 @@
std::vector<std::shared_ptr<DrmFbIdHandle>> used_framebuffers;
DrmModeUserPropertyBlobUnique mode_blob;
+ DrmModeUserPropertyBlobUnique ctm_blob;
int release_fence_pt_index{};