mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-22 15:00:22 +01:00
panfrost: Update the resource layout before calling util_copy_rect()
If we don't do that, the line_stride might be wrong. We also need
to create a new BO if the previous one is too small to hold the
linear version, which can happen with the tile alignment done on
linear+renderable resources.
Suggested-by: Icecream95
Fixes: d4f662a252 ("panfrost: Update the resource layout when doing a tile -> linear conversion")
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7821>
This commit is contained in:
parent
90515f90c8
commit
741921e2ff
1 changed files with 9 additions and 2 deletions
|
|
@ -1044,6 +1044,15 @@ panfrost_ptr_unmap(struct pipe_context *pctx,
|
|||
assert(transfer->box.depth == 1);
|
||||
|
||||
if (panfrost_should_linear_convert(prsrc, transfer)) {
|
||||
size_t bo_size;
|
||||
|
||||
panfrost_resource_setup(dev, prsrc, &bo_size, DRM_FORMAT_MOD_LINEAR);
|
||||
if (bo_size > bo->size) {
|
||||
panfrost_bo_unreference(bo);
|
||||
bo = prsrc->bo = panfrost_bo_create(dev, bo_size, 0);
|
||||
assert(bo);
|
||||
}
|
||||
|
||||
util_copy_rect(
|
||||
bo->ptr.cpu + prsrc->slices[0].offset,
|
||||
prsrc->base.format,
|
||||
|
|
@ -1054,8 +1063,6 @@ panfrost_ptr_unmap(struct pipe_context *pctx,
|
|||
trans->map,
|
||||
transfer->stride,
|
||||
0, 0);
|
||||
|
||||
panfrost_resource_setup(dev, prsrc, NULL, DRM_FORMAT_MOD_LINEAR);
|
||||
} else {
|
||||
panfrost_store_tiled_image(
|
||||
bo->ptr.cpu + prsrc->slices[transfer->level].offset,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue