Skip to contentSkip to conversation

tests/kms_cursor_crc: Limit cursor size based

PATCH Superseded Karthik B S 3 participants 7 messages May 6, 2019 – May 10, 2019

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 tests/kms_cursor_crc: Limit cursor size based

Limiting the maximum cursor size being used in subtests based on platform capability, to avoid skipping of subtests.

Karthik B S (1):
tests/kms_cursor_crc: Limit cursor size based on platform capability.

 tests/kms_cursor_crc.c | 102 ++++++++++++++++++++++++-------------------------
 1 file changed, 49 insertions(+), 53 deletions(-)
Signature · 6 lines
2.7.4

_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
#1 lore raw

PATCH v2 1/1 tests/kms_cursor_crc: Limit cursor size based on platform capability.

Limiting the cursor size of subtests to the maximum size listed as per the platform capability, so that we can avoid skipping of subtests.

Instead of spliting into subtests based on cursor size, here spliting of subtests is done based on functionality. Maximum size of cursor is restricted at run time based on platform capability.

v2: Keep platform capability fetch inside igt_fixture.

---
 tests/kms_cursor_crc.c | 102 ++++++++++++++++++++++++-------------------------
 1 file changed, 49 insertions(+), 53 deletions(-)
tests/kms_cursor_crc.c +49 -53
index fd74fda..08a6c2a 100644
@@ -44,6 +44,8 @@ IGT_TEST_DESCRIPTION(
 #ifndef DRM_CAP_CURSOR_HEIGHT
 #define DRM_CAP_CURSOR_HEIGHT 0x9
 #endif
+#define SQUARE    1
+#define NONSQUARE 0
 
 typedef struct {
 	int drm_fd;
@@ -470,9 +472,6 @@ static void run_test(data_t *data, void (*testfunc)(data_t *), int cursor_w, int
 	enum pipe p;
 	int valid_tests = 0;
 
-	igt_require(cursor_w <= data->cursor_max_w &&
-		    cursor_h <= data->cursor_max_h);
-
 	for_each_pipe_with_valid_output(display, p, output) {
 		data->output = output;
 		data->pipe = p;
@@ -481,15 +480,15 @@ static void run_test(data_t *data, void (*testfunc)(data_t *), int cursor_w, int
 
 		valid_tests++;
 
-		igt_info("Beginning %s on pipe %s, connector %s\n",
-			  igt_subtest_name(),
+		igt_info("Beginning %s with size %dx%d on pipe %s, connector %s\n",
+			  igt_subtest_name(), cursor_w, cursor_h,
 			  kmstest_pipe_name(data->pipe),
 			  igt_output_name(output));
 
 		testfunc(data);
 
-		igt_info("\n%s on pipe %s, connector %s: PASSED\n\n",
-			  igt_subtest_name(),
+		igt_info("\n%s with size %dx%d on pipe %s, connector %s: PASSED\n\n",
+			  igt_subtest_name(), cursor_w, cursor_h,
 			  kmstest_pipe_name(data->pipe),
 			  igt_output_name(output));
 
@@ -639,75 +638,72 @@ static void test_rapid_movement(data_t *data)
 
 }
 
-static void run_test_generic(data_t *data)
+static void test_cursor(data_t *data, void (*testfunc)(data_t *), bool square)
 {
 	int cursor_size;
-	for (cursor_size = 64; cursor_size <= 512; cursor_size *= 2) {
+	for (cursor_size = 64; cursor_size <= data->cursor_max_w;
+	     cursor_size *= 2) {
 		int w = cursor_size;
 		int h = cursor_size;
 
-		igt_fixture
-			create_cursor_fb(data, w, h);
-
-		/* Using created cursor FBs to test cursor support */
-		igt_subtest_f("cursor-%dx%d-onscreen", w, h)
-			run_test(data, test_crc_onscreen, w, h);
-		igt_subtest_f("cursor-%dx%d-offscreen", w, h)
-			run_test(data, test_crc_offscreen, w, h);
-		igt_subtest_f("cursor-%dx%d-sliding", w, h)
-			run_test(data, test_crc_sliding, w, h);
-		igt_subtest_f("cursor-%dx%d-random", w, h)
-			run_test(data, test_crc_random, w, h);
-		igt_subtest_f("cursor-%dx%d-dpms", w, h) {
+		/*
+		 * Test non-square cursors a bit on the platforms
+		 * that support such things. And make it a bit more
+		 * interesting by using a non-pot height.
+		 */
+		if (!square)
+			h /= 3;
+
+		create_cursor_fb(data, w, h);
+
+		run_test(data, testfunc, w, h);
+
+		igt_remove_fb(data->drm_fd, &data->fb);
+	}
+}
+
+static void run_test_generic(data_t *data)
+{
+		igt_subtest_f("square-cursor-onscreen")
+			test_cursor(data, test_crc_onscreen, SQUARE);
+		igt_subtest_f("square-cursor-offscreen")
+			test_cursor(data, test_crc_offscreen, SQUARE);
+		igt_subtest_f("square-cursor-sliding")
+			test_cursor(data, test_crc_sliding, SQUARE);
+		igt_subtest_f("square-cursor-random")
+			test_cursor(data, test_crc_random, SQUARE);
+		igt_subtest_f("square-cursor-dpms") {
 			data->flags = TEST_DPMS;
-			run_test(data, test_crc_random, w, h);
+			test_cursor(data, test_crc_random, SQUARE);
 			data->flags = 0;
 		}
 
-		igt_subtest_f("cursor-%dx%d-suspend", w, h) {
+		igt_subtest_f("square-cursor-suspend") {
 			data->flags = TEST_SUSPEND;
-			run_test(data, test_crc_random, w, h);
+			test_cursor(data, test_crc_random, SQUARE);
 			data->flags = 0;
 		}
 
-		igt_subtest_f("cursor-%dx%d-rapid-movement", w, h) {
-			run_test(data, test_rapid_movement, w, h);
+		igt_subtest_f("square-cursor-rapid-movement") {
+			test_cursor(data, test_rapid_movement, SQUARE);
 		}
 
-		igt_fixture
-			igt_remove_fb(data->drm_fd, &data->fb);
-
-		/*
-		 * Test non-square cursors a bit on the platforms
-		 * that support such things. And make it a bit more
-		 * interesting by using a non-pot height.
-		 */
-		h /= 3;
-
-		igt_fixture
-			create_cursor_fb(data, w, h);
-
-		/* Using created cursor FBs to test cursor support */
-		igt_subtest_f("cursor-%dx%d-onscreen", w, h) {
+		igt_subtest_f("non-square-cursor-onscreen") {
 			igt_require(has_nonsquare_cursors(data));
-			run_test(data, test_crc_onscreen, w, h);
+			test_cursor(data, test_crc_onscreen, NONSQUARE);
 		}
-		igt_subtest_f("cursor-%dx%d-offscreen", w, h) {
+		igt_subtest_f("non-square-cursor-offscreen") {
 			igt_require(has_nonsquare_cursors(data));
-			run_test(data, test_crc_offscreen, w, h);
+			test_cursor(data, test_crc_offscreen, NONSQUARE);
 		}
-		igt_subtest_f("cursor-%dx%d-sliding", w, h) {
+		igt_subtest_f("non-square-cursor-sliding") {
 			igt_require(has_nonsquare_cursors(data));
-			run_test(data, test_crc_sliding, w, h);
+			test_cursor(data, test_crc_sliding, NONSQUARE);
 		}
-		igt_subtest_f("cursor-%dx%d-random", w, h) {
+		igt_subtest_f("non-square-cursor-random") {
 			igt_require(has_nonsquare_cursors(data));
-			run_test(data, test_crc_random, w, h);
+			test_cursor(data, test_crc_random, NONSQUARE);
 		}
-
-		igt_fixture
-			igt_remove_fb(data->drm_fd, &data->fb);
-	}
 }
 
 static data_t data;
Signature · 6 lines
2.7.4

_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
#2 lore raw

Re: [igt-dev] [PATCH i-g-t v2] tests/kms_cursor_crc: Limit cursor size based on platform capability.

Quoted 2 lines · Karthik B S

Limiting the cursor size of subtests to the maximum size listed as per the platform capability, so that we can avoid skipping of subtests.

Why?

Quoted 182 lines

Instead of spliting into subtests based on cursor size, here spliting of subtests is done based on functionality. Maximum size of cursor is restricted at run time based on platform capability.

v2: Keep platform capability fetch inside igt_fixture.

---
 tests/kms_cursor_crc.c | 102 ++++++++++++++++++++++++-------------------------
 1 file changed, 49 insertions(+), 53 deletions(-)
tests/kms_cursor_crc.c +49 -53
index fd74fda..08a6c2a 100644
@@ -44,6 +44,8 @@ IGT_TEST_DESCRIPTION(
 #ifndef DRM_CAP_CURSOR_HEIGHT
 #define DRM_CAP_CURSOR_HEIGHT 0x9
 #endif
+#define SQUARE    1
+#define NONSQUARE 0
 
 typedef struct {
 	int drm_fd;
@@ -470,9 +472,6 @@ static void run_test(data_t *data, void (*testfunc)(data_t *), int cursor_w, int
 	enum pipe p;
 	int valid_tests = 0;
 
-	igt_require(cursor_w <= data->cursor_max_w &&
-		    cursor_h <= data->cursor_max_h);
-
 	for_each_pipe_with_valid_output(display, p, output) {
 		data->output = output;
 		data->pipe = p;
@@ -481,15 +480,15 @@ static void run_test(data_t *data, void (*testfunc)(data_t *), int cursor_w, int
 
 		valid_tests++;
 
-		igt_info("Beginning %s on pipe %s, connector %s\n",
-			  igt_subtest_name(),
+		igt_info("Beginning %s with size %dx%d on pipe %s, connector %s\n",
+			  igt_subtest_name(), cursor_w, cursor_h,
 			  kmstest_pipe_name(data->pipe),
 			  igt_output_name(output));
 
 		testfunc(data);
 
-		igt_info("\n%s on pipe %s, connector %s: PASSED\n\n",
-			  igt_subtest_name(),
+		igt_info("\n%s with size %dx%d on pipe %s, connector %s: PASSED\n\n",
+			  igt_subtest_name(), cursor_w, cursor_h,
 			  kmstest_pipe_name(data->pipe),
 			  igt_output_name(output));
 
@@ -639,75 +638,72 @@ static void test_rapid_movement(data_t *data)
 
 }
 
-static void run_test_generic(data_t *data)
+static void test_cursor(data_t *data, void (*testfunc)(data_t *), bool square)
 {
 	int cursor_size;
-	for (cursor_size = 64; cursor_size <= 512; cursor_size *= 2) {
+	for (cursor_size = 64; cursor_size <= data->cursor_max_w;
+	     cursor_size *= 2) {
 		int w = cursor_size;
 		int h = cursor_size;
 
-		igt_fixture
-			create_cursor_fb(data, w, h);
-
-		/* Using created cursor FBs to test cursor support */
-		igt_subtest_f("cursor-%dx%d-onscreen", w, h)
-			run_test(data, test_crc_onscreen, w, h);
-		igt_subtest_f("cursor-%dx%d-offscreen", w, h)
-			run_test(data, test_crc_offscreen, w, h);
-		igt_subtest_f("cursor-%dx%d-sliding", w, h)
-			run_test(data, test_crc_sliding, w, h);
-		igt_subtest_f("cursor-%dx%d-random", w, h)
-			run_test(data, test_crc_random, w, h);
-		igt_subtest_f("cursor-%dx%d-dpms", w, h) {
+		/*
+		 * Test non-square cursors a bit on the platforms
+		 * that support such things. And make it a bit more
+		 * interesting by using a non-pot height.
+		 */
+		if (!square)
+			h /= 3;
+
+		create_cursor_fb(data, w, h);
+
+		run_test(data, testfunc, w, h);
+
+		igt_remove_fb(data->drm_fd, &data->fb);
+	}
+}
+
+static void run_test_generic(data_t *data)
+{
+		igt_subtest_f("square-cursor-onscreen")
+			test_cursor(data, test_crc_onscreen, SQUARE);
+		igt_subtest_f("square-cursor-offscreen")
+			test_cursor(data, test_crc_offscreen, SQUARE);
+		igt_subtest_f("square-cursor-sliding")
+			test_cursor(data, test_crc_sliding, SQUARE);
+		igt_subtest_f("square-cursor-random")
+			test_cursor(data, test_crc_random, SQUARE);
+		igt_subtest_f("square-cursor-dpms") {
 			data->flags = TEST_DPMS;
-			run_test(data, test_crc_random, w, h);
+			test_cursor(data, test_crc_random, SQUARE);
 			data->flags = 0;
 		}
 
-		igt_subtest_f("cursor-%dx%d-suspend", w, h) {
+		igt_subtest_f("square-cursor-suspend") {
 			data->flags = TEST_SUSPEND;
-			run_test(data, test_crc_random, w, h);
+			test_cursor(data, test_crc_random, SQUARE);
 			data->flags = 0;
 		}
 
-		igt_subtest_f("cursor-%dx%d-rapid-movement", w, h) {
-			run_test(data, test_rapid_movement, w, h);
+		igt_subtest_f("square-cursor-rapid-movement") {
+			test_cursor(data, test_rapid_movement, SQUARE);
 		}
 
-		igt_fixture
-			igt_remove_fb(data->drm_fd, &data->fb);
-
-		/*
-		 * Test non-square cursors a bit on the platforms
-		 * that support such things. And make it a bit more
-		 * interesting by using a non-pot height.
-		 */
-		h /= 3;
-
-		igt_fixture
-			create_cursor_fb(data, w, h);
-
-		/* Using created cursor FBs to test cursor support */
-		igt_subtest_f("cursor-%dx%d-onscreen", w, h) {
+		igt_subtest_f("non-square-cursor-onscreen") {
 			igt_require(has_nonsquare_cursors(data));
-			run_test(data, test_crc_onscreen, w, h);
+			test_cursor(data, test_crc_onscreen, NONSQUARE);
 		}
-		igt_subtest_f("cursor-%dx%d-offscreen", w, h) {
+		igt_subtest_f("non-square-cursor-offscreen") {
 			igt_require(has_nonsquare_cursors(data));
-			run_test(data, test_crc_offscreen, w, h);
+			test_cursor(data, test_crc_offscreen, NONSQUARE);
 		}
-		igt_subtest_f("cursor-%dx%d-sliding", w, h) {
+		igt_subtest_f("non-square-cursor-sliding") {
 			igt_require(has_nonsquare_cursors(data));
-			run_test(data, test_crc_sliding, w, h);
+			test_cursor(data, test_crc_sliding, NONSQUARE);
 		}
-		igt_subtest_f("cursor-%dx%d-random", w, h) {
+		igt_subtest_f("non-square-cursor-random") {
 			igt_require(has_nonsquare_cursors(data));
-			run_test(data, test_crc_random, w, h);
+			test_cursor(data, test_crc_random, NONSQUARE);
 		}
-
-		igt_fixture
-			igt_remove_fb(data->drm_fd, &data->fb);
-	}
 }
 
 static data_t data;
Signature · 6 lines
2.7.4

_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
Signature · 6 lines
Ville Syrjälä
Intel
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
#3 lore raw

Re: [igt-dev] [PATCH i-g-t v2] tests/kms_cursor_crc: Limit cursor size based on platform capability.

Quoted 4 lines · Ville Syrjälä
Quoted 2 lines · Karthik B S

Limiting the cursor size of subtests to the maximum size listed as per the platform capability, so that we can avoid skipping of subtests.

Why?

Currently, cursor size is hard coded to have an upper limit of 512 and even though we've the max cursor size supported by the platform,

we still list all the sub-tests up to 512. And upon execution we skip them since the platform doesn't support it.

IMHO, this is redundant and we should be removing this hard coding.

Instead we should make use of the platform capability data, which we fetch from the kernel at run time.

So here the test is split into sub-tests based on structure(square and non square) instead of the actual dimension of the cursor.

And at run time the maximum size supported by the platform is fetched and the max cursor size used is limited based on this.

Quoted 174 lines
Quoted 174 lines

Instead of spliting into subtests based on cursor size, here spliting of subtests is done based on functionality. Maximum size of cursor is restricted at run time based on platform capability.

v2: Keep platform capability fetch inside igt_fixture.

---
  tests/kms_cursor_crc.c | 102 ++++++++++++++++++++++++-------------------------
  1 file changed, 49 insertions(+), 53 deletions(-)
tests/kms_cursor_crc.c +49 -53
index fd74fda..08a6c2a 100644
@@ -44,6 +44,8 @@ IGT_TEST_DESCRIPTION(
  #ifndef DRM_CAP_CURSOR_HEIGHT
  #define DRM_CAP_CURSOR_HEIGHT 0x9
  #endif
+#define SQUARE    1
+#define NONSQUARE 0
 
  typedef struct {
  	int drm_fd;
@@ -470,9 +472,6 @@ static void run_test(data_t *data, void (*testfunc)(data_t *), int cursor_w, int
  	enum pipe p;
  	int valid_tests = 0;
 
-	igt_require(cursor_w <= data->cursor_max_w &&
-		    cursor_h <= data->cursor_max_h);
-
  	for_each_pipe_with_valid_output(display, p, output) {
  		data->output = output;
  		data->pipe = p;
@@ -481,15 +480,15 @@ static void run_test(data_t *data, void (*testfunc)(data_t *), int cursor_w, int
 
  		valid_tests++;
 
-		igt_info("Beginning %s on pipe %s, connector %s\n",
-			  igt_subtest_name(),
+		igt_info("Beginning %s with size %dx%d on pipe %s, connector %s\n",
+			  igt_subtest_name(), cursor_w, cursor_h,
  			  kmstest_pipe_name(data->pipe),
  			  igt_output_name(output));
 
  		testfunc(data);
 
-		igt_info("\n%s on pipe %s, connector %s: PASSED\n\n",
-			  igt_subtest_name(),
+		igt_info("\n%s with size %dx%d on pipe %s, connector %s: PASSED\n\n",
+			  igt_subtest_name(), cursor_w, cursor_h,
  			  kmstest_pipe_name(data->pipe),
  			  igt_output_name(output));
 
@@ -639,75 +638,72 @@ static void test_rapid_movement(data_t *data)
 
  }
 
-static void run_test_generic(data_t *data)
+static void test_cursor(data_t *data, void (*testfunc)(data_t *), bool square)
  {
  	int cursor_size;
-	for (cursor_size = 64; cursor_size <= 512; cursor_size *= 2) {
+	for (cursor_size = 64; cursor_size <= data->cursor_max_w;
+	     cursor_size *= 2) {
  		int w = cursor_size;
  		int h = cursor_size;
 
-		igt_fixture
-			create_cursor_fb(data, w, h);
-
-		/* Using created cursor FBs to test cursor support */
-		igt_subtest_f("cursor-%dx%d-onscreen", w, h)
-			run_test(data, test_crc_onscreen, w, h);
-		igt_subtest_f("cursor-%dx%d-offscreen", w, h)
-			run_test(data, test_crc_offscreen, w, h);
-		igt_subtest_f("cursor-%dx%d-sliding", w, h)
-			run_test(data, test_crc_sliding, w, h);
-		igt_subtest_f("cursor-%dx%d-random", w, h)
-			run_test(data, test_crc_random, w, h);
-		igt_subtest_f("cursor-%dx%d-dpms", w, h) {
+		/*
+		 * Test non-square cursors a bit on the platforms
+		 * that support such things. And make it a bit more
+		 * interesting by using a non-pot height.
+		 */
+		if (!square)
+			h /= 3;
+
+		create_cursor_fb(data, w, h);
+
+		run_test(data, testfunc, w, h);
+
+		igt_remove_fb(data->drm_fd, &data->fb);
+	}
+}
+
+static void run_test_generic(data_t *data)
+{
+		igt_subtest_f("square-cursor-onscreen")
+			test_cursor(data, test_crc_onscreen, SQUARE);
+		igt_subtest_f("square-cursor-offscreen")
+			test_cursor(data, test_crc_offscreen, SQUARE);
+		igt_subtest_f("square-cursor-sliding")
+			test_cursor(data, test_crc_sliding, SQUARE);
+		igt_subtest_f("square-cursor-random")
+			test_cursor(data, test_crc_random, SQUARE);
+		igt_subtest_f("square-cursor-dpms") {
  			data->flags = TEST_DPMS;
-			run_test(data, test_crc_random, w, h);
+			test_cursor(data, test_crc_random, SQUARE);
  			data->flags = 0;
  		}
 
-		igt_subtest_f("cursor-%dx%d-suspend", w, h) {
+		igt_subtest_f("square-cursor-suspend") {
  			data->flags = TEST_SUSPEND;
-			run_test(data, test_crc_random, w, h);
+			test_cursor(data, test_crc_random, SQUARE);
  			data->flags = 0;
  		}
 
-		igt_subtest_f("cursor-%dx%d-rapid-movement", w, h) {
-			run_test(data, test_rapid_movement, w, h);
+		igt_subtest_f("square-cursor-rapid-movement") {
+			test_cursor(data, test_rapid_movement, SQUARE);
  		}
 
-		igt_fixture
-			igt_remove_fb(data->drm_fd, &data->fb);
-
-		/*
-		 * Test non-square cursors a bit on the platforms
-		 * that support such things. And make it a bit more
-		 * interesting by using a non-pot height.
-		 */
-		h /= 3;
-
-		igt_fixture
-			create_cursor_fb(data, w, h);
-
-		/* Using created cursor FBs to test cursor support */
-		igt_subtest_f("cursor-%dx%d-onscreen", w, h) {
+		igt_subtest_f("non-square-cursor-onscreen") {
  			igt_require(has_nonsquare_cursors(data));
-			run_test(data, test_crc_onscreen, w, h);
+			test_cursor(data, test_crc_onscreen, NONSQUARE);
  		}
-		igt_subtest_f("cursor-%dx%d-offscreen", w, h) {
+		igt_subtest_f("non-square-cursor-offscreen") {
  			igt_require(has_nonsquare_cursors(data));
-			run_test(data, test_crc_offscreen, w, h);
+			test_cursor(data, test_crc_offscreen, NONSQUARE);
  		}
-		igt_subtest_f("cursor-%dx%d-sliding", w, h) {
+		igt_subtest_f("non-square-cursor-sliding") {
  			igt_require(has_nonsquare_cursors(data));
-			run_test(data, test_crc_sliding, w, h);
+			test_cursor(data, test_crc_sliding, NONSQUARE);
  		}
-		igt_subtest_f("cursor-%dx%d-random", w, h) {
+		igt_subtest_f("non-square-cursor-random") {
  			igt_require(has_nonsquare_cursors(data));
-			run_test(data, test_crc_random, w, h);
+			test_cursor(data, test_crc_random, NONSQUARE);
  		}
-
-		igt_fixture
-			igt_remove_fb(data->drm_fd, &data->fb);
-	}
  }
 
Quoted 8 lines
Quoted 8 lines
tests/kms_cursor_crc.c +0 -0
  static data_t data;
Signature · 6 lines
2.7.4

_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev

_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev

#4 lore raw

Re: [igt-dev] [PATCH i-g-t v2] tests/kms_cursor_crc: Limit cursor size based on platform capability.

Quoted 13 lines · Karthik
Quoted 4 lines · Ville Syrjälä
Quoted 2 lines · Karthik B S

Limiting the cursor size of subtests to the maximum size listed as per the platform capability, so that we can avoid skipping of subtests.

Why?

Currently, cursor size is hard coded to have an upper limit of 512 and even though we've the max cursor size supported by the platform,

we still list all the sub-tests up to 512. And upon execution we skip them since the platform doesn't support it.

Quoted 7 lines

IMHO, this is redundant and we should be removing this hard coding.

Instead we should make use of the platform capability data, which we fetch from the kernel at run time.

So here the test is split into sub-tests based on structure(square and non square) instead of the actual dimension of the cursor.

That means we can no longer see which sizes work and which don't. So unless there is some real reason why having so many subtests is bad this feels like a net loss.

Quoted 185 lines

And at run time the maximum size supported by the platform is fetched and the max cursor size used is limited based on this.

Quoted 182 lines
Quoted 182 lines

Instead of spliting into subtests based on cursor size, here spliting of subtests is done based on functionality. Maximum size of cursor is restricted at run time based on platform capability.

v2: Keep platform capability fetch inside igt_fixture.

---
  tests/kms_cursor_crc.c | 102 ++++++++++++++++++++++++-------------------------
  1 file changed, 49 insertions(+), 53 deletions(-)
tests/kms_cursor_crc.c +49 -53
index fd74fda..08a6c2a 100644
@@ -44,6 +44,8 @@ IGT_TEST_DESCRIPTION(
  #ifndef DRM_CAP_CURSOR_HEIGHT
  #define DRM_CAP_CURSOR_HEIGHT 0x9
  #endif
+#define SQUARE    1
+#define NONSQUARE 0
 
  typedef struct {
  	int drm_fd;
@@ -470,9 +472,6 @@ static void run_test(data_t *data, void (*testfunc)(data_t *), int cursor_w, int
  	enum pipe p;
  	int valid_tests = 0;
 
-	igt_require(cursor_w <= data->cursor_max_w &&
-		    cursor_h <= data->cursor_max_h);
-
  	for_each_pipe_with_valid_output(display, p, output) {
  		data->output = output;
  		data->pipe = p;
@@ -481,15 +480,15 @@ static void run_test(data_t *data, void (*testfunc)(data_t *), int cursor_w, int
 
  		valid_tests++;
 
-		igt_info("Beginning %s on pipe %s, connector %s\n",
-			  igt_subtest_name(),
+		igt_info("Beginning %s with size %dx%d on pipe %s, connector %s\n",
+			  igt_subtest_name(), cursor_w, cursor_h,
  			  kmstest_pipe_name(data->pipe),
  			  igt_output_name(output));
 
  		testfunc(data);
 
-		igt_info("\n%s on pipe %s, connector %s: PASSED\n\n",
-			  igt_subtest_name(),
+		igt_info("\n%s with size %dx%d on pipe %s, connector %s: PASSED\n\n",
+			  igt_subtest_name(), cursor_w, cursor_h,
  			  kmstest_pipe_name(data->pipe),
  			  igt_output_name(output));
 
@@ -639,75 +638,72 @@ static void test_rapid_movement(data_t *data)
 
  }
 
-static void run_test_generic(data_t *data)
+static void test_cursor(data_t *data, void (*testfunc)(data_t *), bool square)
  {
  	int cursor_size;
-	for (cursor_size = 64; cursor_size <= 512; cursor_size *= 2) {
+	for (cursor_size = 64; cursor_size <= data->cursor_max_w;
+	     cursor_size *= 2) {
  		int w = cursor_size;
  		int h = cursor_size;
 
-		igt_fixture
-			create_cursor_fb(data, w, h);
-
-		/* Using created cursor FBs to test cursor support */
-		igt_subtest_f("cursor-%dx%d-onscreen", w, h)
-			run_test(data, test_crc_onscreen, w, h);
-		igt_subtest_f("cursor-%dx%d-offscreen", w, h)
-			run_test(data, test_crc_offscreen, w, h);
-		igt_subtest_f("cursor-%dx%d-sliding", w, h)
-			run_test(data, test_crc_sliding, w, h);
-		igt_subtest_f("cursor-%dx%d-random", w, h)
-			run_test(data, test_crc_random, w, h);
-		igt_subtest_f("cursor-%dx%d-dpms", w, h) {
+		/*
+		 * Test non-square cursors a bit on the platforms
+		 * that support such things. And make it a bit more
+		 * interesting by using a non-pot height.
+		 */
+		if (!square)
+			h /= 3;
+
+		create_cursor_fb(data, w, h);
+
+		run_test(data, testfunc, w, h);
+
+		igt_remove_fb(data->drm_fd, &data->fb);
+	}
+}
+
+static void run_test_generic(data_t *data)
+{
+		igt_subtest_f("square-cursor-onscreen")
+			test_cursor(data, test_crc_onscreen, SQUARE);
+		igt_subtest_f("square-cursor-offscreen")
+			test_cursor(data, test_crc_offscreen, SQUARE);
+		igt_subtest_f("square-cursor-sliding")
+			test_cursor(data, test_crc_sliding, SQUARE);
+		igt_subtest_f("square-cursor-random")
+			test_cursor(data, test_crc_random, SQUARE);
+		igt_subtest_f("square-cursor-dpms") {
  			data->flags = TEST_DPMS;
-			run_test(data, test_crc_random, w, h);
+			test_cursor(data, test_crc_random, SQUARE);
  			data->flags = 0;
  		}
 
-		igt_subtest_f("cursor-%dx%d-suspend", w, h) {
+		igt_subtest_f("square-cursor-suspend") {
  			data->flags = TEST_SUSPEND;
-			run_test(data, test_crc_random, w, h);
+			test_cursor(data, test_crc_random, SQUARE);
  			data->flags = 0;
  		}
 
-		igt_subtest_f("cursor-%dx%d-rapid-movement", w, h) {
-			run_test(data, test_rapid_movement, w, h);
+		igt_subtest_f("square-cursor-rapid-movement") {
+			test_cursor(data, test_rapid_movement, SQUARE);
  		}
 
-		igt_fixture
-			igt_remove_fb(data->drm_fd, &data->fb);
-
-		/*
-		 * Test non-square cursors a bit on the platforms
-		 * that support such things. And make it a bit more
-		 * interesting by using a non-pot height.
-		 */
-		h /= 3;
-
-		igt_fixture
-			create_cursor_fb(data, w, h);
-
-		/* Using created cursor FBs to test cursor support */
-		igt_subtest_f("cursor-%dx%d-onscreen", w, h) {
+		igt_subtest_f("non-square-cursor-onscreen") {
  			igt_require(has_nonsquare_cursors(data));
-			run_test(data, test_crc_onscreen, w, h);
+			test_cursor(data, test_crc_onscreen, NONSQUARE);
  		}
-		igt_subtest_f("cursor-%dx%d-offscreen", w, h) {
+		igt_subtest_f("non-square-cursor-offscreen") {
  			igt_require(has_nonsquare_cursors(data));
-			run_test(data, test_crc_offscreen, w, h);
+			test_cursor(data, test_crc_offscreen, NONSQUARE);
  		}
-		igt_subtest_f("cursor-%dx%d-sliding", w, h) {
+		igt_subtest_f("non-square-cursor-sliding") {
  			igt_require(has_nonsquare_cursors(data));
-			run_test(data, test_crc_sliding, w, h);
+			test_cursor(data, test_crc_sliding, NONSQUARE);
  		}
-		igt_subtest_f("cursor-%dx%d-random", w, h) {
+		igt_subtest_f("non-square-cursor-random") {
  			igt_require(has_nonsquare_cursors(data));
-			run_test(data, test_crc_random, w, h);
+			test_cursor(data, test_crc_random, NONSQUARE);
  		}
-
-		igt_fixture
-			igt_remove_fb(data->drm_fd, &data->fb);
-	}
  }
 
  static data_t data;
Signature · 6 lines
2.7.4

_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
Signature · 6 lines
Ville Syrjälä
Intel
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
#5 lore raw

Re: [igt-dev] [PATCH i-g-t v2] tests/kms_cursor_crc: Limit cursor size based on platform capability.

Quoted 14 lines · Ville Syrjälä
Quoted 13 lines · Karthik
Quoted 4 lines · Ville Syrjälä
Quoted 2 lines · Karthik B S

Limiting the cursor size of subtests to the maximum size listed as per the platform capability, so that we can avoid skipping of subtests.

Why?

Currently, cursor size is hard coded to have an upper limit of 512 and even though we've the max cursor size supported by the platform,

we still list all the sub-tests up to 512. And upon execution we skip them since the platform doesn't support it.

IMHO, this is redundant and we should be removing this hard coding.

Quoted 8 lines
Quoted 5 lines

Instead we should make use of the platform capability data, which we fetch from the kernel at run time.

So here the test is split into sub-tests based on structure(square and non square) instead of the actual dimension of the cursor.

That means we can no longer see which sizes work and which don't. So unless there is some real reason why having so many subtests is bad this feels like a net loss.

That is a very valid point. Thanks for the feedback.

I'll try to figure out if there's anyway by which the hard coding can be removed,

keeping this functionality still intact.

Quoted 176 lines
Quoted 176 lines

And at run time the maximum size supported by the platform is fetched and the max cursor size used is limited based on this.

Quoted 173 lines
Quoted 173 lines

Instead of spliting into subtests based on cursor size, here spliting of subtests is done based on functionality. Maximum size of cursor is restricted at run time based on platform capability.

v2: Keep platform capability fetch inside igt_fixture.

---
   tests/kms_cursor_crc.c | 102 ++++++++++++++++++++++++-------------------------
   1 file changed, 49 insertions(+), 53 deletions(-)
tests/kms_cursor_crc.c +49 -53
index fd74fda..08a6c2a 100644
@@ -44,6 +44,8 @@ IGT_TEST_DESCRIPTION(
   #ifndef DRM_CAP_CURSOR_HEIGHT
   #define DRM_CAP_CURSOR_HEIGHT 0x9
   #endif
+#define SQUARE    1
+#define NONSQUARE 0
 
   typedef struct {
   	int drm_fd;
@@ -470,9 +472,6 @@ static void run_test(data_t *data, void (*testfunc)(data_t *), int cursor_w, int
   	enum pipe p;
   	int valid_tests = 0;
 
-	igt_require(cursor_w <= data->cursor_max_w &&
-		    cursor_h <= data->cursor_max_h);
-
   	for_each_pipe_with_valid_output(display, p, output) {
   		data->output = output;
   		data->pipe = p;
@@ -481,15 +480,15 @@ static void run_test(data_t *data, void (*testfunc)(data_t *), int cursor_w, int
 
   		valid_tests++;
 
-		igt_info("Beginning %s on pipe %s, connector %s\n",
-			  igt_subtest_name(),
+		igt_info("Beginning %s with size %dx%d on pipe %s, connector %s\n",
+			  igt_subtest_name(), cursor_w, cursor_h,
   			  kmstest_pipe_name(data->pipe),
   			  igt_output_name(output));
 
   		testfunc(data);
 
-		igt_info("\n%s on pipe %s, connector %s: PASSED\n\n",
-			  igt_subtest_name(),
+		igt_info("\n%s with size %dx%d on pipe %s, connector %s: PASSED\n\n",
+			  igt_subtest_name(), cursor_w, cursor_h,
   			  kmstest_pipe_name(data->pipe),
   			  igt_output_name(output));
 
@@ -639,75 +638,72 @@ static void test_rapid_movement(data_t *data)
 
   }
 
-static void run_test_generic(data_t *data)
+static void test_cursor(data_t *data, void (*testfunc)(data_t *), bool square)
   {
   	int cursor_size;
-	for (cursor_size = 64; cursor_size <= 512; cursor_size *= 2) {
+	for (cursor_size = 64; cursor_size <= data->cursor_max_w;
+	     cursor_size *= 2) {
   		int w = cursor_size;
   		int h = cursor_size;
 
-		igt_fixture
-			create_cursor_fb(data, w, h);
-
-		/* Using created cursor FBs to test cursor support */
-		igt_subtest_f("cursor-%dx%d-onscreen", w, h)
-			run_test(data, test_crc_onscreen, w, h);
-		igt_subtest_f("cursor-%dx%d-offscreen", w, h)
-			run_test(data, test_crc_offscreen, w, h);
-		igt_subtest_f("cursor-%dx%d-sliding", w, h)
-			run_test(data, test_crc_sliding, w, h);
-		igt_subtest_f("cursor-%dx%d-random", w, h)
-			run_test(data, test_crc_random, w, h);
-		igt_subtest_f("cursor-%dx%d-dpms", w, h) {
+		/*
+		 * Test non-square cursors a bit on the platforms
+		 * that support such things. And make it a bit more
+		 * interesting by using a non-pot height.
+		 */
+		if (!square)
+			h /= 3;
+
+		create_cursor_fb(data, w, h);
+
+		run_test(data, testfunc, w, h);
+
+		igt_remove_fb(data->drm_fd, &data->fb);
+	}
+}
+
+static void run_test_generic(data_t *data)
+{
+		igt_subtest_f("square-cursor-onscreen")
+			test_cursor(data, test_crc_onscreen, SQUARE);
+		igt_subtest_f("square-cursor-offscreen")
+			test_cursor(data, test_crc_offscreen, SQUARE);
+		igt_subtest_f("square-cursor-sliding")
+			test_cursor(data, test_crc_sliding, SQUARE);
+		igt_subtest_f("square-cursor-random")
+			test_cursor(data, test_crc_random, SQUARE);
+		igt_subtest_f("square-cursor-dpms") {
   			data->flags = TEST_DPMS;
-			run_test(data, test_crc_random, w, h);
+			test_cursor(data, test_crc_random, SQUARE);
   			data->flags = 0;
   		}
 
-		igt_subtest_f("cursor-%dx%d-suspend", w, h) {
+		igt_subtest_f("square-cursor-suspend") {
   			data->flags = TEST_SUSPEND;
-			run_test(data, test_crc_random, w, h);
+			test_cursor(data, test_crc_random, SQUARE);
   			data->flags = 0;
   		}
 
-		igt_subtest_f("cursor-%dx%d-rapid-movement", w, h) {
-			run_test(data, test_rapid_movement, w, h);
+		igt_subtest_f("square-cursor-rapid-movement") {
+			test_cursor(data, test_rapid_movement, SQUARE);
   		}
 
-		igt_fixture
-			igt_remove_fb(data->drm_fd, &data->fb);
-
-		/*
-		 * Test non-square cursors a bit on the platforms
-		 * that support such things. And make it a bit more
-		 * interesting by using a non-pot height.
-		 */
-		h /= 3;
-
-		igt_fixture
-			create_cursor_fb(data, w, h);
-
-		/* Using created cursor FBs to test cursor support */
-		igt_subtest_f("cursor-%dx%d-onscreen", w, h) {
+		igt_subtest_f("non-square-cursor-onscreen") {
   			igt_require(has_nonsquare_cursors(data));
-			run_test(data, test_crc_onscreen, w, h);
+			test_cursor(data, test_crc_onscreen, NONSQUARE);
   		}
-		igt_subtest_f("cursor-%dx%d-offscreen", w, h) {
+		igt_subtest_f("non-square-cursor-offscreen") {
   			igt_require(has_nonsquare_cursors(data));
-			run_test(data, test_crc_offscreen, w, h);
+			test_cursor(data, test_crc_offscreen, NONSQUARE);
   		}
-		igt_subtest_f("cursor-%dx%d-sliding", w, h) {
+		igt_subtest_f("non-square-cursor-sliding") {
   			igt_require(has_nonsquare_cursors(data));
-			run_test(data, test_crc_sliding, w, h);
+			test_cursor(data, test_crc_sliding, NONSQUARE);
   		}
-		igt_subtest_f("cursor-%dx%d-random", w, h) {
+		igt_subtest_f("non-square-cursor-random") {
   			igt_require(has_nonsquare_cursors(data));
-			run_test(data, test_crc_random, w, h);
+			test_cursor(data, test_crc_random, NONSQUARE);
   		}
-
-		igt_fixture
-			igt_remove_fb(data->drm_fd, &data->fb);
-	}
   }
 
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
tests/kms_cursor_crc.c +0 -0
   static data_t data;
Signature · 6 lines
2.7.4

_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev

_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev

#6 lore raw

[igt-dev] ✗ Fi.CI.BAT: failure for tests/kms_cursor_crc: Limit cursor size based on platform capability.

In reply to Karthik B S
== Series Details ==

== Series Details ==

Series: tests/kms_cursor_crc: Limit cursor size based on platform capability.
URL : https://patchwork.freedesktop.org/series/60304/
State : failure

== Summary ==

CI Bug Log - changes from CI_DRM_6046 -> IGTPW_2942
====================================================

Summary
-------

**FAILURE**

Serious unknown changes coming with IGTPW_2942 absolutely need to be verified manually.

If you think the reported changes have nothing to do with the changes introduced in IGTPW_2942, please notify your bug team to allow them to document this new failure mode, which will reduce false positives in CI.

External URL: https://patchwork.freedesktop.org/api/1.0/series/60304/revisions/1/mbox/

Possible new issues
-------------------

Here are the unknown changes that may have been introduced in IGTPW_2942:

### IGT changes ###

#### Possible regressions ####

* igt@i915_selftest@live_hangcheck:
- fi-apl-guc: NOTRUN -> [DMESG-FAIL][1]
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2942/fi-apl-guc/igt@i915_selftest@live_hangcheck.html

* igt@runner@aborted:
- fi-apl-guc: NOTRUN -> [FAIL][2]
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2942/fi-apl-guc/igt@[email protected]

Known issues
------------

Here are the changes found in IGTPW_2942 that come from known issues:

### IGT changes ###

#### Issues hit ####

* igt@gem_busy@basic-busy-default:
- fi-icl-u3: [PASS][3] -> [INCOMPLETE][4] ([fdo#107713] / [fdo#110581])
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6046/fi-icl-u3/igt@[email protected]
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2942/fi-icl-u3/igt@[email protected]

* igt@gem_exec_fence@basic-busy-default:
- fi-icl-y: [PASS][5] -> [INCOMPLETE][6] ([fdo#107713] / [fdo#110581])
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6046/fi-icl-y/igt@[email protected]
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2942/fi-icl-y/igt@[email protected]

* igt@i915_selftest@live_contexts:
- fi-bdw-gvtdvm: [PASS][7] -> [DMESG-FAIL][8] ([fdo#110235])
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6046/fi-bdw-gvtdvm/igt@i915_selftest@live_contexts.html
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2942/fi-bdw-gvtdvm/igt@i915_selftest@live_contexts.html

{name}: This element is suppressed. This means it is ignored when computing
the status of the difference (SUCCESS, WARNING, or FAILURE).

[fdo#107713]: https://bugs.freedesktop.org/show_bug.cgi?id=107713
[fdo#110235]: https://bugs.freedesktop.org/show_bug.cgi?id=110235
[fdo#110581]: https://bugs.freedesktop.org/show_bug.cgi?id=110581

Participating hosts (49 -> 43)
------------------------------

Additional (2): fi-hsw-peppy fi-apl-guc
Missing (8): fi-kbl-soraka fi-ilk-m540 fi-hsw-4200u fi-byt-squawks fi-bsw-cyan fi-gdg-551 fi-byt-clapper fi-bdw-samus

Build changes
-------------

* IGT: IGT_4972 -> IGTPW_2942

CI_DRM_6046: 0cc5ef288aac64e48e65691bc550f03b5b89db28 @ git://anongit.freedesktop.org/gfx-ci/linux
IGTPW_2942: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2942/
IGT_4972: f052e49a43cc9704ea5f240df15dd9d3dfed68ab @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools

== Testlist changes ==

+igt@kms_cursor_crc@non-square-cursor-offscreen
+igt@kms_cursor_crc@non-square-cursor-onscreen
+igt@kms_cursor_crc@non-square-cursor-random
+igt@kms_cursor_crc@non-square-cursor-sliding
+igt@kms_cursor_crc@square-cursor-dpms
+igt@kms_cursor_crc@square-cursor-offscreen
+igt@kms_cursor_crc@square-cursor-onscreen
+igt@kms_cursor_crc@square-cursor-random
+igt@kms_cursor_crc@square-cursor-rapid-movement
+igt@kms_cursor_crc@square-cursor-sliding
+igt@kms_cursor_crc@square-cursor-suspend
-igt@kms_cursor_crc@cursor-64x21-offscreen
-igt@kms_cursor_crc@cursor-64x21-onscreen
-igt@kms_cursor_crc@cursor-64x21-random
-igt@kms_cursor_crc@cursor-64x21-sliding
-igt@kms_cursor_crc@cursor-64x64-dpms
-igt@kms_cursor_crc@cursor-64x64-offscreen
-igt@kms_cursor_crc@cursor-64x64-onscreen
-igt@kms_cursor_crc@cursor-64x64-random
-igt@kms_cursor_crc@cursor-64x64-rapid-movement
-igt@kms_cursor_crc@cursor-64x64-sliding
-igt@kms_cursor_crc@cursor-64x64-suspend
-igt@kms_cursor_crc@cursor-128x42-offscreen
-igt@kms_cursor_crc@cursor-128x42-onscreen
-igt@kms_cursor_crc@cursor-128x42-random
-igt@kms_cursor_crc@cursor-128x42-sliding
-igt@kms_cursor_crc@cursor-128x128-dpms
-igt@kms_cursor_crc@cursor-128x128-offscreen
-igt@kms_cursor_crc@cursor-128x128-onscreen
-igt@kms_cursor_crc@cursor-128x128-random
-igt@kms_cursor_crc@cursor-128x128-rapid-movement
-igt@kms_cursor_crc@cursor-128x128-sliding
-igt@kms_cursor_crc@cursor-128x128-suspend
-igt@kms_cursor_crc@cursor-256x85-offscreen
-igt@kms_cursor_crc@cursor-256x85-onscreen
-igt@kms_cursor_crc@cursor-256x85-random
-igt@kms_cursor_crc@cursor-256x85-sliding
-igt@kms_cursor_crc@cursor-256x256-dpms
-igt@kms_cursor_crc@cursor-256x256-offscreen
-igt@kms_cursor_crc@cursor-256x256-onscreen
-igt@kms_cursor_crc@cursor-256x256-random
-igt@kms_cursor_crc@cursor-256x256-rapid-movement
-igt@kms_cursor_crc@cursor-256x256-sliding
-igt@kms_cursor_crc@cursor-256x256-suspend
-igt@kms_cursor_crc@cursor-512x170-offscreen
-igt@kms_cursor_crc@cursor-512x170-onscreen
-igt@kms_cursor_crc@cursor-512x170-random
-igt@kms_cursor_crc@cursor-512x170-sliding
-igt@kms_cursor_crc@cursor-512x512-dpms
-igt@kms_cursor_crc@cursor-512x512-offscreen
-igt@kms_cursor_crc@cursor-512x512-onscreen
-igt@kms_cursor_crc@cursor-512x512-random
-igt@kms_cursor_crc@cursor-512x512-rapid-movement
-igt@kms_cursor_crc@cursor-512x512-sliding
-igt@kms_cursor_crc@cursor-512x512-suspend

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2942/
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev