[v5,03/23] drm/sun4i: backend: Use explicit fourcc helpers for packed YUV422 check

Submitted by Paul Kocialkowski on Jan. 18, 2019, 2:43 p.m.


Message ID 20190118144328.20649-4-paul.kocialkowski@bootlin.com
State New
Headers show
Series "drm/sun4i: Support for linear and tiled YUV formats with the frontend" ( rev: 4 ) in DRI devel

Not browsing as part of any series.

Commit Message

Paul Kocialkowski Jan. 18, 2019, 2:43 p.m.
Checking for the number of planes is not sufficient to en ensure that
the format is a packed YUV422.

Use explicit fourcc helpers for the check instead.

Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
Acked-by: Maxime Ripard <maxime.ripard@bootlin.com>
 drivers/gpu/drm/sun4i/sun4i_backend.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/drivers/gpu/drm/sun4i/sun4i_backend.c b/drivers/gpu/drm/sun4i/sun4i_backend.c
index 9e9255ee59cd..bbadc2ab9f4d 100644
--- a/drivers/gpu/drm/sun4i/sun4i_backend.c
+++ b/drivers/gpu/drm/sun4i/sun4i_backend.c
@@ -245,7 +245,8 @@  static int sun4i_backend_update_yuv_format(struct sun4i_backend *backend,
 	/* TODO: Add support for the multi-planar YUV formats */
-	if (format->num_planes == 1)
+	if (drm_format_info_is_yuv_packed(format) &&
+	    drm_format_info_is_yuv_sampling_422(format))
 		DRM_DEBUG_DRIVER("Unsupported YUV format (0x%x)\n", fmt);