Skip to content

Commit 9c744ee

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 8dcbf7b commit 9c744ee

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;
@@ -835,9 +839,6 @@ static unsigned int vc4_lbm_channel_size(const struct drm_plane_state *state,
835839
if (!components)
836840
return 0;
837841

838-
if (state->alpha != DRM_BLEND_ALPHA_OPAQUE && info->has_alpha)
839-
components -= 1;
840-
841842
words = width * wpc * components;
842843

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

0 commit comments

Comments
 (0)