diff mbox series

drm/vc4: Set ->is_yuv to false when num_planes == 1

Message ID 20181009132446.21960-1-boris.brezillon@bootlin.com (mailing list archive)
State New, archived
Headers show
Series drm/vc4: Set ->is_yuv to false when num_planes == 1 | expand

Commit Message

Boris Brezillon Oct. 9, 2018, 1:24 p.m. UTC
When vc4_plane_state is duplicated ->is_yuv is left assigned to its
previous value, and we never set it back to false when switching to
a non-YUV format.

Fix that by setting ->is_yuv to false in the 'num_planes == 1' branch
of the vc4_plane_setup_clipping_and_scaling() function.

Fixes: fc04023fafecf ("drm/vc4: Add support for YUV planes.")
Cc: <stable@vger.kernel.org>
Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com>
---
 drivers/gpu/drm/vc4/vc4_plane.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Eric Anholt Oct. 9, 2018, 7:54 p.m. UTC | #1
Boris Brezillon <boris.brezillon@bootlin.com> writes:

> When vc4_plane_state is duplicated ->is_yuv is left assigned to its
> previous value, and we never set it back to false when switching to
> a non-YUV format.
>
> Fix that by setting ->is_yuv to false in the 'num_planes == 1' branch
> of the vc4_plane_setup_clipping_and_scaling() function.

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

Patch

diff --git a/drivers/gpu/drm/vc4/vc4_plane.c b/drivers/gpu/drm/vc4/vc4_plane.c
index d04b3c3246ba..60d5ad19cedd 100644
--- a/drivers/gpu/drm/vc4/vc4_plane.c
+++ b/drivers/gpu/drm/vc4/vc4_plane.c
@@ -321,6 +321,7 @@  static int vc4_plane_setup_clipping_and_scaling(struct drm_plane_state *state)
 		if (vc4_state->is_unity)
 			vc4_state->x_scaling[0] = VC4_SCALING_PPF;
 	} else {
+		vc4_state->is_yuv = false;
 		vc4_state->x_scaling[1] = VC4_SCALING_NONE;
 		vc4_state->y_scaling[1] = VC4_SCALING_NONE;
 	}