447a6b3
From patchwork Tue Oct  9 13:24:46 2018
447a6b3
Content-Type: text/plain; charset="utf-8"
447a6b3
MIME-Version: 1.0
447a6b3
Content-Transfer-Encoding: 7bit
447a6b3
Subject: drm/vc4: Set ->is_yuv to false when num_planes == 1
447a6b3
From: Boris Brezillon <boris.brezillon@bootlin.com>
447a6b3
X-Patchwork-Id: 255528
447a6b3
Message-Id: <20181009132446.21960-1-boris.brezillon@bootlin.com>
447a6b3
To: David Airlie <airlied@linux.ie>, Daniel Vetter <daniel@ffwll.ch>,
447a6b3
 dri-devel@lists.freedesktop.org, Eric Anholt <eric@anholt.net>
447a6b3
Cc: Boris Brezillon <boris.brezillon@bootlin.com>, stable@vger.kernel.org
447a6b3
Date: Tue,  9 Oct 2018 15:24:46 +0200
447a6b3
447a6b3
When vc4_plane_state is duplicated ->is_yuv is left assigned to its
447a6b3
previous value, and we never set it back to false when switching to
447a6b3
a non-YUV format.
447a6b3
447a6b3
Fix that by setting ->is_yuv to false in the 'num_planes == 1' branch
447a6b3
of the vc4_plane_setup_clipping_and_scaling() function.
447a6b3
447a6b3
Fixes: fc04023fafecf ("drm/vc4: Add support for YUV planes.")
447a6b3
Cc: <stable@vger.kernel.org>
447a6b3
Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com>
447a6b3
Reviewed-by: Eric Anholt <eric@anholt.net>
447a6b3
---
447a6b3
 drivers/gpu/drm/vc4/vc4_plane.c | 1 +
447a6b3
 1 file changed, 1 insertion(+)
447a6b3
447a6b3
diff --git a/drivers/gpu/drm/vc4/vc4_plane.c b/drivers/gpu/drm/vc4/vc4_plane.c
447a6b3
index d04b3c3246ba..60d5ad19cedd 100644
447a6b3
--- a/drivers/gpu/drm/vc4/vc4_plane.c
447a6b3
+++ b/drivers/gpu/drm/vc4/vc4_plane.c
447a6b3
@@ -321,6 +321,7 @@ static int vc4_plane_setup_clipping_and_scaling(struct drm_plane_state *state)
447a6b3
 		if (vc4_state->is_unity)
447a6b3
 			vc4_state->x_scaling[0] = VC4_SCALING_PPF;
447a6b3
 	} else {
447a6b3
+		vc4_state->is_yuv = false;
447a6b3
 		vc4_state->x_scaling[1] = VC4_SCALING_NONE;
447a6b3
 		vc4_state->y_scaling[1] = VC4_SCALING_NONE;
447a6b3
 	}