[igt-dev] [PATCH i-g-t v3] tests/kms_hdr: Fix bpc-switch tests on AMD hardware

Jeremy Cline jcline at redhat.com
Wed Mar 10 16:34:34 UTC 2021


Kernel commit b836a274b797 ("drm/amdgpu/dc: Require primary plane to be
enabled whenever the CRTC is") causes the bpc-switch tests to fail
since the primary plane fb is being removed, which leads to the next
atomic commit failing with -EINVAL.

Fix this by leaving the primary plane in place for amdgpu devices.

Signed-off-by: Jeremy Cline <jcline at redhat.com>
---
Changes from v2:
  - Instead of skipping on pre-Kaby Lake, only remove the primary
    plane for AMD devices (thanks for the feedback Petri, Swati,
    and Uma!)

 tests/kms_hdr.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/tests/kms_hdr.c b/tests/kms_hdr.c
index e9dd7f27..5b8529c8 100644
--- a/tests/kms_hdr.c
+++ b/tests/kms_hdr.c
@@ -223,7 +223,14 @@ static void test_bpc_switch_on_output(data_t *data, igt_output_t *output,
 			data->h = afb.height;
 		}
 
-		igt_plane_set_fb(data->primary, NULL);
+		/*
+		 * amdgpu requires a primary plane when the CRTC is enabled.
+		 * However, some older Intel hardware (hsw) have scaling
+		 * requirements that are not met by the plane, so remove it
+		 * for non-AMD devices.
+		 */
+		if (!is_amdgpu_device(data->fd))
+			igt_plane_set_fb(data->primary, NULL);
 
 		/*
 		 * i915 driver doesn't expose max bpc as debugfs entry,
-- 
2.30.1



More information about the igt-dev mailing list