mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-06 01:49:46 +00:00
drm: vc4: plane: Avoid using pitch in calculating UBM for SAND
The SAND modifier with height 0 is now using the provided pitch as the column stride, but the UBM allocation needs to be done based on the plane width. Recompute the width in these conditions. Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
This commit is contained in:
committed by
Dom Cobley
parent
b52820d2e7
commit
69bc83d33e
@@ -846,7 +846,14 @@ static size_t vc6_upm_size(const struct drm_plane_state *state,
|
||||
{
|
||||
const struct vc4_plane_state *vc4_state = to_vc4_plane_state(state);
|
||||
unsigned int stride = state->fb->pitches[plane];
|
||||
u64 base_format_mod = fourcc_mod_broadcom_mod(state->fb->modifier);
|
||||
|
||||
if (base_format_mod == DRM_FORMAT_MOD_BROADCOM_SAND128) {
|
||||
if (state->fb->format->format == DRM_FORMAT_P030)
|
||||
stride = (ALIGN(state->fb->width, 96) * 4) / 3;
|
||||
else
|
||||
stride = ALIGN(state->fb->width, 128);
|
||||
}
|
||||
/*
|
||||
* TODO: This only works for raster formats, and is sub-optimal
|
||||
* for buffers with a stride aligned on 32 bytes.
|
||||
|
||||
Reference in New Issue
Block a user