Skip to content

Commit ff35ead

Browse files
6by9pelwell
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 <[email protected]>
1 parent 0170785 commit ff35ead

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
@@ -851,6 +851,9 @@ static size_t vc6_upm_size(const struct drm_plane_state *state,
851851
else
852852
stride = ALIGN(state->fb->width, 128);
853853
}
854+
if (!plane && (state->fb->format->format == DRM_FORMAT_YUV444 ||
855+
state->fb->format->format == DRM_FORMAT_YVU444))
856+
stride <<= 1;
854857
/*
855858
* TODO: This only works for raster formats, and is sub-optimal
856859
* for buffers with a stride aligned on 32 bytes.

0 commit comments

Comments
 (0)