drm/vc4: Reset ->{x, y}_scaling[1] when dealing with uniplanar formats
authorBoris Brezillon <boris.brezillon@bootlin.com>
Tue, 24 Jul 2018 13:36:01 +0000 (15:36 +0200)
committerBoris Brezillon <boris.brezillon@bootlin.com>
Wed, 25 Jul 2018 19:15:24 +0000 (21:15 +0200)
This is needed to ensure ->is_unity is correct when the plane was
previously configured to output a multi-planar format with scaling
enabled, and is then being reconfigured to output a uniplanar format.

Fixes: fc04023fafec ("drm/vc4: Add support for YUV planes.")
Cc: <stable@vger.kernel.org>
Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Link: https://patchwork.freedesktop.org/patch/msgid/20180724133601.32114-1-boris.brezillon@bootlin.com
drivers/gpu/drm/vc4/vc4_plane.c

index 1d34619eb3fe3f57402291e7dbd05c4a193c45e1..a951ec75d01f8b1f579402512a4696af2c696533 100644 (file)
@@ -320,6 +320,9 @@ static int vc4_plane_setup_clipping_and_scaling(struct drm_plane_state *state)
                        vc4_state->x_scaling[0] = VC4_SCALING_TPZ;
                if (vc4_state->y_scaling[0] == VC4_SCALING_NONE)
                        vc4_state->y_scaling[0] = VC4_SCALING_TPZ;
+       } else {
+               vc4_state->x_scaling[1] = VC4_SCALING_NONE;
+               vc4_state->y_scaling[1] = VC4_SCALING_NONE;
        }
 
        vc4_state->is_unity = (vc4_state->x_scaling[0] == VC4_SCALING_NONE &&