mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-02 09:30:11 +01:00
anv/bo_pool: Allow freeing BOs where the anv_bo is in the BO itself
This commit is contained in:
parent
181b142fbd
commit
8c2b9d1529
1 changed files with 6 additions and 4 deletions
|
|
@ -853,11 +853,13 @@ anv_bo_pool_alloc(struct anv_bo_pool *pool, struct anv_bo *bo)
|
|||
}
|
||||
|
||||
void
|
||||
anv_bo_pool_free(struct anv_bo_pool *pool, const struct anv_bo *bo)
|
||||
anv_bo_pool_free(struct anv_bo_pool *pool, const struct anv_bo *bo_in)
|
||||
{
|
||||
struct bo_pool_bo_link *link = bo->map;
|
||||
link->bo = *bo;
|
||||
/* Make a copy in case the anv_bo happens to be storred in the BO */
|
||||
struct anv_bo bo = *bo_in;
|
||||
struct bo_pool_bo_link *link = bo.map;
|
||||
link->bo = bo;
|
||||
|
||||
VG(VALGRIND_MEMPOOL_FREE(pool, bo->map));
|
||||
VG(VALGRIND_MEMPOOL_FREE(pool, bo.map));
|
||||
anv_ptr_free_list_push(&pool->free_list, link);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue