From: Harry Wentland <[email protected]>

Extend COLOR_ENCODING and COLOR_RANGE property creation to overlay
planes in addition to primary planes. This allows overlay planes to
use YUV formats with proper color space configuration when the
hardware supports NV12/P010 formats.

These properties control the YUV-to-RGB conversion matrix selection
(BT.601/BT.709/BT.2020) and range handling (limited/full range).

Co-developed by Claude Sonnet 4.5.

Reviewed-by: Alex Hung <[email protected]>
Signed-off-by: Harry Wentland <[email protected]>
Signed-off-by: Alex Hung <[email protected]>
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c 
b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c
index c7f270626715..0464def3fdb3 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c
@@ -1864,7 +1864,8 @@ int amdgpu_dm_plane_init(struct amdgpu_display_manager 
*dm,
                drm_plane_create_zpos_immutable_property(plane, 255);
        }
 
-       if (plane->type == DRM_PLANE_TYPE_PRIMARY &&
+       if ((plane->type == DRM_PLANE_TYPE_PRIMARY ||
+            plane->type == DRM_PLANE_TYPE_OVERLAY) &&
            plane_cap &&
            (plane_cap->pixel_format_support.nv12 ||
             plane_cap->pixel_format_support.p010)) {
-- 
2.43.0

Reply via email to