Commit 2c2853f7 authored by Boris Brezillon's avatar Boris Brezillon

drm/vc4: Allow YUV formats on cursor planes

Now that scaling is allowed on cursor planes, we can also allow YUV
formats.
Signed-off-by: default avatarBoris Brezillon <boris.brezillon@bootlin.com>
Reviewed-by: default avatarEric Anholt <eric@anholt.net>
Link: https://patchwork.freedesktop.org/patch/msgid/20181130090254.594-6-boris.brezillon@bootlin.com
parent 5dc416d9
...@@ -1095,7 +1095,6 @@ struct drm_plane *vc4_plane_init(struct drm_device *dev, ...@@ -1095,7 +1095,6 @@ struct drm_plane *vc4_plane_init(struct drm_device *dev,
struct drm_plane *plane = NULL; struct drm_plane *plane = NULL;
struct vc4_plane *vc4_plane; struct vc4_plane *vc4_plane;
u32 formats[ARRAY_SIZE(hvs_formats)]; u32 formats[ARRAY_SIZE(hvs_formats)];
u32 num_formats = 0;
int ret = 0; int ret = 0;
unsigned i; unsigned i;
static const uint64_t modifiers[] = { static const uint64_t modifiers[] = {
...@@ -1112,20 +1111,13 @@ struct drm_plane *vc4_plane_init(struct drm_device *dev, ...@@ -1112,20 +1111,13 @@ struct drm_plane *vc4_plane_init(struct drm_device *dev,
if (!vc4_plane) if (!vc4_plane)
return ERR_PTR(-ENOMEM); return ERR_PTR(-ENOMEM);
for (i = 0; i < ARRAY_SIZE(hvs_formats); i++) { for (i = 0; i < ARRAY_SIZE(hvs_formats); i++)
/* Don't allow YUV in cursor planes, since that means formats[i] = hvs_formats[i].drm;
* tuning on the scaler, which we don't allow for the
* cursor.
*/
if (type != DRM_PLANE_TYPE_CURSOR ||
hvs_formats[i].hvs < HVS_PIXEL_FORMAT_YCBCR_YUV420_3PLANE) {
formats[num_formats++] = hvs_formats[i].drm;
}
}
plane = &vc4_plane->base; plane = &vc4_plane->base;
ret = drm_universal_plane_init(dev, plane, 0, ret = drm_universal_plane_init(dev, plane, 0,
&vc4_plane_funcs, &vc4_plane_funcs,
formats, num_formats, formats, ARRAY_SIZE(formats),
modifiers, type, NULL); modifiers, type, NULL);
drm_plane_helper_add(plane, &vc4_plane_helper_funcs); drm_plane_helper_add(plane, &vc4_plane_helper_funcs);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment