Skip to contentSkip to conversation

drm/vc4: Limit SAND tiling support to semiplanar YUV420 formats

PATCH Applied Paul Kocialkowski 3 participants 3 messages Dec 14, 2018 – Jan 11, 2019

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/vc4: Limit SAND tiling support to semiplanar YUV420 formats

Despite what the HVS documentation indicates, the VC4 does not actually support SAND tiling modes for any RGB format and only semiplanar YUV420 formats (NV12/NV21) can be used in these tiling modes.

The driver currently claims to support RGB formats for the associated modifiers, so remove them from the supported list in the format_mod_supported helper for RGB formats.

Remove further checks that are no longer necessary along the way, since semi-planar YUV420 formats support every SAND tiling mode.

---
 drivers/gpu/drm/vc4/vc4_plane.c | 17 +----------------
 1 file changed, 1 insertion(+), 16 deletions(-)
drivers/gpu/drm/vc4/vc4_plane.c +1 -16
index 75db62cbe468..a176e7d8af27 100644
@@ -596,20 +596,7 @@ static int vc4_plane_mode_set(struct drm_plane *plane,
 	case DRM_FORMAT_MOD_BROADCOM_SAND256: {
 		uint32_t param = fourcc_mod_broadcom_param(fb->modifier);
 
-		/* Column-based NV12 or RGBA.
-		 */
-		if (fb->format->num_planes > 1) {
-			if (hvs_format != HVS_PIXEL_FORMAT_YCBCR_YUV420_2PLANE) {
-				DRM_DEBUG_KMS("SAND format only valid for NV12/21");
-				return -EINVAL;
-			}
-			hvs_format = HVS_PIXEL_FORMAT_H264;
-		} else {
-			if (base_format_mod == DRM_FORMAT_MOD_BROADCOM_SAND256) {
-				DRM_DEBUG_KMS("SAND256 format only valid for H.264");
-				return -EINVAL;
-			}
-		}
+		hvs_format = HVS_PIXEL_FORMAT_H264;
 
 		switch (base_format_mod) {
 		case DRM_FORMAT_MOD_BROADCOM_SAND64:
@@ -1050,8 +1037,6 @@ static bool vc4_format_mod_supported(struct drm_plane *plane,
 		switch (fourcc_mod_broadcom_mod(modifier)) {
 		case DRM_FORMAT_MOD_LINEAR:
 		case DRM_FORMAT_MOD_BROADCOM_VC4_T_TILED:
-		case DRM_FORMAT_MOD_BROADCOM_SAND64:
-		case DRM_FORMAT_MOD_BROADCOM_SAND128:
 			return true;
 		default:
 			return false;
Signature · 6 lines
2.19.2

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Reviewed-by on v1 1/1
#1 lore raw
Quoted 4 lines · Paul Kocialkowski

Despite what the HVS documentation indicates, the VC4 does not actually support SAND tiling modes for any RGB format and only semiplanar YUV420 formats (NV12/NV21) can be used in these tiling modes.

Quoted 8 lines

The driver currently claims to support RGB formats for the associated modifiers, so remove them from the supported list in the format_mod_supported helper for RGB formats.

Remove further checks that are no longer necessary along the way, since semi-planar YUV420 formats support every SAND tiling mode.

#2 lore raw
Quoted 10 lines · Eric Anholt
Quoted 8 lines · Paul Kocialkowski

Despite what the HVS documentation indicates, the VC4 does not actually support SAND tiling modes for any RGB format and only semiplanar YUV420 formats (NV12/NV21) can be used in these tiling modes.

The driver currently claims to support RGB formats for the associated modifiers, so remove them from the supported list in the format_mod_supported helper for RGB formats.

Quoted 6 lines
Quoted 4 lines

Remove further checks that are no longer necessary along the way, since semi-planar YUV420 formats support every SAND tiling mode.

Applied,

Maxime

Signature · 3 lines
Maxime Ripard, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel