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 3/9] tests/kms_plane_scaling: Test all pixel formats in pipe-*-scaler-with-rotation
Date: Thu,  1 Feb 2018 16:39:08 +0100	[thread overview]
Message-ID: <20180201153914.74639-4-maarten.lankhorst@linux.intel.com> (raw)
In-Reply-To: <20180201153914.74639-1-maarten.lankhorst@linux.intel.com>

This will allow us to test NV12 as well, when available.

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

diff --git a/tests/kms_plane_scaling.c b/tests/kms_plane_scaling.c
index d32f3441e8c9..18a42035fb3e 100644
--- a/tests/kms_plane_scaling.c
+++ b/tests/kms_plane_scaling.c
@@ -164,25 +164,13 @@ static const igt_rotation_t rotations[] = {
 	IGT_ROTATION_270,
 };
 
-static void test_scaler_with_rotation_pipe(data_t *d, enum pipe pipe,
-					   igt_output_t *output)
+static bool can_rotate(unsigned format)
 {
-	igt_display_t *display = &d->display;
-	igt_plane_t *plane;
-
-	igt_output_set_pipe(output, pipe);
-	for_each_plane_on_pipe(display, pipe, plane) {
-		if (plane->type == DRM_PLANE_TYPE_CURSOR)
-			continue;
+	if (format == DRM_FORMAT_C8 ||
+	    format == DRM_FORMAT_RGB565)
+		return false;
 
-		for (int i = 0; i < ARRAY_SIZE(rotations); i++) {
-			igt_rotation_t rot = rotations[i];
-
-			check_scaling_pipe_plane_rot(d, plane, DRM_FORMAT_XRGB8888,
-						     LOCAL_I915_FORMAT_MOD_Y_TILED,
-						     pipe, output, rot);
-		}
-	}
+	return true;
 }
 
 static bool can_draw(uint32_t drm_format)
@@ -199,6 +187,30 @@ static bool can_draw(uint32_t drm_format)
 	return false;
 }
 
+static void test_scaler_with_rotation_pipe(data_t *d, enum pipe pipe,
+					   igt_output_t *output)
+{
+	igt_display_t *display = &d->display;
+	igt_plane_t *plane;
+
+	igt_output_set_pipe(output, pipe);
+	for_each_plane_on_pipe(display, pipe, plane) {
+		if (plane->type == DRM_PLANE_TYPE_CURSOR)
+			continue;
+
+		for (int i = 0; i < ARRAY_SIZE(rotations); i++) {
+			igt_rotation_t rot = rotations[i];
+			for (int j = 0; j < plane->drm_plane->count_formats; j++) {
+				unsigned format = plane->drm_plane->formats[j];
+				if (can_draw(format) && can_rotate(format))
+					check_scaling_pipe_plane_rot(d, plane, format,
+								     LOCAL_I915_FORMAT_MOD_Y_TILED,
+								     pipe, output, rot);
+			}
+		}
+	}
+}
+
 static const uint64_t tilings[] = {
 	LOCAL_DRM_FORMAT_MOD_NONE,
 	LOCAL_I915_FORMAT_MOD_X_TILED,
-- 
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 ` Maarten Lankhorst [this message]
2018-02-05 11:14   ` [igt-dev] [PATCH i-g-t 3/9] tests/kms_plane_scaling: Test all pixel formats in pipe-*-scaler-with-rotation Mika Kahola
2018-02-05 11:15     ` Mika Kahola
2018-02-01 15:39 ` [igt-dev] [PATCH i-g-t 4/9] tests/kms_plane_scaling: Test all pixel formats with clamping and clipping too Maarten Lankhorst
2018-02-05 11:47   ` 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-4-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