diff options
author | Marek Olšák <[email protected]> | 2015-12-09 22:36:26 +0100 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2015-12-11 15:25:13 +0100 |
commit | eb1e1af676ae785cc4a1423a9ca35101c81f4eb8 (patch) | |
tree | 3f83ef211648941f663ca5e7be2f49b58cf8ae00 /src/gallium/winsys/amdgpu | |
parent | f9d6fe800113656098e72baad5e5f856627b74e3 (diff) |
winsys/amdgpu: clear the buffer cache on allocation failure and try again
Reviewed-by: Michel Dänzer <[email protected]>
Diffstat (limited to 'src/gallium/winsys/amdgpu')
-rw-r--r-- | src/gallium/winsys/amdgpu/drm/amdgpu_bo.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/gallium/winsys/amdgpu/drm/amdgpu_bo.c b/src/gallium/winsys/amdgpu/drm/amdgpu_bo.c index daf41fcc6a3..90f3a9f35d0 100644 --- a/src/gallium/winsys/amdgpu/drm/amdgpu_bo.c +++ b/src/gallium/winsys/amdgpu/drm/amdgpu_bo.c @@ -495,8 +495,13 @@ amdgpu_bo_create(struct radeon_winsys *rws, /* Create a new one. */ bo = amdgpu_create_bo(ws, size, alignment, usage, domain, flags); - if (!bo) - return NULL; + if (!bo) { + /* Clear the cache and try again. */ + pb_cache_release_all_buffers(&ws->bo_cache); + bo = amdgpu_create_bo(ws, size, alignment, usage, domain, flags); + if (!bo) + return NULL; + } bo->use_reusable_pool = use_reusable_pool; return &bo->base; |