All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ville Syrjala <ville.syrjala@linux.intel.com>
To: igt-dev@lists.freedesktop.org
Subject: [igt-dev] [PATCH i-g-t 2/3] tests/kms_plane_scaling: Allow clip test to fail with YUV
Date: Fri, 18 May 2018 23:41:53 +0300	[thread overview]
Message-ID: <20180518204154.21990-2-ville.syrjala@linux.intel.com> (raw)
In-Reply-To: <20180518204154.21990-1-ville.syrjala@linux.intel.com>

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

YUV formats require the clipped src coordinates to be suitably aligned.
We'd need to very carefully compute the unclipped dst coordinates to
guarantee that. That's too much hassle so let's just accept failure in
case YUV formats are used.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 lib/igt_fb.c              | 20 ++++++++++++++++++++
 lib/igt_fb.h              |  1 +
 tests/kms_plane_scaling.c | 10 ++++++++++
 3 files changed, 31 insertions(+)

diff --git a/lib/igt_fb.c b/lib/igt_fb.c
index 34b1a261b95c..9308ade0c50e 100644
--- a/lib/igt_fb.c
+++ b/lib/igt_fb.c
@@ -1706,3 +1706,23 @@ bool igt_fb_supported_format(uint32_t drm_format)
 
 	return false;
 }
+
+/**
+ * igt_format_is_yuv:
+ * @drm_format: drm fourcc
+ *
+ * This functions returns whether @drm_format is YUV (as opposed to RGB).
+ */
+bool igt_format_is_yuv(uint32_t drm_format)
+{
+	switch (drm_format) {
+	case DRM_FORMAT_NV12:
+	case DRM_FORMAT_YUYV:
+	case DRM_FORMAT_YVYU:
+	case DRM_FORMAT_UYVY:
+	case DRM_FORMAT_VYUY:
+		return true;
+	default:
+		return false;
+	}
+}
diff --git a/lib/igt_fb.h b/lib/igt_fb.h
index 023b069db592..081ed42a99c9 100644
--- a/lib/igt_fb.h
+++ b/lib/igt_fb.h
@@ -163,6 +163,7 @@ uint32_t igt_bpp_depth_to_drm_format(int bpp, int depth);
 uint32_t igt_drm_format_to_bpp(uint32_t drm_format);
 const char *igt_format_str(uint32_t drm_format);
 bool igt_fb_supported_format(uint32_t drm_format);
+bool igt_format_is_yuv(uint32_t drm_format);
 
 #endif /* __IGT_FB_H__ */
 
diff --git a/tests/kms_plane_scaling.c b/tests/kms_plane_scaling.c
index a8454205dbd8..a12a3a0ade2b 100644
--- a/tests/kms_plane_scaling.c
+++ b/tests/kms_plane_scaling.c
@@ -408,6 +408,16 @@ __test_scaler_with_clipping_clamping_scenario(data_t *d, drmModeModeInfo *mode,
 	igt_plane_set_size(d->plane2, mode->hdisplay + 100,
 					    mode->vdisplay + 100);
 	igt_display_commit2(&d->display, COMMIT_ATOMIC);
+
+	/*
+	 * Can't guarantee that the clipped coordinates are
+	 * suitably aligned for yuv. So allow the commit to fail.
+	 */
+	if (igt_format_is_yuv(d->fb[1].drm_format) ||
+	    igt_format_is_yuv(d->fb[2].drm_format))
+		igt_display_try_commit2(&d->display, COMMIT_ATOMIC);
+	else
+		igt_display_commit2(&d->display, COMMIT_ATOMIC);
 }
 
 static void
-- 
2.16.1

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

  reply	other threads:[~2018-05-18 20:42 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-18 20:41 [igt-dev] [PATCH i-g-t 1/3] tests/kms_ccs: Don't populate igt_fb structs with stack garbage Ville Syrjala
2018-05-18 20:41 ` Ville Syrjala [this message]
2018-05-18 20:41 ` [igt-dev] [PATCH i-g-t 3/3] tests/kms_plane_scaling: Reduce the fb size 8x8 from 9x9 Ville Syrjala
2018-05-18 21:16 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,1/3] tests/kms_ccs: Don't populate igt_fb structs with stack garbage Patchwork
2018-05-19  8:01 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
2018-05-23 17:58 ` [igt-dev] [PATCH i-g-t 1/3] " Dhinakaran Pandiyan

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=20180518204154.21990-2-ville.syrjala@linux.intel.com \
    --to=ville.syrjala@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.