From 46c612d0248ba6e0c8c236cf1839b0c2ccecee01 Mon Sep 17 00:00:00 2001
From: Dave Stevenson <dave.stevenson@raspberrypi.org>
Date: Wed, 29 May 2019 15:44:11 +0100
Subject: [PATCH] drm/vc4: Correct SAND support for FKMS.

It was accepting NV21 which doesn't map through, but
also wasn't advertising the modifier so nothing would know
to request it.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
---
 drivers/gpu/drm/vc4/vc4_firmware_kms.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

--- a/drivers/gpu/drm/vc4/vc4_firmware_kms.c
+++ b/drivers/gpu/drm/vc4/vc4_firmware_kms.c
@@ -546,7 +546,6 @@ static bool vc4_fkms_format_mod_supporte
 			return false;
 		}
 	case DRM_FORMAT_NV12:
-	case DRM_FORMAT_NV21:
 		switch (fourcc_mod_broadcom_mod(modifier)) {
 		case DRM_FORMAT_MOD_LINEAR:
 		case DRM_FORMAT_MOD_BROADCOM_SAND128:
@@ -554,6 +553,7 @@ static bool vc4_fkms_format_mod_supporte
 		default:
 			return false;
 		}
+	case DRM_FORMAT_NV21:
 	case DRM_FORMAT_RGB888:
 	case DRM_FORMAT_BGR888:
 	case DRM_FORMAT_YUV422:
@@ -600,6 +600,7 @@ static struct drm_plane *vc4_fkms_plane_
 		 * would prefer to scan out linear (less bus traffic).
 		 */
 		DRM_FORMAT_MOD_BROADCOM_VC4_T_TILED,
+		DRM_FORMAT_MOD_BROADCOM_SAND128,
 		DRM_FORMAT_MOD_INVALID,
 	};
 	int i;
