[RFC PATCH i-g-t] lib/igt_kms: move setting DRM_CLIENT_CAP_WRITEBACK_CONNECTORS to kms_writeback

Abhinav Kumar quic_abhinavk at quicinc.com
Wed Apr 3 01:33:00 UTC 2024


Currently DRM_CLIENT_CAP_WRITEBACK_CONNECTORS is set in the igt_display_require()
which is invoked for all IGT tests irrespective of whether the rest of the
writeback connector properties such as the FB_ID are set.

This results in all IGT tests running even on writeback connector
which certainly fails many tests on MSM hardware because tests such as CTM
rely on CRC being collected post CTM in the display pipeline but for MSM hardware
there is no CRC collection point post CTM for writeback connectors.

It is unclear whether this is intentional to be able to run all IGT tests even
with writeback connector or it is only kms_writeback which is supposed to
be the one.

Lets try with the latter approach by setting DRM_CLIENT_CAP_WRITEBACK_CONNECTORS
only within kms_writeback.

Signed-off-by: Abhinav Kumar <quic_abhinavk at quicinc.com>
---
 lib/igt_kms.c         | 2 --
 tests/kms_writeback.c | 5 +++++
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/lib/igt_kms.c b/lib/igt_kms.c
index c38021dd7f74..c03eabdf1d6e 100644
--- a/lib/igt_kms.c
+++ b/lib/igt_kms.c
@@ -2750,8 +2750,6 @@ void igt_display_require(igt_display_t *display, int drm_fd)
 	if (drmSetClientCap(drm_fd, DRM_CLIENT_CAP_ATOMIC, 1) == 0)
 		display->is_atomic = 1;
 
-	drmSetClientCap(drm_fd, DRM_CLIENT_CAP_WRITEBACK_CONNECTORS, 1);
-
 	resources = drmModeGetResources(display->drm_fd);
 	if (!resources)
 		goto out;
diff --git a/tests/kms_writeback.c b/tests/kms_writeback.c
index 6cd685b37af2..3448dc06f891 100644
--- a/tests/kms_writeback.c
+++ b/tests/kms_writeback.c
@@ -558,6 +558,7 @@ igt_main_args("b:c:f:dl", long_options, help_str, opt_handler, NULL)
 	igt_fb_t input_fb, input_fb_10bit;
 	drmModeModeInfo mode;
 	unsigned int fb_id;
+	int ret;
 
 	memset(&display, 0, sizeof(display));
 
@@ -570,6 +571,10 @@ igt_main_args("b:c:f:dl", long_options, help_str, opt_handler, NULL)
 
 		igt_require(display.is_atomic);
 
+		ret = drmSetClientCap(display.drm_fd, DRM_CLIENT_CAP_WRITEBACK_CONNECTORS, 1);
+
+		igt_require(!ret);
+
 		output = kms_writeback_get_output(&display);
 		igt_require(output);
 
-- 
2.44.0



More information about the igt-dev mailing list