difos/target/linux/bcm27xx/patches-6.12/950-0953-drm-vc4-plane-Enable-scaler-for-YUV444-on-GEN6.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

41 lines
1.5 KiB
Diff

From ef79eea9e4b8f5974a3bcb9fac2c15372d97bfff Mon Sep 17 00:00:00 2001
From: Dave Stevenson <dave.stevenson@raspberrypi.com>
Date: Tue, 15 Apr 2025 17:46:08 +0100
Subject: [PATCH] drm/vc4: plane: Enable scaler for YUV444 on GEN6
GEN6 requires the luma scaler to be enabled for YUV444 to
be rendered at 1:1, otherwise the source plane isn't rendered.
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 | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
--- a/drivers/gpu/drm/vc4/vc4_plane.c
+++ b/drivers/gpu/drm/vc4/vc4_plane.c
@@ -1857,6 +1857,24 @@ static int vc6_plane_mode_set(struct drm
if (ret)
return ret;
+ if (state->fb->format->format == DRM_FORMAT_YUV444 ||
+ state->fb->format->format == DRM_FORMAT_YVU444) {
+ /* Similar to YUV422 requiring the chroma scaler to always be
+ * enabled that is handled in vc4_plane_setup_clipping_and_scaling,
+ * GEN6 requires the scaler for the luma channel to be enabled
+ * for YUV444.
+ */
+ if (vc4_state->x_scaling[0] == VC4_SCALING_NONE) {
+ vc4_state->x_scaling[0] = VC4_SCALING_PPF;
+ vc4_state->is_unity = false;
+ }
+
+ if (vc4_state->y_scaling[0] == VC4_SCALING_NONE) {
+ vc4_state->y_scaling[0] = VC4_SCALING_PPF;
+ vc4_state->is_unity = false;
+ }
+ }
+
if (!vc4_state->src_w[0] || !vc4_state->src_h[0] ||
!vc4_state->crtc_w || !vc4_state->crtc_h) {
/* 0 source size probably means the plane is offscreen.