Skip to content

Commit aa8e7a1

Browse files
popcornmixpelwell
authored andcommitted
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. Currently, 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 Signed-off-by: Dom Cobley <[email protected]>
1 parent 8b6719f commit aa8e7a1

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

drivers/gpu/drm/vc4/vc4_plane.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -805,7 +805,10 @@ static unsigned int vc4_lbm_components(const struct drm_plane_state *state,
805805
if (info->is_yuv)
806806
return channel ? 2 : 1;
807807

808-
if (info->has_alpha)
808+
if (vc4_state->y_scaling[channel] == VC4_SCALING_TPZ)
809+
return 4;
810+
811+
if (info->has_alpha && state->alpha == DRM_BLEND_ALPHA_OPAQUE)
809812
return 4;
810813

811814
return 3;
@@ -836,9 +839,6 @@ static unsigned int vc4_lbm_channel_size(const struct drm_plane_state *state,
836839
if (!components)
837840
return 0;
838841

839-
if (state->alpha != DRM_BLEND_ALPHA_OPAQUE && info->has_alpha)
840-
components -= 1;
841-
842842
words = width * wpc * components;
843843

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

0 commit comments

Comments
 (0)