public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
To: intel-gfx@lists.freedesktop.org
Cc: Vidya Srinivas <vidya.srinivas@intel.com>
Subject: [PATCH i-g-t v2 9/9] tests/kms_plane_scaling: test for multi pipe with scaling
Date: Fri, 12 Jan 2018 11:21:16 +0100	[thread overview]
Message-ID: <20180112102116.4670-10-maarten.lankhorst@linux.intel.com> (raw)
In-Reply-To: <20180112102116.4670-1-maarten.lankhorst@linux.intel.com>

From: Jyoti Yadav <jyoti.r.yadav@intel.com>

Add a subtest to display primary and overlay planes on two
connected pipes and runs scaling test on both pipes

Changes since v1:
- Commit first before trying any scaling. (Maarten)
- Use the same logic as kms_cursor_legacy to find a pipe and output. (Maarten)
- Rework test to work with how cleanup is handled. (Maarten)

Signed-off-by: Jyoti Yadav <jyoti.r.yadav@intel.com>
Signed-off-by: Mahesh Kumar <mahesh1.kumar@intel.com>
Signed-off-by: Vidya Srinivas <vidya.srinivas@intel.com>
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
---
 tests/kms_plane_scaling.c | 91 ++++++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 90 insertions(+), 1 deletion(-)

diff --git a/tests/kms_plane_scaling.c b/tests/kms_plane_scaling.c
index a0f6db9f96f8..836f711d5bf2 100644
--- a/tests/kms_plane_scaling.c
+++ b/tests/kms_plane_scaling.c
@@ -40,10 +40,12 @@ typedef struct {
 
 	int num_scalers;
 
-	struct igt_fb fb[3];
+	struct igt_fb fb[4];
+
 	igt_plane_t *plane1;
 	igt_plane_t *plane2;
 	igt_plane_t *plane3;
+	igt_plane_t *plane4;
 } data_t;
 
 #define FILE_NAME   "1080p-left.png"
@@ -454,6 +456,90 @@ test_scaler_with_clipping_clamping_scenario(data_t *d, enum pipe pipe, igt_outpu
 	igt_display_commit2(&d->display, COMMIT_ATOMIC);
 }
 
+static void find_connected_pipe(igt_display_t *display, bool second, enum pipe *pipe, igt_output_t **output)
+{
+	enum pipe first = PIPE_NONE;
+	igt_output_t *first_output = NULL;
+	bool found = false;
+
+	for_each_pipe_with_valid_output(display, *pipe, *output) {
+		if (first == *pipe || *output == first_output)
+			continue;
+
+		if (second) {
+			first = *pipe;
+			first_output = *output;
+			second = false;
+			continue;
+		}
+
+		return;
+	}
+
+	if (first_output)
+		igt_require_f(found, "No second valid output found\n");
+	else
+		igt_require_f(found, "No valid outputs found\n");
+}
+
+static void test_scaler_with_multi_pipe_plane(data_t *d)
+{
+	igt_display_t *display = &d->display;
+	igt_output_t *output1, *output2;
+	drmModeModeInfo *mode1, *mode2;
+	enum pipe pipe1, pipe2;
+
+	cleanup_crtc(d);
+
+	find_connected_pipe(display, false, &pipe1, &output1);
+	find_connected_pipe(display, true, &pipe2, &output2);
+
+	igt_skip_on(!output1 || !output2);
+
+	igt_output_set_pipe(output1, pipe1);
+	igt_output_set_pipe(output2, pipe2);
+
+	d->plane1 = igt_output_get_plane(output1, 0);
+	d->plane2 = igt_output_get_plane(output1, 1);
+	d->plane3 = igt_output_get_plane(output2, 0);
+	d->plane4 = igt_output_get_plane(output2, 1);
+
+	mode1 = igt_output_get_mode(output1);
+	mode2 = igt_output_get_mode(output2);
+
+	igt_create_pattern_fb(d->drm_fd, 600, 600,
+			      DRM_FORMAT_XRGB8888,
+			      LOCAL_I915_FORMAT_MOD_Y_TILED, &d->fb[0]);
+
+	igt_create_pattern_fb(d->drm_fd, 500, 500,
+			      DRM_FORMAT_XRGB8888,
+			      LOCAL_I915_FORMAT_MOD_Y_TILED, &d->fb[1]);
+
+	igt_create_pattern_fb(d->drm_fd, 700, 700,
+			      DRM_FORMAT_XRGB8888,
+			      LOCAL_I915_FORMAT_MOD_Y_TILED, &d->fb[2]);
+
+	igt_create_pattern_fb(d->drm_fd, 400, 400,
+			      DRM_FORMAT_XRGB8888,
+			      LOCAL_I915_FORMAT_MOD_Y_TILED, &d->fb[3]);
+
+	igt_plane_set_fb(d->plane1, &d->fb[0]);
+	igt_plane_set_fb(d->plane2, &d->fb[1]);
+	igt_plane_set_fb(d->plane3, &d->fb[2]);
+	igt_plane_set_fb(d->plane4, &d->fb[3]);
+	igt_display_commit2(display, COMMIT_ATOMIC);
+
+	/* Upscaling Primary */
+	igt_plane_set_size(d->plane1, mode1->hdisplay, mode1->vdisplay);
+	igt_plane_set_size(d->plane3, mode2->hdisplay, mode2->vdisplay);
+	igt_display_commit2(display, COMMIT_ATOMIC);
+
+	/* Upscaling Sprites */
+	igt_plane_set_size(d->plane2, mode1->hdisplay, mode1->vdisplay);
+	igt_plane_set_size(d->plane4, mode2->hdisplay, mode2->vdisplay);
+	igt_display_commit2(display, COMMIT_ATOMIC);
+}
+
 igt_main
 {
 	data_t data = {};
@@ -493,6 +579,9 @@ igt_main
 				test_scaler_with_clipping_clamping_scenario(&data, pipe, output);
 	}
 
+	igt_subtest_f("2x-scaler-multi-pipe")
+		test_scaler_with_multi_pipe_plane(&data);
+
 	igt_fixture
 		igt_display_fini(&data.display);
 }
-- 
2.15.1

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

  parent reply	other threads:[~2018-01-12 12:48 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-12 10:21 [PATCH i-g-t v2 0/9] kms plane scaling tests Maarten Lankhorst
2018-01-12 10:21 ` [PATCH i-g-t v2 1/9] tests/kms_plane: Run test for all supported pixel formats, v2 Maarten Lankhorst
2018-01-12 13:52   ` Mika Kahola
2018-01-12 10:21 ` [PATCH i-g-t v2 2/9] tests/kms_plane_scaling: Move the actual test to its own function Maarten Lankhorst
2018-01-15  8:47   ` Mika Kahola
2018-01-12 10:21 ` [PATCH i-g-t v2 3/9] tests/kms_plane_scaling: Fix basic scaling test, v2 Maarten Lankhorst
2018-01-15  9:01   ` Mika Kahola
2018-01-12 10:21 ` [PATCH i-g-t v2 4/9] tests/kms_plane_scaling: Convert from simple test to full test Maarten Lankhorst
2018-01-15  9:10   ` Mika Kahola
2018-01-12 10:21 ` [PATCH i-g-t v2 5/9] tests/kms_plane_scaling: Clean up tests to work better with igt_kms Maarten Lankhorst
2018-01-12 10:21 ` [PATCH i-g-t v2 6/9] tests/kms_plane_scaling: test scaling with tiling rotation and pixel formats, v2 Maarten Lankhorst
2018-01-12 10:21 ` [PATCH i-g-t v2 7/9] tests/kms_plane_scaling: test scaler with clipping clamping, v2 Maarten Lankhorst
2018-01-12 10:21 ` [PATCH i-g-t v2 8/9] lib/igt_kms: Add more braces around macros Maarten Lankhorst
2018-01-15 12:01   ` Mika Kahola
2018-01-12 10:21 ` Maarten Lankhorst [this message]
2018-01-12 13:09 ` ✓ Fi.CI.BAT: success for kms plane scaling tests Patchwork
2018-01-12 13:58 ` ✓ Fi.CI.IGT: " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180112102116.4670-10-maarten.lankhorst@linux.intel.com \
    --to=maarten.lankhorst@linux.intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=vidya.srinivas@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox