[PATCH i-g-t 1/2] tests/kms_plane_cursor: check for display before cursor size

Jakub Kolakowski jakub1.kolakowski at intel.com
Mon Apr 7 14:45:03 UTC 2025


Currently igt_display_require() and igt_display_require_output() is
called after trying to get cursor width and height which leads to
fails on configurations that do not have display enabled.
Move igt_display_require() and igt_display_require_output() before
getting cursor width and height so instead test will skip on
configurations without display.

Signed-off-by: Jakub Kolakowski <jakub1.kolakowski at intel.com>
---
 tests/kms_plane_cursor.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/tests/kms_plane_cursor.c b/tests/kms_plane_cursor.c
index fd9e00085..1b72515f7 100644
--- a/tests/kms_plane_cursor.c
+++ b/tests/kms_plane_cursor.c
@@ -307,17 +307,17 @@ igt_main
 
 		data.drm_fd = drm_open_driver_master(DRIVER_ANY);
 
+		igt_display_require(&data.display, data.drm_fd);
+		igt_require(data.display.is_atomic);
+		igt_display_require_output(&data.display);
+		display = &data.display;
+
 		ret = drmGetCap(data.drm_fd, DRM_CAP_CURSOR_WIDTH, &data.max_curw);
 		igt_assert(ret == 0 || errno == EINVAL);
 		ret = drmGetCap(data.drm_fd, DRM_CAP_CURSOR_HEIGHT, &data.max_curh);
 		igt_assert(ret == 0 || errno == EINVAL);
 
 		kmstest_set_vt_graphics_mode();
-
-		igt_display_require(&data.display, data.drm_fd);
-		igt_require(data.display.is_atomic);
-		igt_display_require_output(&data.display);
-		display = &data.display;
 	}
 
 	for (i = 0; i < ARRAY_SIZE(tests); i++) {
-- 
2.34.1



More information about the igt-dev mailing list