Skip to content

Commit d6e50c6

Browse files
6by9popcornmix
authored andcommitted
drm/vc4: plane: Increase UPM allocation size for YUV444
YUV444 support isn't officially supported by the hardware, but worked if you told it the image was YUV422 with double the width and altered chroma scaling. Adding BCM2712 support gained a fetcher memory (UPM). The code handling UPM allocations didn't have a case for YUV444, so only allocated based on the base width, and therefore underflowed. Increase the UPM allocation size for the luma plane of YUV444 to match. Fixes: 076eeda ("drm/vc4: hvs: Add support for BCM2712 HVS") Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
1 parent c7534c9 commit d6e50c6

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

drivers/gpu/drm/vc4/vc4_plane.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -854,6 +854,9 @@ static size_t vc6_upm_size(const struct drm_plane_state *state,
854854
else
855855
stride = ALIGN(state->fb->width, 128);
856856
}
857+
if (!plane && (state->fb->format->format == DRM_FORMAT_YUV444 ||
858+
state->fb->format->format == DRM_FORMAT_YVU444))
859+
stride <<= 1;
857860
/*
858861
* TODO: This only works for raster formats, and is sub-optimal
859862
* for buffers with a stride aligned on 32 bytes.

0 commit comments

Comments
 (0)