summaryrefslogtreecommitdiffstats
path: root/src/gallium/winsys
diff options
context:
space:
mode:
authorNicolai Hähnle <[email protected]>2016-09-06 15:12:18 +0200
committerNicolai Hähnle <[email protected]>2016-09-12 13:54:56 +0200
commit480ac143df281fef762e30f92bccc3b89674fef8 (patch)
treecf62027cc747baf7b021b499321c048ff488b2e1 /src/gallium/winsys
parent9fb8d354cafd080e1616f5bd5e2f50b43c0d820f (diff)
winsys/amdgpu: add do_winsys_deinit function
The idea is to have matching init/deinit functions so that deinit can be re-used for cleanup in the error path of amdgpu_winsys_create. Reviewed-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src/gallium/winsys')
-rw-r--r--src/gallium/winsys/amdgpu/drm/amdgpu_winsys.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/gallium/winsys/amdgpu/drm/amdgpu_winsys.c b/src/gallium/winsys/amdgpu/drm/amdgpu_winsys.c
index 521a78a08af..3961ee38440 100644
--- a/src/gallium/winsys/amdgpu/drm/amdgpu_winsys.c
+++ b/src/gallium/winsys/amdgpu/drm/amdgpu_winsys.c
@@ -368,6 +368,12 @@ fail:
return false;
}
+static void do_winsys_deinit(struct amdgpu_winsys *ws)
+{
+ AddrDestroy(ws->addrlib);
+ amdgpu_device_deinitialize(ws->dev);
+}
+
static void amdgpu_winsys_destroy(struct radeon_winsys *rws)
{
struct amdgpu_winsys *ws = (struct amdgpu_winsys*)rws;
@@ -378,8 +384,7 @@ static void amdgpu_winsys_destroy(struct radeon_winsys *rws)
pipe_mutex_destroy(ws->bo_fence_lock);
pb_cache_deinit(&ws->bo_cache);
pipe_mutex_destroy(ws->global_bo_list_lock);
- AddrDestroy(ws->addrlib);
- amdgpu_device_deinitialize(ws->dev);
+ do_winsys_deinit(ws);
FREE(rws);
}