mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-16 00:40:32 +01:00
panfrost: in-place map/unmap shouldn't grow
If we're doing in-place map/unmap of a tiled resource, that shouldn't cause the size of the resource to grow. So let's drop this needless complexity, and just assert this assumption instead. Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32724>
This commit is contained in:
parent
b60ee4251e
commit
8dae603431
1 changed files with 5 additions and 8 deletions
|
|
@ -1815,14 +1815,11 @@ panfrost_ptr_unmap(struct pipe_context *pctx, struct pipe_transfer *transfer)
|
|||
if (panfrost_should_linear_convert(ctx, prsrc, transfer)) {
|
||||
panfrost_resource_setup(screen, prsrc, DRM_FORMAT_MOD_LINEAR,
|
||||
prsrc->image.layout.format);
|
||||
if (prsrc->image.layout.data_size > panfrost_bo_size(bo)) {
|
||||
const char *label = bo->label;
|
||||
panfrost_bo_unreference(bo);
|
||||
bo = prsrc->bo = panfrost_bo_create(
|
||||
dev, prsrc->image.layout.data_size, 0, label);
|
||||
prsrc->image.data.base = prsrc->bo->ptr.gpu;
|
||||
assert(bo);
|
||||
}
|
||||
|
||||
/* converting the resource from tiled to linear and back
|
||||
* shouldn't increase memory usage...
|
||||
*/
|
||||
assert(prsrc->image.layout.data_size <= panfrost_bo_size(bo));
|
||||
|
||||
util_copy_rect(
|
||||
bo->ptr.cpu + prsrc->image.layout.slices[0].offset,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue