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 <paul.kocialkowski@bootlin.com> Acked-by: Maxime Ripard <maxime.ripard@bootlin.com> Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com> Link: https://patchwork.freedesktop.org/patch/msgid/20190118145133.21281-4-paul.kocialkowski@bootlin.com
This commit is contained in:
committed by
Maxime Ripard
parent
a211e56e94
commit
0fff724a33
@@ -245,7 +245,8 @@ static int sun4i_backend_update_yuv_format(struct sun4i_backend *backend,
|
|||||||
SUN4I_BACKEND_ATTCTL_REG0_LAY_YUVEN);
|
SUN4I_BACKEND_ATTCTL_REG0_LAY_YUVEN);
|
||||||
|
|
||||||
/* TODO: Add support for the multi-planar YUV formats */
|
/* 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;
|
val |= SUN4I_BACKEND_IYUVCTL_FBFMT_PACKED_YUV422;
|
||||||
else
|
else
|
||||||
DRM_DEBUG_DRIVER("Unsupported YUV format (0x%x)\n", fmt);
|
DRM_DEBUG_DRIVER("Unsupported YUV format (0x%x)\n", fmt);
|
||||||
|
|||||||
Reference in New Issue
Block a user