diff options
author | Paul Kocialkowski <[email protected]> | 2019-01-18 15:51:13 +0100 |
---|---|---|
committer | Maxime Ripard <[email protected]> | 2019-01-18 19:00:29 +0100 |
commit | 0fff724a33917ac581b5825375d0b57affedee76 (patch) | |
tree | 9b4df291e2f62c84e3882ab570e7354e2df7e97b | |
parent | a211e56e947c8dbf37e1682f278bcfe8b20129c4 (diff) |
drm/sun4i: backend: Use explicit fourcc helpers for packed YUV422 check
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 <[email protected]>
Acked-by: Maxime Ripard <[email protected]>
Signed-off-by: Maxime Ripard <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
-rw-r--r-- | drivers/gpu/drm/sun4i/sun4i_backend.c | 3 |
1 files changed, 2 insertions, 1 deletions
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, SUN4I_BACKEND_ATTCTL_REG0_LAY_YUVEN); /* 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)) val |= SUN4I_BACKEND_IYUVCTL_FBFMT_PACKED_YUV422; else DRM_DEBUG_DRIVER("Unsupported YUV format (0x%x)\n", fmt); |