diff mbox series

drm/vc4: Reset ->{x, y}_scaling[1] when dealing with uniplanar formats

Message ID 20180724133601.32114-1-boris.brezillon@bootlin.com (mailing list archive)
State New, archived
Headers show
Series drm/vc4: Reset ->{x, y}_scaling[1] when dealing with uniplanar formats | expand

Commit Message

Boris Brezillon July 24, 2018, 1:36 p.m. UTC
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>
---
 drivers/gpu/drm/vc4/vc4_plane.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Eric Anholt July 24, 2018, 7:16 p.m. UTC | #1
Boris Brezillon <boris.brezillon@bootlin.com> writes:

> 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>
Boris Brezillon July 25, 2018, 7:19 p.m. UTC | #2
On Tue, 24 Jul 2018 15:36:01 +0200
Boris Brezillon <boris.brezillon@bootlin.com> wrote:

> 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>

Applied to drm-misc-fixes.

> ---
>  drivers/gpu/drm/vc4/vc4_plane.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/gpu/drm/vc4/vc4_plane.c b/drivers/gpu/drm/vc4/vc4_plane.c
> index 9d7a36f148cf..cfb50fedfa2b 100644
> --- a/drivers/gpu/drm/vc4/vc4_plane.c
> +++ b/drivers/gpu/drm/vc4/vc4_plane.c
> @@ -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 &&
diff mbox series

Patch

diff --git a/drivers/gpu/drm/vc4/vc4_plane.c b/drivers/gpu/drm/vc4/vc4_plane.c
index 9d7a36f148cf..cfb50fedfa2b 100644
--- a/drivers/gpu/drm/vc4/vc4_plane.c
+++ b/drivers/gpu/drm/vc4/vc4_plane.c
@@ -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 &&