All of lore.kernel.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH i-g-t v2] tests/kms_cursor_crc: Limit cursor size based
@ 2019-05-06  5:10 Karthik B S
  2019-05-06  5:10 ` [igt-dev] [PATCH i-g-t v2] tests/kms_cursor_crc: Limit cursor size based on platform capability Karthik B S
  2019-05-06  6:01 ` [igt-dev] ✗ Fi.CI.BAT: failure for " Patchwork
  0 siblings, 2 replies; 7+ messages in thread
From: Karthik B S @ 2019-05-06  5:10 UTC (permalink / raw)
  To: igt-dev; +Cc: petri.latvala

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(-)

-- 
2.7.4

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [igt-dev] [PATCH i-g-t v2] tests/kms_cursor_crc: Limit cursor size based on platform capability.
  2019-05-06  5:10 [igt-dev] [PATCH i-g-t v2] tests/kms_cursor_crc: Limit cursor size based Karthik B S
@ 2019-05-06  5:10 ` Karthik B S
  2019-05-06 12:16   ` Ville Syrjälä
  2019-05-06  6:01 ` [igt-dev] ✗ Fi.CI.BAT: failure for " Patchwork
  1 sibling, 1 reply; 7+ messages in thread
From: Karthik B S @ 2019-05-06  5:10 UTC (permalink / raw)
  To: igt-dev; +Cc: petri.latvala

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.

Signed-off-by: Karthik B S <karthik.b.s@intel.com>
---
 tests/kms_cursor_crc.c | 102 ++++++++++++++++++++++++-------------------------
 1 file changed, 49 insertions(+), 53 deletions(-)

diff --git a/tests/kms_cursor_crc.c b/tests/kms_cursor_crc.c
index fd74fda..08a6c2a 100644
--- a/tests/kms_cursor_crc.c
+++ b/tests/kms_cursor_crc.c
@@ -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;
-- 
2.7.4

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [igt-dev] ✗ Fi.CI.BAT: failure for tests/kms_cursor_crc: Limit cursor size based on platform capability.
  2019-05-06  5:10 [igt-dev] [PATCH i-g-t v2] tests/kms_cursor_crc: Limit cursor size based Karthik B S
  2019-05-06  5:10 ` [igt-dev] [PATCH i-g-t v2] tests/kms_cursor_crc: Limit cursor size based on platform capability Karthik B S
@ 2019-05-06  6:01 ` Patchwork
  1 sibling, 0 replies; 7+ messages in thread
From: Patchwork @ 2019-05-06  6:01 UTC (permalink / raw)
  To: Karthik B S; +Cc: igt-dev

== 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@runner@aborted.html

  
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@gem_busy@basic-busy-default.html
   [4]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2942/fi-icl-u3/igt@gem_busy@basic-busy-default.html

  * 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@gem_exec_fence@basic-busy-default.html
   [6]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2942/fi-icl-y/igt@gem_exec_fence@basic-busy-default.html

  * 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
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [igt-dev] [PATCH i-g-t v2] tests/kms_cursor_crc: Limit cursor size based on platform capability.
  2019-05-06  5:10 ` [igt-dev] [PATCH i-g-t v2] tests/kms_cursor_crc: Limit cursor size based on platform capability Karthik B S
@ 2019-05-06 12:16   ` Ville Syrjälä
  2019-05-07  5:18     ` B S, Karthik
  0 siblings, 1 reply; 7+ messages in thread
From: Ville Syrjälä @ 2019-05-06 12:16 UTC (permalink / raw)
  To: Karthik B S; +Cc: igt-dev, petri.latvala

On Mon, May 06, 2019 at 10:40:08AM +0530, Karthik B S wrote:
> 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?

> 
> 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.
> 
> Signed-off-by: Karthik B S <karthik.b.s@intel.com>
> ---
>  tests/kms_cursor_crc.c | 102 ++++++++++++++++++++++++-------------------------
>  1 file changed, 49 insertions(+), 53 deletions(-)
> 
> diff --git a/tests/kms_cursor_crc.c b/tests/kms_cursor_crc.c
> index fd74fda..08a6c2a 100644
> --- a/tests/kms_cursor_crc.c
> +++ b/tests/kms_cursor_crc.c
> @@ -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;
> -- 
> 2.7.4
> 
> _______________________________________________
> igt-dev mailing list
> igt-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/igt-dev

-- 
Ville Syrjälä
Intel
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [igt-dev] [PATCH i-g-t v2] tests/kms_cursor_crc: Limit cursor size based on platform capability.
  2019-05-06 12:16   ` Ville Syrjälä
@ 2019-05-07  5:18     ` B S, Karthik
  2019-05-07 10:32       ` Ville Syrjälä
  0 siblings, 1 reply; 7+ messages in thread
From: B S, Karthik @ 2019-05-07  5:18 UTC (permalink / raw)
  To: Ville Syrjälä; +Cc: igt-dev, petri.latvala


On 5/6/2019 5:46 PM, Ville Syrjälä wrote:
> On Mon, May 06, 2019 at 10:40:08AM +0530, Karthik B S wrote:
>> 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.
>
>> 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.
>>
>> Signed-off-by: Karthik B S <karthik.b.s@intel.com>
>> ---
>>   tests/kms_cursor_crc.c | 102 ++++++++++++++++++++++++-------------------------
>>   1 file changed, 49 insertions(+), 53 deletions(-)
>>
>> diff --git a/tests/kms_cursor_crc.c b/tests/kms_cursor_crc.c
>> index fd74fda..08a6c2a 100644
>> --- a/tests/kms_cursor_crc.c
>> +++ b/tests/kms_cursor_crc.c
>> @@ -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;
>> -- 
>> 2.7.4
>>
>> _______________________________________________
>> igt-dev mailing list
>> igt-dev@lists.freedesktop.org
>> https://lists.freedesktop.org/mailman/listinfo/igt-dev
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [igt-dev] [PATCH i-g-t v2] tests/kms_cursor_crc: Limit cursor size based on platform capability.
  2019-05-07  5:18     ` B S, Karthik
@ 2019-05-07 10:32       ` Ville Syrjälä
  2019-05-10  4:28         ` B S, Karthik
  0 siblings, 1 reply; 7+ messages in thread
From: Ville Syrjälä @ 2019-05-07 10:32 UTC (permalink / raw)
  To: B S, Karthik; +Cc: igt-dev, petri.latvala

On Tue, May 07, 2019 at 10:48:15AM +0530, B S, Karthik wrote:
> 
> On 5/6/2019 5:46 PM, Ville Syrjälä wrote:
> > On Mon, May 06, 2019 at 10:40:08AM +0530, Karthik B S wrote:
> >> 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.

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.

> 
> And at run time the maximum size supported by the platform is fetched 
> and the max cursor size used is limited based on this.
> >
> >> 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.
> >>
> >> Signed-off-by: Karthik B S <karthik.b.s@intel.com>
> >> ---
> >>   tests/kms_cursor_crc.c | 102 ++++++++++++++++++++++++-------------------------
> >>   1 file changed, 49 insertions(+), 53 deletions(-)
> >>
> >> diff --git a/tests/kms_cursor_crc.c b/tests/kms_cursor_crc.c
> >> index fd74fda..08a6c2a 100644
> >> --- a/tests/kms_cursor_crc.c
> >> +++ b/tests/kms_cursor_crc.c
> >> @@ -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;
> >> -- 
> >> 2.7.4
> >>
> >> _______________________________________________
> >> igt-dev mailing list
> >> igt-dev@lists.freedesktop.org
> >> https://lists.freedesktop.org/mailman/listinfo/igt-dev

-- 
Ville Syrjälä
Intel
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [igt-dev] [PATCH i-g-t v2] tests/kms_cursor_crc: Limit cursor size based on platform capability.
  2019-05-07 10:32       ` Ville Syrjälä
@ 2019-05-10  4:28         ` B S, Karthik
  0 siblings, 0 replies; 7+ messages in thread
From: B S, Karthik @ 2019-05-10  4:28 UTC (permalink / raw)
  To: Ville Syrjälä; +Cc: igt-dev, petri.latvala


On 5/7/2019 4:02 PM, Ville Syrjälä wrote:
> On Tue, May 07, 2019 at 10:48:15AM +0530, B S, Karthik wrote:
>> On 5/6/2019 5:46 PM, Ville Syrjälä wrote:
>>> On Mon, May 06, 2019 at 10:40:08AM +0530, Karthik B S wrote:
>>>> 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.
> 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.

>
>> And at run time the maximum size supported by the platform is fetched
>> and the max cursor size used is limited based on this.
>>>> 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.
>>>>
>>>> Signed-off-by: Karthik B S <karthik.b.s@intel.com>
>>>> ---
>>>>    tests/kms_cursor_crc.c | 102 ++++++++++++++++++++++++-------------------------
>>>>    1 file changed, 49 insertions(+), 53 deletions(-)
>>>>
>>>> diff --git a/tests/kms_cursor_crc.c b/tests/kms_cursor_crc.c
>>>> index fd74fda..08a6c2a 100644
>>>> --- a/tests/kms_cursor_crc.c
>>>> +++ b/tests/kms_cursor_crc.c
>>>> @@ -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;
>>>> -- 
>>>> 2.7.4
>>>>
>>>> _______________________________________________
>>>> igt-dev mailing list
>>>> igt-dev@lists.freedesktop.org
>>>> https://lists.freedesktop.org/mailman/listinfo/igt-dev
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2019-05-10  4:29 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-06  5:10 [igt-dev] [PATCH i-g-t v2] tests/kms_cursor_crc: Limit cursor size based Karthik B S
2019-05-06  5:10 ` [igt-dev] [PATCH i-g-t v2] tests/kms_cursor_crc: Limit cursor size based on platform capability Karthik B S
2019-05-06 12:16   ` Ville Syrjälä
2019-05-07  5:18     ` B S, Karthik
2019-05-07 10:32       ` Ville Syrjälä
2019-05-10  4:28         ` B S, Karthik
2019-05-06  6:01 ` [igt-dev] ✗ Fi.CI.BAT: failure for " Patchwork

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.