vc4/hvs: Fix lbm size calculation for yuv
authorDom Cobley <popcornmix@gmail.com>
Fri, 16 Feb 2024 15:57:41 +0000 (15:57 +0000)
committerDom Cobley <popcornmix@gmail.com>
Mon, 19 Feb 2024 11:35:39 +0000 (11:35 +0000)
The code was reducing the number of components by one when we were not
blending with alpha. But that only makes sense if the components include
alpha.

For YUV, we were reducing the number of components for Y from one to zero
which resulted in no lbm space being allocated.

Fixes: https://github.com/raspberrypi/linux/issues/5912
Signed-off-by: Dom Cobley <popcornmix@gmail.com>
drivers/gpu/drm/vc4/vc4_plane.c

index 70660f1..2d1039a 100644 (file)
@@ -733,7 +733,7 @@ static unsigned int vc4_lbm_channel_size(const struct drm_plane_state *state,
        if (!components)
                return 0;
 
-       if (state->alpha != DRM_BLEND_ALPHA_OPAQUE)
+       if (state->alpha != DRM_BLEND_ALPHA_OPAQUE && info->has_alpha)
                components -= 1;
 
        words = width * wpc * components;