[PATCH i-g-t v3 4/8] tests/kms_plane_scaling: Move get_num_scalers to a function.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The number of scalers can depend on the pipe, so require at least 1
scaler before running any subtests.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@xxxxxxxxxxxxxxx>
---
 tests/kms_plane_scaling.c | 20 ++++++++++++++------
 1 file changed, 14 insertions(+), 6 deletions(-)

diff --git a/tests/kms_plane_scaling.c b/tests/kms_plane_scaling.c
index 7e9a948a6b33..d1afcc819d0a 100644
--- a/tests/kms_plane_scaling.c
+++ b/tests/kms_plane_scaling.c
@@ -38,8 +38,6 @@ typedef struct {
 	int image_w;
 	int image_h;
 
-	int num_scalers;
-
 	struct igt_fb fb1;
 	struct igt_fb fb2;
 	struct igt_fb fb3;
@@ -53,6 +51,16 @@ typedef struct {
 	igt_plane_t *plane4;
 } data_t;
 
+static int get_num_scalers(uint32_t devid, enum pipe pipe)
+{
+	igt_require(intel_gen(devid) >= 9);
+
+	if (intel_gen(devid) > 9 || pipe != PIPE_C)
+		return 2;
+	else
+		return 1;
+}
+
 static void prepare_crtc(data_t *data, igt_output_t *output, enum pipe pipe,
 			igt_plane_t *plane, drmModeModeInfo *mode, enum igt_commit_style s)
 {
@@ -170,8 +178,6 @@ test_plane_scaling_on_pipe(data_t *d, enum pipe pipe, igt_output_t *output)
 	drmModeModeInfo *mode;
 	int primary_plane_scaling = 0; /* For now */
 
-	igt_require(d->num_scalers > 0);
-
 	igt_display_reset(display);
 	igt_output_set_pipe(output, pipe);
 	mode = igt_output_get_mode(output);
@@ -310,15 +316,17 @@ igt_main
 		igt_require_pipe_crc(data.drm_fd);
 		igt_display_init(&data.display, data.drm_fd);
 		data.devid = intel_get_drm_devid(data.drm_fd);
-		data.num_scalers = intel_gen(data.devid) >= 9 ? 2 : 0;
 	}
 
 	for_each_pipe_static(pipe) igt_subtest_group {
 		igt_output_t *output;
 
-		igt_fixture
+		igt_fixture {
 			igt_display_require_output_on_pipe(&data.display, pipe);
 
+			igt_require(get_num_scalers(data.devid, pipe) > 0);
+		}
+
 		igt_subtest_f("pipe-%s-plane-scaling", kmstest_pipe_name(pipe))
 			for_each_valid_output_on_pipe(&data.display, pipe, output)
 				test_plane_scaling_on_pipe(&data, pipe, output);
-- 
2.15.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux