Commit 23b060bb authored by Alyssa Rosenzweig's avatar Alyssa Rosenzweig 💜 Committed by Marge Bot
Browse files

panfrost: Fix AFBC body_size for shared resources



Accidental read-before-write due to incorrect statement ordering. I love
SSA as much as anyone, but not everything is a parallel copy.

Fixes faults in glamor in 21.0 when using GIMP on v5.
Signed-off-by: Alyssa Rosenzweig's avatarAlyssa Rosenzweig <alyssa@collabora.com>
Fixes: e8b997e1

 ("panfrost: Add AFBC slice.body_size and slice.{row,surface}_stride fields")
Closes: #4389
Reviewed-by: Boris Brezillon's avatarBoris Brezillon <boris.brezillon@collabora.com>
Part-of: <mesa/mesa!10148>
parent e52712a6
......@@ -184,6 +184,7 @@ panfrost_mfbd_rt_set_buf(struct pipe_surface *surf,
rt->afbc.chunk_size = 9;
rt->midgard_afbc.sparse = true;
rt->afbc.body_size = slice->afbc.body_size;
assert(rt->afbc.body_size > 0);
}
panfrost_get_afbc_pointers(rsrc, level, first_layer,
......
......@@ -127,14 +127,16 @@ panfrost_resource_from_handle(struct pipe_screen *pscreen,
unsigned tile_h =
panfrost_block_dim(whandle->modifier, false, 0);
rsc->layout.slices[0].afbc.body_size =
rsc->layout.slices[0].row_stride *
DIV_ROUND_UP(templat->height0, tile_h);
rsc->layout.slices[0].afbc.header_size =
panfrost_afbc_header_size(templat->width0, templat->height0);
rsc->layout.slices[0].afbc.row_stride =
DIV_ROUND_UP(templat->width0, tile_w) *
AFBC_HEADER_BYTES_PER_TILE;
rsc->layout.slices[0].afbc.body_size =
rsc->layout.slices[0].row_stride *
DIV_ROUND_UP(templat->height0, tile_h);
}
if (dev->ro) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment