lede/target/linux/bcm27xx/patches-6.12/950-0844-drm-vc4-plane-Avoid-using-pitch-in-calculating-UBM-f.patch
=?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= d81c03f05e 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-06-20 17:01:06 +08:00

34 lines
1.2 KiB
Diff

From a308bbdfd59a49387e708c17f8876251d0c3c17d Mon Sep 17 00:00:00 2001
From: Dave Stevenson <dave.stevenson@raspberrypi.com>
Date: Thu, 27 Feb 2025 17:53:10 +0000
Subject: [PATCH] drm: vc4: plane: Avoid using pitch in calculating UBM for
SAND
The SAND modifier with height 0 is now using the provided pitch as
the column stride, but the UBM allocation needs to be done based
on the plane width.
Recompute the width in these conditions.
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
---
drivers/gpu/drm/vc4/vc4_plane.c | 7 +++++++
1 file changed, 7 insertions(+)
--- a/drivers/gpu/drm/vc4/vc4_plane.c
+++ b/drivers/gpu/drm/vc4/vc4_plane.c
@@ -843,7 +843,14 @@ static size_t vc6_upm_size(const struct
{
const struct vc4_plane_state *vc4_state = to_vc4_plane_state(state);
unsigned int stride = state->fb->pitches[plane];
+ u64 base_format_mod = fourcc_mod_broadcom_mod(state->fb->modifier);
+ if (base_format_mod == DRM_FORMAT_MOD_BROADCOM_SAND128) {
+ if (state->fb->format->format == DRM_FORMAT_P030)
+ stride = (ALIGN(state->fb->width, 96) * 4) / 3;
+ else
+ stride = ALIGN(state->fb->width, 128);
+ }
/*
* TODO: This only works for raster formats, and is sub-optimal
* for buffers with a stride aligned on 32 bytes.