[PATCH] tests/kms_writeback: Set atomic and writeback_connector early

Alex Hung alex.hung at amd.com
Mon May 13 23:03:56 UTC 2024


With dc2d7fb4f978, all kms_writeback subtests are skipped.

DRM_CLIENT_CAP_ATOMIC and DRM_CLIENT_CAP_WRITEBACK_CONNECTORS
need to be set before igt_require which initializes a list
of outputs including writeback.

Fixes: dc2d7fb4f978 ("lib/igt_kms: move setting DRM_CLIENT_CAP_WRITEBACK_CONNECTORS to kms_writeback")
Signed-off-by: Alex Hung <alex.hung at amd.com>
---
 tests/kms_writeback.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/tests/kms_writeback.c b/tests/kms_writeback.c
index f89b2d62f..65d4db26b 100644
--- a/tests/kms_writeback.c
+++ b/tests/kms_writeback.c
@@ -567,14 +567,17 @@ igt_main_args("b:c:f:dl", long_options, help_str, opt_handler, NULL)
 
 		kmstest_set_vt_graphics_mode();
 
-		igt_display_require(&display, display.drm_fd);
-
-		igt_require(display.is_atomic);
+		if (drmSetClientCap(display.drm_fd, DRM_CLIENT_CAP_ATOMIC, 1) == 0)
+			display.is_atomic = 1;
 
 		ret = drmSetClientCap(display.drm_fd, DRM_CLIENT_CAP_WRITEBACK_CONNECTORS, 1);
 
 		igt_require_f(!ret, "error setting DRM_CLIENT_CAP_WRITEBACK_CONNECTORS\n");
 
+		igt_display_require(&display, display.drm_fd);
+
+		igt_require(display.is_atomic);
+
 		output = kms_writeback_get_output(&display);
 		igt_require(output);
 
-- 
2.34.1



More information about the igt-dev mailing list