mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-06-19 06:18:24 +02:00
iris: Fix lock/unlock mismatch for non-LLC coherent BO allocation.
The goto jumped over the mtx_lock, but proceeded to hit the mtx_unlock. We can simply set the bucket to NULL and it will skip the cache without goto, and without messing up locking. Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
This commit is contained in:
parent
2285b93032
commit
5fc11fd988
1 changed files with 3 additions and 7 deletions
|
|
@ -380,15 +380,12 @@ bo_alloc_internal(struct iris_bufmgr *bufmgr,
|
|||
if (flags & BO_ALLOC_ZEROED)
|
||||
zeroed = true;
|
||||
|
||||
if ((flags & BO_ALLOC_COHERENT) && !bufmgr->has_llc) {
|
||||
bo_size = MAX2(ALIGN(size, page_size), page_size);
|
||||
bucket = NULL;
|
||||
goto skip_cache;
|
||||
}
|
||||
|
||||
/* Round the allocated size up to a power of two number of pages. */
|
||||
bucket = bucket_for_size(bufmgr, size);
|
||||
|
||||
if ((flags & BO_ALLOC_COHERENT) && !bufmgr->has_llc)
|
||||
bucket = NULL;
|
||||
|
||||
/* If we don't have caching at this size, don't actually round the
|
||||
* allocation up.
|
||||
*/
|
||||
|
|
@ -444,7 +441,6 @@ retry:
|
|||
bo->gtt_offset = 0ull;
|
||||
}
|
||||
} else {
|
||||
skip_cache:
|
||||
bo = bo_calloc();
|
||||
if (!bo)
|
||||
goto err;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue