summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorVille Syrjälä <ville.syrjala@linux.intel.com>2018-05-18 23:32:32 +0300
committerVille Syrjälä <ville.syrjala@linux.intel.com>2018-05-23 18:43:07 +0300
commit40bf6d03f8b73230790aa03c817d9940d0feb4ab (patch)
treed50aacfc6d41841bd6c66c166a113bf3d112f449 /lib
parentee5043fada2917aee96469e4319c6ab48267adde (diff)
tests/kms_plane_scaling: Allow clip test to fail with YUV
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. v2: Actually remove the original igt_display_commit2() (Maarten) Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> #irc
Diffstat (limited to 'lib')
-rw-r--r--lib/igt_fb.c20
-rw-r--r--lib/igt_fb.h1
2 files changed, 21 insertions, 0 deletions
diff --git a/lib/igt_fb.c b/lib/igt_fb.c
index 34b1a261..9308ade0 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 023b069d..081ed42a 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__ */