linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm/vc4: Limit SAND tiling support to semiplanar YUV420 formats
@ 2018-12-14 14:12 Paul Kocialkowski
  2018-12-14 16:16 ` Eric Anholt
  0 siblings, 1 reply; 3+ messages in thread
From: Paul Kocialkowski @ 2018-12-14 14:12 UTC (permalink / raw)
  To: dri-devel, linux-kernel
  Cc: Eric Anholt, David Airlie, Boris Brezillon, Eben Upton,
	Maxime Ripard, Thomas Petazzoni, 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.

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

Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
---
 drivers/gpu/drm/vc4/vc4_plane.c | 17 +----------------
 1 file changed, 1 insertion(+), 16 deletions(-)

diff --git a/drivers/gpu/drm/vc4/vc4_plane.c b/drivers/gpu/drm/vc4/vc4_plane.c
index 75db62cbe468..a176e7d8af27 100644
--- a/drivers/gpu/drm/vc4/vc4_plane.c
+++ b/drivers/gpu/drm/vc4/vc4_plane.c
@@ -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;
-- 
2.19.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] drm/vc4: Limit SAND tiling support to semiplanar YUV420 formats
  2018-12-14 14:12 [PATCH] drm/vc4: Limit SAND tiling support to semiplanar YUV420 formats Paul Kocialkowski
@ 2018-12-14 16:16 ` Eric Anholt
  2019-01-11 15:53   ` Maxime Ripard
  0 siblings, 1 reply; 3+ messages in thread
From: Eric Anholt @ 2018-12-14 16:16 UTC (permalink / raw)
  To: Paul Kocialkowski, dri-devel, linux-kernel
  Cc: David Airlie, Boris Brezillon, Eben Upton, Maxime Ripard,
	Thomas Petazzoni, Paul Kocialkowski

[-- Attachment #1: Type: text/plain, Size: 694 bytes --]

Paul Kocialkowski <paul.kocialkowski@bootlin.com> writes:

> 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.
>
> Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>

Reviewed-by: Eric Anholt <eric@anholt.net>

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] drm/vc4: Limit SAND tiling support to semiplanar YUV420 formats
  2018-12-14 16:16 ` Eric Anholt
@ 2019-01-11 15:53   ` Maxime Ripard
  0 siblings, 0 replies; 3+ messages in thread
From: Maxime Ripard @ 2019-01-11 15:53 UTC (permalink / raw)
  To: Eric Anholt
  Cc: Paul Kocialkowski, dri-devel, linux-kernel, Eben Upton,
	David Airlie, Boris Brezillon, Thomas Petazzoni

[-- Attachment #1: Type: text/plain, Size: 919 bytes --]

On Fri, Dec 14, 2018 at 08:16:32AM -0800, Eric Anholt wrote:
> Paul Kocialkowski <paul.kocialkowski@bootlin.com> writes:
> 
> > 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.
> >
> > Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
> 
> Reviewed-by: Eric Anholt <eric@anholt.net>

Applied,

Maxime


-- 
Maxime Ripard, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-01-11 15:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-14 14:12 [PATCH] drm/vc4: Limit SAND tiling support to semiplanar YUV420 formats Paul Kocialkowski
2018-12-14 16:16 ` Eric Anholt
2019-01-11 15:53   ` Maxime Ripard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).