From: Alex Hung <[email protected]>

[WHAT]
Extend the amdgpu_dm_plane_format_mod_supported() test to cover the
rejection of a format that carries an extra plane alongside a DCC
modifier.

[HOW]
Reuse the existing GFX9 DCC modifier and ask for XRGB8888_A8, whose
4 bytes-per-pixel main plane passes the bpp check but whose alpha
plane collides with the DCC metadata plane.

Assisted-by: Copilot:Claude-Opus-5
Reviewed-by: Bhawanpreet Lakha <[email protected]>
Signed-off-by: Alex Hung <[email protected]>
Signed-off-by: Chenyu Chen <[email protected]>
---
 .../drm/amd/display/amdgpu_dm/tests/amdgpu_dm_plane_test.c   | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/tests/amdgpu_dm_plane_test.c 
b/drivers/gpu/drm/amd/display/amdgpu_dm/tests/amdgpu_dm_plane_test.c
index 1b39f41c8414..939f79422d7e 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/tests/amdgpu_dm_plane_test.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/tests/amdgpu_dm_plane_test.c
@@ -506,6 +506,11 @@ static void dm_test_format_mod_supported(struct kunit 
*test)
 
        KUNIT_EXPECT_FALSE(test,
                           amdgpu_dm_plane_format_mod_supported(plane, 
DRM_FORMAT_NV12, listed_mod));
+
+       /* 4 bytes per pixel, but its extra plane collides with the DCC 
metadata plane. */
+       KUNIT_EXPECT_FALSE(test,
+                          amdgpu_dm_plane_format_mod_supported(plane, 
DRM_FORMAT_XRGB8888_A8,
+                                                               listed_mod));
 }
 
 /**
-- 
2.43.0

Reply via email to