[PATCH i-g-t 1/2] lib/igt_kms: Enable DRM_CLIENT_CAP_ATOMIC before enabling DRM_CLIENT_CAP_WRITEBACK_CONNECTORS

Arthur Grillo arthurgrillo at riseup.net
Thu Feb 15 19:21:04 UTC 2024


As stated at [1], we first need to set DRM_CLIENT_CAP_ATOMIC before
setting DRM_CLIENT_CAP_WRITEBACK_CONNECTORS. Fix that.

[1]: https://docs.kernel.org/gpu/drm-uapi.html?highlight=writeback#c.DRM_CLIENT_CAP_WRITEBACK_CONNECTORS

Fixes: 3642acbb74f5 ("lib/igt_kms: Add writeback support")
Signed-off-by: Arthur Grillo <arthurgrillo at riseup.net>
---
 lib/igt_kms.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/lib/igt_kms.c b/lib/igt_kms.c
index 1b4d0d7612a2..e18f6fe59882 100644
--- a/lib/igt_kms.c
+++ b/lib/igt_kms.c
@@ -2747,6 +2747,9 @@ void igt_display_require(igt_display_t *display, int drm_fd)
 	display->drm_fd = drm_fd;
 	is_intel_dev = is_intel_device(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);
@@ -2795,8 +2798,6 @@ void igt_display_require(igt_display_t *display, int drm_fd)
 	}
 
 	drmSetClientCap(drm_fd, DRM_CLIENT_CAP_UNIVERSAL_PLANES, 1);
-	if (drmSetClientCap(drm_fd, DRM_CLIENT_CAP_ATOMIC, 1) == 0)
-		display->is_atomic = 1;
 
 	if (drmSetClientCap(drm_fd, LOCAL_DRM_CLIENT_CAP_CURSOR_PLANE_HOTSPOT, 1) == 0)
 		display->has_virt_cursor_plane = 1;

-- 
2.43.0



More information about the igt-dev mailing list