WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Commit 3b8d670

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. 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 476f31e commit 3b8d670

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
@@ -802,7 +802,10 @@ 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+
if (vc4_state->y_scaling[channel] == VC4_SCALING_TPZ)
806+
return 4;
807+
808+
if (info->has_alpha && state->alpha == DRM_BLEND_ALPHA_OPAQUE)
806809
return 4;
807810

808811
return 3;
@@ -833,9 +836,6 @@ static unsigned int vc4_lbm_channel_size(const struct drm_plane_state *state,
833836
if (!components)
834837
return 0;
835838

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

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

0 commit comments

Comments
 (0)