difos/target/linux/bcm27xx/patches-6.12/950-0952-drm-vc4-plane-Increase-UPM-allocation-size-for-YUV44.patch
Álvaro Fernández Rojas 8f9e91ad03 bcm27xx: add 6.12 patches from RPi repo
These patches were generated from:
https://github.com/raspberrypi/linux/commits/rpi-6.12.y
With the following command:
git format-patch -N v6.12.27..HEAD
(HEAD -> 8d3206ee456a5ecdf9ddbfd8e5e231e4f0cd716e)

Exceptions:
- (def)configs patches
- github workflows patches
- applied & reverted patches
- readme patches
- wireless patches

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2025-05-21 11:32:18 +02:00

34 lines
1.3 KiB
Diff

From ff35eadf97e99fa6abf907941a6125f1b44a8951 Mon Sep 17 00:00:00 2001
From: Dave Stevenson <dave.stevenson@raspberrypi.com>
Date: Tue, 15 Apr 2025 14:48:19 +0100
Subject: [PATCH] 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: 076eedaf762f ("drm/vc4: hvs: Add support for BCM2712 HVS")
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
---
drivers/gpu/drm/vc4/vc4_plane.c | 3 +++
1 file changed, 3 insertions(+)
--- a/drivers/gpu/drm/vc4/vc4_plane.c
+++ b/drivers/gpu/drm/vc4/vc4_plane.c
@@ -851,6 +851,9 @@ static size_t vc6_upm_size(const struct
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.