Skip to content

Commit e486e8a

Browse files
committed
drm/vc4: plane: TPZ scaling modes cannot reduce lbm size when alpha-less
spec says "Note that there is not an extra mode to save memory for alpha-less formats" in the TPZ section. Curently, if first plane is RGB888 and scaled down (TPZ) a second plane will corrupt the LBM and result in garbage I've also folded in the modification to components to the function as it seems misplaced
1 parent 89f3cb8 commit e486e8a

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

drivers/gpu/drm/vc4/vc4_plane.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -802,7 +802,11 @@ static unsigned int vc4_lbm_components(const struct drm_plane_state *state,
802802
if (info->is_yuv)
803803
return channel ? 2 : 1;
804804

805-
if (info->has_alpha)
805+
// spec says "Note that there is not an extra mode to save memory for alpha-less formats" in the TPZ section
806+
if (vc4_state->y_scaling[channel] == VC4_SCALING_TPZ)
807+
return 4;
808+
809+
if (info->has_alpha && state->alpha == DRM_BLEND_ALPHA_OPAQUE)
806810
return 4;
807811

808812
return 3;
@@ -833,9 +837,6 @@ static unsigned int vc4_lbm_channel_size(const struct drm_plane_state *state,
833837
if (!components)
834838
return 0;
835839

836-
if (state->alpha != DRM_BLEND_ALPHA_OPAQUE && info->has_alpha)
837-
components -= 1;
838-
839840
words = width * wpc * components;
840841

841842
lines = DIV_ROUND_UP(words, 128 / info->hsub);

0 commit comments

Comments
 (0)