drm/vc4: Fix YUV plane handling when planes are in different buffers
authorDave Stevenson <dave.stevenson@raspberrypi.com>
Fri, 27 Jan 2023 15:57:08 +0000 (16:57 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 22 Feb 2023 11:59:50 +0000 (12:59 +0100)
commite105b5e0d703ec66b2427e73c66727d198606f4b
treef425baaacfe28157fa02a26607e78f2e148aa9c8
parentfcc6266d0da40a6931d846f7df03add0a04e30a7
drm/vc4: Fix YUV plane handling when planes are in different buffers

commit 6b77b16de75a6efc0870b1fa467209387cbee8f3 upstream.

YUV images can either be presented as one allocation with offsets
for the different planes, or multiple allocations with 0 offsets.

The driver only ever calls drm_fb_[dma|cma]_get_gem_obj with plane
index 0, therefore any application using the second approach was
incorrectly rendered.

Correctly determine the address for each plane, removing the
assumption that the base address is the same for each.

Fixes: fc04023fafec ("drm/vc4: Add support for YUV planes.")
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
Link: https://patchwork.freedesktop.org/patch/msgid/20230127155708.454704-1-maxime@cerno.tech
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/gpu/drm/vc4/vc4_plane.c