Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
To: igt-dev@lists.freedesktop.org
Subject: [igt-dev] [PATCH i-g-t 4/9] tests/kms_plane_scaling: Test all pixel formats with clamping and clipping too
Date: Thu,  1 Feb 2018 16:39:09 +0100	[thread overview]
Message-ID: <20180201153914.74639-5-maarten.lankhorst@linux.intel.com> (raw)
In-Reply-To: <20180201153914.74639-1-maarten.lankhorst@linux.intel.com>

Run across all combinations of pixel formats to ensure better testing.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
---
 tests/kms_plane_scaling.c | 61 +++++++++++++++++++++++++++++++++--------------
 1 file changed, 43 insertions(+), 18 deletions(-)

diff --git a/tests/kms_plane_scaling.c b/tests/kms_plane_scaling.c
index 18a42035fb3e..208f9262f84b 100644
--- a/tests/kms_plane_scaling.c
+++ b/tests/kms_plane_scaling.c
@@ -58,14 +58,10 @@ static int get_num_scalers(uint32_t devid, enum pipe pipe)
 		return 1;
 }
 
-static void cleanup_crtc(data_t *data)
+static void cleanup_fbs(data_t *data)
 {
 	int i;
 
-	igt_display_reset(&data->display);
-	igt_pipe_crc_free(data->pipe_crc);
-	data->pipe_crc = NULL;
-
 	for (i = 0; i < ARRAY_SIZE(data->fb); i++) {
 		if (!data->fb[i].fb_id)
 			continue;
@@ -75,6 +71,15 @@ static void cleanup_crtc(data_t *data)
 	}
 }
 
+static void cleanup_crtc(data_t *data)
+{
+	igt_display_reset(&data->display);
+	igt_pipe_crc_free(data->pipe_crc);
+	data->pipe_crc = NULL;
+
+	cleanup_fbs(data);
+}
+
 static void prepare_crtc(data_t *data, igt_output_t *output, enum pipe pipe,
 			igt_plane_t *plane, drmModeModeInfo *mode)
 {
@@ -401,28 +406,20 @@ test_plane_scaling_on_pipe(data_t *d, enum pipe pipe, igt_output_t *output)
 }
 
 static void
-test_scaler_with_clipping_clamping_scenario(data_t *d, enum pipe pipe, igt_output_t *output)
+__test_scaler_with_clipping_clamping_scenario(data_t *d, drmModeModeInfo *mode,
+					      uint32_t f1, uint32_t f2)
 {
-	drmModeModeInfo *mode;
-
-	igt_require(get_num_scalers(d->devid, pipe) >= 2);
-
-	mode = igt_output_get_mode(output);
-	d->plane1 = &d->display.pipes[pipe].planes[0];
-	prepare_crtc(d, output, pipe, d->plane1, mode);
+	cleanup_fbs(d);
 
 	igt_create_pattern_fb(d->drm_fd,
-			      mode->hdisplay, mode->vdisplay,
-			      DRM_FORMAT_XRGB8888,
+			      mode->hdisplay, mode->vdisplay, f1,
 			      LOCAL_I915_FORMAT_MOD_X_TILED, &d->fb[1]);
 
 	igt_create_pattern_fb(d->drm_fd,
-			      mode->hdisplay, mode->vdisplay,
-			      DRM_FORMAT_XRGB8888,
+			      mode->hdisplay, mode->vdisplay, f2,
 			      LOCAL_I915_FORMAT_MOD_Y_TILED, &d->fb[2]);
 
 	igt_plane_set_fb(d->plane1, &d->fb[1]);
-	d->plane2 = igt_output_get_plane(output, 1);
 	igt_plane_set_fb(d->plane2, &d->fb[2]);
 
 	igt_fb_set_position(&d->fb[1], d->plane1, 0, 0);
@@ -440,6 +437,34 @@ test_scaler_with_clipping_clamping_scenario(data_t *d, enum pipe pipe, igt_outpu
 	igt_display_commit2(&d->display, COMMIT_ATOMIC);
 }
 
+static void
+test_scaler_with_clipping_clamping_scenario(data_t *d, enum pipe pipe, igt_output_t *output)
+{
+	drmModeModeInfo *mode;
+
+	igt_require(get_num_scalers(d->devid, pipe) >= 2);
+
+	mode = igt_output_get_mode(output);
+	d->plane1 = &d->display.pipes[pipe].planes[0];
+	d->plane2 = &d->display.pipes[pipe].planes[1];
+	prepare_crtc(d, output, pipe, d->plane1, mode);
+
+	for (int i = 0; i < d->plane1->drm_plane->count_formats; i++) {
+		unsigned f1 = d->plane1->drm_plane->formats[i];
+		if (!can_draw(f1))
+			continue;
+
+		for (int j = 0; j < d->plane2->drm_plane->count_formats; j++) {
+			unsigned f2 = d->plane2->drm_plane->formats[j];
+
+			if (!can_draw(f2))
+				continue;
+
+			__test_scaler_with_clipping_clamping_scenario(d, mode, f1, f2);
+		}
+	}
+}
+
 static void find_connected_pipe(igt_display_t *display, bool second, enum pipe *pipe, igt_output_t **output)
 {
 	enum pipe first = PIPE_NONE;
-- 
2.15.1

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

  parent reply	other threads:[~2018-02-01 15:39 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-01 15:39 [igt-dev] [PATCH i-g-t 0/9] tests: Cleanups and NV12 preparations Maarten Lankhorst
2018-02-01 15:39 ` [igt-dev] [PATCH i-g-t 1/9] tests/kms_panel_fitting: Remove dead code Maarten Lankhorst
2018-02-05 10:50   ` Mika Kahola
2018-02-01 15:39 ` [igt-dev] [PATCH i-g-t 2/9] tests/kms_atomic: Add the test for CRTC_ID/FB_ID mismatch Maarten Lankhorst
2018-02-05 10:53   ` Mika Kahola
2018-02-01 15:39 ` [igt-dev] [PATCH i-g-t 3/9] tests/kms_plane_scaling: Test all pixel formats in pipe-*-scaler-with-rotation Maarten Lankhorst
2018-02-05 11:14   ` Mika Kahola
2018-02-05 11:15     ` Mika Kahola
2018-02-01 15:39 ` Maarten Lankhorst [this message]
2018-02-05 11:47   ` [igt-dev] [PATCH i-g-t 4/9] tests/kms_plane_scaling: Test all pixel formats with clamping and clipping too Mika Kahola
2018-02-01 15:39 ` [igt-dev] [PATCH i-g-t 5/9] tests/kms_rotation_crc: Fix bad-tiling testcase Maarten Lankhorst
2018-02-06 10:50   ` Mika Kahola
2018-02-01 15:39 ` [igt-dev] [PATCH i-g-t 6/9] tests/kms_rotation_crc: Move bad_format parameter to test_plane_rotation Maarten Lankhorst
2018-02-06 10:57   ` Mika Kahola
2018-02-01 15:39 ` [igt-dev] [PATCH i-g-t 7/9] tests/kms_rotation_crc: Always run the flip tests when available Maarten Lankhorst
2018-02-06 11:39   ` Mika Kahola
2018-02-01 15:39 ` [igt-dev] [PATCH i-g-t 8/9] tests/kms_rotation_crc: Remove primary-rotation-90-Y-tiled Maarten Lankhorst
2018-02-06 13:01   ` Mika Kahola
2018-02-01 15:39 ` [igt-dev] [PATCH i-g-t 9/9] tests/kms_rotation_crc: Perform lazy cleanup and require atomic Maarten Lankhorst
2018-02-07  8:55   ` Mika Kahola
2018-02-07  9:46     ` Maarten Lankhorst
2018-02-07 10:37       ` Mika Kahola
2018-02-01 16:04 ` [igt-dev] ✓ Fi.CI.BAT: success for tests: Cleanups and NV12 preparations Patchwork
2018-02-01 19:07 ` [igt-dev] ✗ Fi.CI.IGT: warning " 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=20180201153914.74639-5-maarten.lankhorst@linux.intel.com \
    --to=maarten.lankhorst@linux.intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    /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