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: 076eedaf76 ("drm/vc4: hvs: Add support for BCM2712 HVS")
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
This commit is contained in:
Dave Stevenson
2025-04-15 14:48:19 +01:00
committed by Dom Cobley
parent f276531027
commit 836f5c8686

View File

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