Skip to contentSkip to conversation

tests: Increase value of I915_MAX_PIPES to 6

PATCH In review [email protected] 4 participants 4 messages Jun 8, 2017 – Jun 9, 2017 2 messages not in the archive Library code

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tests: Increase value of I915_MAX_PIPES to 6

From: "Leo (Sunpeng) Li" <[email protected]>

Increasing max pipe count to 6 to support AMD GPU's.

Since some tests' behavior depends on this value, small changes are made to remove this dependency:

* kms_ccs: Early abort if wanted_pipe is out-of-bounds.
* kms_concurrent: Check if pipe is within bounds first.
* kms_pipe_color: Prevent skipping of subsequent tests by placing generated tests in a 'igt_subtest_group'.
* kms_plane: Move pipe and plane index checking to subtest group level.

---
 lib/igt_kms.c          | 10 ++++++++--
 lib/igt_kms.h          |  3 +++
 tests/kms_ccs.c        |  2 ++
 tests/kms_concurrent.c |  2 +-
 tests/kms_pipe_color.c |  3 ++-
 tests/kms_plane.c      |  8 +++++---
 6 files changed, 21 insertions(+), 7 deletions(-)
lib/igt_kms.c +8 -2
index c77716b..1bb62f0 100644
@@ -319,12 +319,12 @@ const unsigned char* igt_kms_get_alt_edid(void)
  */
 const char *kmstest_pipe_name(enum pipe pipe)
 {
-	const char *str[] = { "A", "B", "C" };
+	const char *str[] = { "A", "B", "C", "D", "E", "F"};
 
 	if (pipe == PIPE_NONE)
 		return "None";
 
-	if (pipe > 2)
+	if (pipe > 5)
 		return "invalid";
 
 	return str[pipe];
@@ -344,6 +344,12 @@ int kmstest_pipe_to_index(char pipe)
 		return 1;
 	else if (pipe == 'C')
 		return 2;
+	else if (pipe == 'D')
+		return 3;
+	else if (pipe == 'E')
+		return 4;
+	else if (pipe == 'F')
+		return 5;
 	else
 		return -EINVAL;
 }
lib/igt_kms.h +3 -0
index 9567a26..8f7c2bb 100644
@@ -54,6 +54,9 @@ enum pipe {
         PIPE_A = 0,
         PIPE_B,
         PIPE_C,
+	PIPE_D,
+	PIPE_E,
+	PIPE_F,
         I915_MAX_PIPES
 };
 const char *kmstest_pipe_name(enum pipe pipe);
tests/kms_ccs.c +2 -0
index d829152..0795e3a 100644
@@ -250,6 +250,8 @@ static void test(data_t *data)
 	int valid_tests = 0;
 	enum pipe wanted_pipe = data->pipe;
 
+	igt_skip_on(wanted_pipe >= display->n_pipes);
+
 	for_each_pipe_with_valid_output(display, data->pipe, data->output) {
 		if (wanted_pipe != PIPE_NONE && data->pipe != wanted_pipe)
 			continue;
tests/kms_concurrent.c +1 -1
index b34540b..db06a37 100644
@@ -351,8 +351,8 @@ run_tests_for_pipe(data_t *data, enum pipe pipe)
 	igt_fixture {
 		int valid_tests = 0;
 
-		igt_require(data->display.pipes[pipe].n_planes > 0);
 		igt_skip_on(pipe >= data->display.n_pipes);
+		igt_require(data->display.pipes[pipe].n_planes > 0);
 
 		for_each_valid_output_on_pipe(&data->display, pipe, output)
 			valid_tests++;
tests/kms_pipe_color.c +2 -1
index fd58ac8..da49eb1 100644
@@ -1180,7 +1180,8 @@ igt_main
 	}
 
 	for (int pipe = 0; pipe < I915_MAX_PIPES; pipe++)
-		run_tests_for_pipe(&data, pipe);
+		igt_subtest_group
+			run_tests_for_pipe(&data, pipe);
 
 	igt_subtest_f("invalid-lut-sizes")
 		invalid_lut_sizes(&data);
tests/kms_plane.c +5 -3
index e1bd467..34418ca 100644
@@ -354,9 +354,6 @@ test_plane_panning(data_t *data, enum pipe pipe, int plane,
 	igt_output_t *output;
 	int connected_outs = 0;
 
-	igt_skip_on(pipe >= data->display.n_pipes);
-	igt_skip_on(plane >= data->display.pipes[pipe].n_planes);
-
 	for_each_valid_output_on_pipe(&data->display, pipe, output) {
 		test_plane_panning_with_output(data, pipe, plane, output,
 						flags);
@@ -369,6 +366,11 @@ test_plane_panning(data_t *data, enum pipe pipe, int plane,
 static void
 run_tests_for_pipe_plane(data_t *data, enum pipe pipe)
 {
+	igt_fixture {
+		igt_skip_on(pipe >= data->display.n_pipes);
+		igt_require(data->display.pipes[pipe].n_planes > 0);
+	}
+
 	igt_subtest_f("plane-position-covered-pipe-%s-planes",
 		      kmstest_pipe_name(pipe)) {
 		int n_planes = data->display.pipes[pipe].n_planes;
Signature · 6 lines
2.7.4

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

A message that is not in the archive (sent off-list or not yet received): 1496949033-8843-1-git-send-email-sunpeng.li-5C7GfCeVMHo@public.gmane.org

Acked-by Alex Deucher
#2 lore raw
Quoted 38 lines

-----Original Message-----
From: amd-gfx [mailto:[email protected]] On Behalf Of [email protected]
Sent: Thursday, June 08, 2017 3:11 PM
To: [email protected]; [email protected]; Wentland, Harry
Cc: Li, Sun peng
Subject: [PATCH i-g-t] tests: Increase value of I915_MAX_PIPES to 6

From: "Leo (Sunpeng) Li" <[email protected]>

Increasing max pipe count to 6 to support AMD GPU's.

Since some tests' behavior depends on this value, small changes are made to remove this dependency:

* kms_ccs: Early abort if wanted_pipe is out-of-bounds.
* kms_concurrent: Check if pipe is within bounds first.
* kms_pipe_color: Prevent skipping of subsequent tests by placing generated tests in a 'igt_subtest_group'.
* kms_plane: Move pipe and plane index checking to subtest group level.

---
 lib/igt_kms.c          | 10 ++++++++--
 lib/igt_kms.h          |  3 +++
 tests/kms_ccs.c        |  2 ++
 tests/kms_concurrent.c |  2 +-
 tests/kms_pipe_color.c |  3 ++-
 tests/kms_plane.c      |  8 +++++---
 6 files changed, 21 insertions(+), 7 deletions(-)
lib/igt_kms.c +0 -0
index c77716b..1bb62f0 100644
@@ -319,12 +319,12 @@ const unsigned char* igt_kms_get_alt_edid(void)
  */

lib/igt_kms.c const unsigned char* igt_kms_get_alt_edid(void) · line 327

Quoted 10 lines
lib/igt_kms.c +2 -2
 const char *kmstest_pipe_name(enum pipe pipe)
 {
-	const char *str[] = { "A", "B", "C" };
+	const char *str[] = { "A", "B", "C", "D", "E", "F"};
 
 	if (pipe == PIPE_NONE)
 		return "None";
 
-	if (pipe > 2)
+	if (pipe > 5)

Use I915_MAX_PIPES here rather than hardcoding 5. With that fixed the patch is:

Quoted 105 lines
lib/igt_kms.c +6 -0
 		return "invalid";
 
 	return str[pipe];
@@ -344,6 +344,12 @@ int kmstest_pipe_to_index(char pipe)
 		return 1;
 	else if (pipe == 'C')
 		return 2;
+	else if (pipe == 'D')
+		return 3;
+	else if (pipe == 'E')
+		return 4;
+	else if (pipe == 'F')
+		return 5;
 	else
 		return -EINVAL;
 }
lib/igt_kms.h +3 -0
index 9567a26..8f7c2bb 100644
@@ -54,6 +54,9 @@ enum pipe {
         PIPE_A = 0,
         PIPE_B,
         PIPE_C,
+	PIPE_D,
+	PIPE_E,
+	PIPE_F,
         I915_MAX_PIPES
 };
 const char *kmstest_pipe_name(enum pipe pipe);
tests/kms_ccs.c +2 -0
index d829152..0795e3a 100644
@@ -250,6 +250,8 @@ static void test(data_t *data)
 	int valid_tests = 0;
 	enum pipe wanted_pipe = data->pipe;
 
+	igt_skip_on(wanted_pipe >= display->n_pipes);
+
 	for_each_pipe_with_valid_output(display, data->pipe, data-
 >output) {
 		if (wanted_pipe != PIPE_NONE && data->pipe !=

wanted_pipe)

tests/kms_ccs.c +0 -0
 			continue;
tests/kms_concurrent.c +1 -1
index b34540b..db06a37 100644
@@ -351,8 +351,8 @@ run_tests_for_pipe(data_t *data, enum pipe pipe)
 	igt_fixture {
 		int valid_tests = 0;
 
-		igt_require(data->display.pipes[pipe].n_planes > 0);
 		igt_skip_on(pipe >= data->display.n_pipes);
+		igt_require(data->display.pipes[pipe].n_planes > 0);
 
 		for_each_valid_output_on_pipe(&data->display, pipe,
 output)
tests/kms_concurrent.c +0 -0
 			valid_tests++;
tests/kms_pipe_color.c +2 -1
index fd58ac8..da49eb1 100644
@@ -1180,7 +1180,8 @@ igt_main
 	}
 
 	for (int pipe = 0; pipe < I915_MAX_PIPES; pipe++)
-		run_tests_for_pipe(&data, pipe);
+		igt_subtest_group
+			run_tests_for_pipe(&data, pipe);
 
 	igt_subtest_f("invalid-lut-sizes")
 		invalid_lut_sizes(&data);
tests/kms_plane.c +0 -3
index e1bd467..34418ca 100644
@@ -354,9 +354,6 @@ test_plane_panning(data_t *data, enum pipe pipe,
 int plane,
 	igt_output_t *output;
 	int connected_outs = 0;
 
-	igt_skip_on(pipe >= data->display.n_pipes);
-	igt_skip_on(plane >= data->display.pipes[pipe].n_planes);
-
 	for_each_valid_output_on_pipe(&data->display, pipe, output) {
 		test_plane_panning_with_output(data, pipe, plane, output,
tests/kms_plane.c +5 -0
 						flags);
@@ -369,6 +366,11 @@ test_plane_panning(data_t *data, enum pipe pipe,
 int plane,
 static void
 run_tests_for_pipe_plane(data_t *data, enum pipe pipe)
 {
+	igt_fixture {
+		igt_skip_on(pipe >= data->display.n_pipes);
+		igt_require(data->display.pipes[pipe].n_planes > 0);
+	}
+
 	igt_subtest_f("plane-position-covered-pipe-%s-planes",
 		      kmstest_pipe_name(pipe)) {

int n_planes = data->display.pipes[pipe].n_planes;
--
2.7.4

Quoted 4 lines

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

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

#3 lore raw
Quoted 43 lines · Alexander
Quoted 43 lines

-----Original Message-----
From: amd-gfx [mailto:[email protected]] On Behalf Of [email protected]
Sent: Thursday, June 08, 2017 3:11 PM
To: [email protected]; [email protected]; Wentland, Harry
Cc: Li, Sun peng
Subject: [PATCH i-g-t] tests: Increase value of I915_MAX_PIPES to 6

From: "Leo (Sunpeng) Li" <[email protected]>

Increasing max pipe count to 6 to support AMD GPU's.

Since some tests' behavior depends on this value, small changes are made to remove this dependency:

* kms_ccs: Early abort if wanted_pipe is out-of-bounds.
* kms_concurrent: Check if pipe is within bounds first.
* kms_pipe_color: Prevent skipping of subsequent tests by placing generated tests in a 'igt_subtest_group'.
* kms_plane: Move pipe and plane index checking to subtest group level.

---
 lib/igt_kms.c          | 10 ++++++++--
 lib/igt_kms.h          |  3 +++
 tests/kms_ccs.c        |  2 ++
 tests/kms_concurrent.c |  2 +-
 tests/kms_pipe_color.c |  3 ++-
 tests/kms_plane.c      |  8 +++++---
 6 files changed, 21 insertions(+), 7 deletions(-)
lib/igt_kms.c +1 -1
index c77716b..1bb62f0 100644
@@ -319,12 +319,12 @@ const unsigned char* igt_kms_get_alt_edid(void)
  */
 const char *kmstest_pipe_name(enum pipe pipe)
 {
-	const char *str[] = { "A", "B", "C" };
+	const char *str[] = { "A", "B", "C", "D", "E", "F"};
 
Quoted 8 lines

lib/igt_kms.c const unsigned char* igt_kms_get_alt_edid(void) · line 327

Quoted 5 lines
lib/igt_kms.c +1 -1
 	if (pipe == PIPE_NONE)
 		return "None";
 
-	if (pipe > 2)
+	if (pipe > 5)

Use I915_MAX_PIPES here rather than hardcoding 5. With that fixed the patch is:

The name can be changed to IGT_MAX_PIPES, as using I915 here is missleading.

Quoted 106 lines
Quoted 106 lines
lib/igt_kms.c +6 -0
 		return "invalid";
 
 	return str[pipe];
@@ -344,6 +344,12 @@ int kmstest_pipe_to_index(char pipe)
 		return 1;
 	else if (pipe == 'C')
 		return 2;
+	else if (pipe == 'D')
+		return 3;
+	else if (pipe == 'E')
+		return 4;
+	else if (pipe == 'F')
+		return 5;
 	else
 		return -EINVAL;
 }
lib/igt_kms.h +3 -0
index 9567a26..8f7c2bb 100644
@@ -54,6 +54,9 @@ enum pipe {
         PIPE_A = 0,
         PIPE_B,
         PIPE_C,
+	PIPE_D,
+	PIPE_E,
+	PIPE_F,
         I915_MAX_PIPES
 };
 const char *kmstest_pipe_name(enum pipe pipe);
tests/kms_ccs.c +2 -0
index d829152..0795e3a 100644
@@ -250,6 +250,8 @@ static void test(data_t *data)
 	int valid_tests = 0;
 	enum pipe wanted_pipe = data->pipe;
 
+	igt_skip_on(wanted_pipe >= display->n_pipes);
+
 	for_each_pipe_with_valid_output(display, data->pipe, data-
 >output) {
 		if (wanted_pipe != PIPE_NONE && data->pipe !=

wanted_pipe)

tests/kms_ccs.c +0 -0
 			continue;
tests/kms_concurrent.c +1 -1
index b34540b..db06a37 100644
@@ -351,8 +351,8 @@ run_tests_for_pipe(data_t *data, enum pipe pipe)
 	igt_fixture {
 		int valid_tests = 0;
 
-		igt_require(data->display.pipes[pipe].n_planes > 0);
 		igt_skip_on(pipe >= data->display.n_pipes);
+		igt_require(data->display.pipes[pipe].n_planes > 0);
 
 		for_each_valid_output_on_pipe(&data->display, pipe,
 output)
tests/kms_concurrent.c +0 -0
 			valid_tests++;
tests/kms_pipe_color.c +2 -1
index fd58ac8..da49eb1 100644
@@ -1180,7 +1180,8 @@ igt_main
 	}
 
 	for (int pipe = 0; pipe < I915_MAX_PIPES; pipe++)
-		run_tests_for_pipe(&data, pipe);
+		igt_subtest_group
+			run_tests_for_pipe(&data, pipe);
 
 	igt_subtest_f("invalid-lut-sizes")
 		invalid_lut_sizes(&data);
tests/kms_plane.c +0 -3
index e1bd467..34418ca 100644
@@ -354,9 +354,6 @@ test_plane_panning(data_t *data, enum pipe pipe,
 int plane,
 	igt_output_t *output;
 	int connected_outs = 0;
 
-	igt_skip_on(pipe >= data->display.n_pipes);
-	igt_skip_on(plane >= data->display.pipes[pipe].n_planes);
-
 	for_each_valid_output_on_pipe(&data->display, pipe, output) {
 		test_plane_panning_with_output(data, pipe, plane, output,
tests/kms_plane.c +5 -0
 						flags);
@@ -369,6 +366,11 @@ test_plane_panning(data_t *data, enum pipe pipe,
 int plane,
 static void
 run_tests_for_pipe_plane(data_t *data, enum pipe pipe)
 {
+	igt_fixture {
+		igt_skip_on(pipe >= data->display.n_pipes);
+		igt_require(data->display.pipes[pipe].n_planes > 0);
+	}
+
 	igt_subtest_f("plane-position-covered-pipe-%s-planes",
 		      kmstest_pipe_name(pipe)) {

int n_planes = data->display.pipes[pipe].n_planes;
--
2.7.4

Quoted 8 lines
Quoted 4 lines

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

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

A message that is not in the archive (sent off-list or not yet received): 20170609094916.GH25282-vmkuTAUGE3v8HXaCWoL7+7KMmGWinSIL2HeeBUIffwg@public.gmane.org

#5 lore raw
Quoted 47 lines · Arkadiusz Hiler
Quoted 46 lines · Alexander
Quoted 46 lines

-----Original Message-----
From: amd-gfx [mailto:[email protected]] On Behalf Of [email protected]
Sent: Thursday, June 08, 2017 3:11 PM
To: [email protected]; [email protected]; Wentland, Harry
Cc: Li, Sun peng
Subject: [PATCH i-g-t] tests: Increase value of I915_MAX_PIPES to 6

From: "Leo (Sunpeng) Li" <[email protected]>

Increasing max pipe count to 6 to support AMD GPU's.

Since some tests' behavior depends on this value, small changes are made to remove this dependency:

* kms_ccs: Early abort if wanted_pipe is out-of-bounds.
* kms_concurrent: Check if pipe is within bounds first.
* kms_pipe_color: Prevent skipping of subsequent tests by placing generated tests in a 'igt_subtest_group'.
* kms_plane: Move pipe and plane index checking to subtest group level.

---
  lib/igt_kms.c          | 10 ++++++++--
  lib/igt_kms.h          |  3 +++
  tests/kms_ccs.c        |  2 ++
  tests/kms_concurrent.c |  2 +-
  tests/kms_pipe_color.c |  3 ++-
  tests/kms_plane.c      |  8 +++++---
  6 files changed, 21 insertions(+), 7 deletions(-)
lib/igt_kms.c +1 -1
index c77716b..1bb62f0 100644
@@ -319,12 +319,12 @@ const unsigned char* igt_kms_get_alt_edid(void)
   */
  const char *kmstest_pipe_name(enum pipe pipe)
  {
-	const char *str[] = { "A", "B", "C" };
+	const char *str[] = { "A", "B", "C", "D", "E", "F"};
 
  	if (pipe == PIPE_NONE)
  		return "None";
 
Quoted 9 lines
Quoted 5 lines

lib/igt_kms.c const unsigned char* igt_kms_get_alt_edid(void) · line 327

Quoted 2 lines
lib/igt_kms.c +1 -1
-	if (pipe > 2)
+	if (pipe > 5)

Use I915_MAX_PIPES here rather than hardcoding 5. With that fixed the patch is:

The name can be changed to IGT_MAX_PIPES, as using I915 here is missleading.

Renaming I915_MAX_PIPES will cause wider changes, I'll submit a new patch for that. Will submit a v2 for Alex's comment.

Leo

Quoted 105 lines
Quoted 105 lines
Quoted 105 lines
lib/igt_kms.c +6 -0
  		return "invalid";
 
  	return str[pipe];
@@ -344,6 +344,12 @@ int kmstest_pipe_to_index(char pipe)
  		return 1;
  	else if (pipe == 'C')
  		return 2;
+	else if (pipe == 'D')
+		return 3;
+	else if (pipe == 'E')
+		return 4;
+	else if (pipe == 'F')
+		return 5;
  	else
  		return -EINVAL;
  }
lib/igt_kms.h +3 -0
index 9567a26..8f7c2bb 100644
@@ -54,6 +54,9 @@ enum pipe {
          PIPE_A = 0,
          PIPE_B,
          PIPE_C,
+	PIPE_D,
+	PIPE_E,
+	PIPE_F,
          I915_MAX_PIPES
  };
  const char *kmstest_pipe_name(enum pipe pipe);
tests/kms_ccs.c +2 -0
index d829152..0795e3a 100644
@@ -250,6 +250,8 @@ static void test(data_t *data)
  	int valid_tests = 0;
  	enum pipe wanted_pipe = data->pipe;
 
+	igt_skip_on(wanted_pipe >= display->n_pipes);
+
  	for_each_pipe_with_valid_output(display, data->pipe, data-
 > output) {
  		if (wanted_pipe != PIPE_NONE && data->pipe !=

wanted_pipe)
continue;

tests/kms_concurrent.c +1 -1
index b34540b..db06a37 100644
@@ -351,8 +351,8 @@ run_tests_for_pipe(data_t *data, enum pipe pipe)
  	igt_fixture {
  		int valid_tests = 0;
 
-		igt_require(data->display.pipes[pipe].n_planes > 0);
  		igt_skip_on(pipe >= data->display.n_pipes);
+		igt_require(data->display.pipes[pipe].n_planes > 0);
 
  		for_each_valid_output_on_pipe(&data->display, pipe,
 output)

valid_tests++;

tests/kms_pipe_color.c +2 -1
index fd58ac8..da49eb1 100644
@@ -1180,7 +1180,8 @@ igt_main
  	}
 
  	for (int pipe = 0; pipe < I915_MAX_PIPES; pipe++)
-		run_tests_for_pipe(&data, pipe);
+		igt_subtest_group
+			run_tests_for_pipe(&data, pipe);
 
  	igt_subtest_f("invalid-lut-sizes")
  		invalid_lut_sizes(&data);
tests/kms_plane.c +0 -3
index e1bd467..34418ca 100644
@@ -354,9 +354,6 @@ test_plane_panning(data_t *data, enum pipe pipe,
 int plane,
  	igt_output_t *output;
  	int connected_outs = 0;
 
-	igt_skip_on(pipe >= data->display.n_pipes);
-	igt_skip_on(plane >= data->display.pipes[pipe].n_planes);
-
  	for_each_valid_output_on_pipe(&data->display, pipe, output) {
  		test_plane_panning_with_output(data, pipe, plane, output,

flags);

tests/kms_plane.c +5 -0
@@ -369,6 +366,11 @@ test_plane_panning(data_t *data, enum pipe pipe,
 int plane,
  static void
  run_tests_for_pipe_plane(data_t *data, enum pipe pipe)
  {
+	igt_fixture {
+		igt_skip_on(pipe >= data->display.n_pipes);
+		igt_require(data->display.pipes[pipe].n_planes > 0);
+	}
+
  	igt_subtest_f("plane-position-covered-pipe-%s-planes",
  		      kmstest_pipe_name(pipe)) {

int n_planes = data->display.pipes[pipe].n_planes;
--
2.7.4

Quoted 8 lines
Quoted 8 lines
Quoted 4 lines

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

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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