mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-22 20:00:10 +01:00
radv/winsys: clear the PRT VA range when destroying a virtual BO
Instead of unmapping every range. Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14116>
This commit is contained in:
parent
782474782b
commit
a931d5a4a4
1 changed files with 11 additions and 1 deletions
|
|
@ -358,8 +358,18 @@ radv_amdgpu_winsys_bo_destroy(struct radeon_winsys *_ws, struct radeon_winsys_bo
|
||||||
radv_amdgpu_log_bo(ws, bo, true);
|
radv_amdgpu_log_bo(ws, bo, true);
|
||||||
|
|
||||||
if (bo->is_virtual) {
|
if (bo->is_virtual) {
|
||||||
|
int r;
|
||||||
|
|
||||||
|
/* Clear mappings of this PRT VA region. */
|
||||||
|
r = radv_amdgpu_bo_va_op(ws, bo->bo, 0, bo->size, bo->base.va, 0, 0, AMDGPU_VA_OP_CLEAR);
|
||||||
|
if (r) {
|
||||||
|
fprintf(stderr, "amdgpu: Failed to clear a PRT VA region (%d).\n", r);
|
||||||
|
}
|
||||||
|
|
||||||
for (uint32_t i = 0; i < bo->range_count; ++i) {
|
for (uint32_t i = 0; i < bo->range_count; ++i) {
|
||||||
radv_amdgpu_winsys_virtual_unmap(ws, bo, bo->ranges + i);
|
const struct radv_amdgpu_map_range *range = bo->ranges + i;
|
||||||
|
if (range->bo)
|
||||||
|
ws->base.buffer_destroy(&ws->base, (struct radeon_winsys_bo *)range->bo);
|
||||||
}
|
}
|
||||||
free(bo->bos);
|
free(bo->bos);
|
||||||
free(bo->ranges);
|
free(bo->ranges);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue