mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-06 01:49:46 +00:00
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 <popcornmix@gmail.com>
This commit is contained in:
@@ -802,7 +802,10 @@ static unsigned int vc4_lbm_components(const struct drm_plane_state *state,
|
|||||||
if (info->is_yuv)
|
if (info->is_yuv)
|
||||||
return channel ? 2 : 1;
|
return channel ? 2 : 1;
|
||||||
|
|
||||||
if (info->has_alpha)
|
if (vc4_state->y_scaling[channel] == VC4_SCALING_TPZ)
|
||||||
|
return 4;
|
||||||
|
|
||||||
|
if (info->has_alpha && state->alpha == DRM_BLEND_ALPHA_OPAQUE)
|
||||||
return 4;
|
return 4;
|
||||||
|
|
||||||
return 3;
|
return 3;
|
||||||
@@ -833,9 +836,6 @@ static unsigned int vc4_lbm_channel_size(const struct drm_plane_state *state,
|
|||||||
if (!components)
|
if (!components)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if (state->alpha != DRM_BLEND_ALPHA_OPAQUE && info->has_alpha)
|
|
||||||
components -= 1;
|
|
||||||
|
|
||||||
words = width * wpc * components;
|
words = width * wpc * components;
|
||||||
|
|
||||||
lines = DIV_ROUND_UP(words, 128 / info->hsub);
|
lines = DIV_ROUND_UP(words, 128 / info->hsub);
|
||||||
|
|||||||
Reference in New Issue
Block a user