bcm27xx: update 6.1 patches from RPi foundation
[openwrt/staging/stintel.git] / target / linux / bcm27xx / patches-6.1 / 950-1285-vc4-hvs-Fix-lbm-size-calculation-for-yuv-6012.patch
1 From c0169f2c197d005aff8acfbc618de6e7f6b1ab94 Mon Sep 17 00:00:00 2001
2 From: Florian Wesch <fw@dividuum.de>
3 Date: Tue, 5 Mar 2024 15:17:56 +0100
4 Subject: [PATCH 1285/1295] vc4/hvs: Fix lbm size calculation for yuv (#6012)
5
6 The code was reducing the number of components by one when we were not
7 blending with alpha. But that only makes sense if the components include
8 alpha.
9
10 For YUV, we were reducing the number of components for Y from one to zero
11 which resulted in no lbm space being allocated.
12
13 Fixes: https://github.com/raspberrypi/linux/issues/5912
14
15 Signed-off-by: Dom Cobley <popcornmix@gmail.com>
16 Co-authored-by: Dom Cobley <popcornmix@gmail.com>
17 ---
18 drivers/gpu/drm/vc4/vc4_plane.c | 2 +-
19 1 file changed, 1 insertion(+), 1 deletion(-)
20
21 --- a/drivers/gpu/drm/vc4/vc4_plane.c
22 +++ b/drivers/gpu/drm/vc4/vc4_plane.c
23 @@ -733,7 +733,7 @@ static unsigned int vc4_lbm_channel_size
24 if (!components)
25 return 0;
26
27 - if (state->alpha != DRM_BLEND_ALPHA_OPAQUE)
28 + if (state->alpha != DRM_BLEND_ALPHA_OPAQUE && info->has_alpha)
29 components -= 1;
30
31 words = width * wpc * components;