Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: Boris Brezillon <boris.brezillon@bootlin.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Link: https://patchwork.freedesktop.org/patch/msgid/20181130090254.594-6-boris.brezillon@bootlin.com

+4 -12
+4 -12
drivers/gpu/drm/vc4/vc4_plane.c
··· 1095 1095 struct drm_plane *plane = NULL; 1096 1096 struct vc4_plane *vc4_plane; 1097 1097 u32 formats[ARRAY_SIZE(hvs_formats)]; 1098 - u32 num_formats = 0; 1099 1098 int ret = 0; 1100 1099 unsigned i; 1101 1100 static const uint64_t modifiers[] = { ··· 1111 1112 if (!vc4_plane) 1112 1113 return ERR_PTR(-ENOMEM); 1113 1114 1114 - for (i = 0; i < ARRAY_SIZE(hvs_formats); i++) { 1115 - /* Don't allow YUV in cursor planes, since that means 1116 - * tuning on the scaler, which we don't allow for the 1117 - * cursor. 1118 - */ 1119 - if (type != DRM_PLANE_TYPE_CURSOR || 1120 - hvs_formats[i].hvs < HVS_PIXEL_FORMAT_YCBCR_YUV420_3PLANE) { 1121 - formats[num_formats++] = hvs_formats[i].drm; 1122 - } 1123 - } 1115 + for (i = 0; i < ARRAY_SIZE(hvs_formats); i++) 1116 + formats[i] = hvs_formats[i].drm; 1117 + 1124 1118 plane = &vc4_plane->base; 1125 1119 ret = drm_universal_plane_init(dev, plane, 0, 1126 1120 &vc4_plane_funcs, 1127 - formats, num_formats, 1121 + formats, ARRAY_SIZE(formats), 1128 1122 modifiers, type, NULL); 1129 1123 1130 1124 drm_plane_helper_add(plane, &vc4_plane_helper_funcs);