mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-23 04:00:23 +01:00
llvmpipe: handle vma allocation failure
Fixes:a062544d3d("llvmpipe: Use an anonymous file for memory allocations") Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30229> (cherry picked from commita8ff1bdc83)
This commit is contained in:
parent
dd3f21e8a2
commit
d10fa7e4d3
2 changed files with 6 additions and 1 deletions
|
|
@ -1224,7 +1224,7 @@
|
|||
"description": "llvmpipe: handle vma allocation failure",
|
||||
"nominated": true,
|
||||
"nomination_type": 1,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"main_sha": null,
|
||||
"because_sha": "a062544d3d0519aaa3845b7cfd79e925b9352a55",
|
||||
"notes": null
|
||||
|
|
|
|||
|
|
@ -1305,6 +1305,11 @@ llvmpipe_allocate_memory(struct pipe_screen *_screen, uint64_t size)
|
|||
mtx_lock(&screen->mem_mutex);
|
||||
|
||||
mem->offset = util_vma_heap_alloc(&screen->mem_heap, mem->size, alignment);
|
||||
if (!mem->offset) {
|
||||
mtx_unlock(&screen->mem_mutex);
|
||||
FREE(mem);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (mem->offset + mem->size > screen->mem_file_size) {
|
||||
/* expand the anonymous file */
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue