]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
drm/vc4: ->x_scaling[1] should never be set to VC4_SCALING_NONE
authorBoris Brezillon <boris.brezillon@bootlin.com>
Fri, 9 Nov 2018 10:26:32 +0000 (11:26 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 12 Feb 2019 19:02:06 +0000 (20:02 +0100)
commit71cd745a9adbe46d2c3f4c684bd5bf7f47f3d327
tree694072be87e1f5be8fadbd4f7d2ab190dc823435
parent355f5af996189db4351a2f76238f5efa5a610287
drm/vc4: ->x_scaling[1] should never be set to VC4_SCALING_NONE

[ Upstream commit 0560054da5673b25d56bea6c57c8d069673af73b ]

For the YUV conversion to work properly, ->x_scaling[1] should never
be set to VC4_SCALING_NONE, but vc4_get_scaling_mode() might return
VC4_SCALING_NONE if the horizontal scaling ratio exactly matches the
horizontal subsampling factor. Add a test to turn VC4_SCALING_NONE
into VC4_SCALING_PPF when that happens.

The old ->x_scaling[0] adjustment is dropped as I couldn't find any
mention to this constraint in the spec and it's proven to be
unnecessary (I tested various multi-planar YUV formats with scaling
disabled, and all of them worked fine without this adjustment).

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