Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 4 additions & 14 deletions drivers/gpu/drm/vc4/vc4_plane.c
Original file line number Diff line number Diff line change
Expand Up @@ -802,7 +802,10 @@ static unsigned int vc4_lbm_components(const struct drm_plane_state *state,
if (info->is_yuv)
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 3;
Expand All @@ -812,11 +815,8 @@ static unsigned int vc4_lbm_channel_size(const struct drm_plane_state *state,
unsigned int channel)
{
const struct drm_format_info *info = state->fb->format;
const struct vc4_plane_state *vc4_state = to_vc4_plane_state(state);
unsigned int channels_scaled = 0;
unsigned int components, words, wpc;
unsigned int width, lines;
unsigned int i;

/* LBM is meant to use the smaller of source or dest width, but there
* is a issue with UV scaling that the size required for the second
Expand All @@ -836,20 +836,10 @@ static unsigned int vc4_lbm_channel_size(const struct drm_plane_state *state,
if (!components)
return 0;

if (state->alpha != DRM_BLEND_ALPHA_OPAQUE && info->has_alpha)
components -= 1;

words = width * wpc * components;

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

for (i = 0; i < 2; i++)
if (vc4_state->y_scaling[channel] != VC4_SCALING_NONE)
channels_scaled++;

if (channels_scaled == 1)
lines = lines / 2;

return lines;
}

Expand Down