diff options
author | Christian König <[email protected]> | 2013-09-25 13:59:56 +0200 |
---|---|---|
committer | Christian König <[email protected]> | 2013-09-25 19:41:31 +0200 |
commit | 4871128e58402385dc6f920884273c003a1124e1 (patch) | |
tree | 90abea06f7ff8f5b8a0b519de6f1d8e53dfea023 /src/gallium/drivers | |
parent | f6e2aa0e12e4ce91dc6f8ac5140d6e1f511ea468 (diff) |
radeon/winsys: keep screen pointer in winsys v2
Only create one screen for each winsys instance.
This helps with buffer sharing and interop handling.
v2: rebased and some minor cleanup
Signed-off-by: Christian König <[email protected]>
Reviewed-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r-- | src/gallium/drivers/r300/r300_screen.c | 3 | ||||
-rw-r--r-- | src/gallium/drivers/r600/r600_pipe.c | 3 | ||||
-rw-r--r-- | src/gallium/drivers/radeonsi/radeonsi_pipe.c | 3 |
3 files changed, 9 insertions, 0 deletions
diff --git a/src/gallium/drivers/r300/r300_screen.c b/src/gallium/drivers/r300/r300_screen.c index 063bc0922a1..125a1b59520 100644 --- a/src/gallium/drivers/r300/r300_screen.c +++ b/src/gallium/drivers/r300/r300_screen.c @@ -540,6 +540,9 @@ static void r300_destroy_screen(struct pipe_screen* pscreen) struct r300_screen* r300screen = r300_screen(pscreen); struct radeon_winsys *rws = radeon_winsys(pscreen); + if (rws && !radeon_winsys_unref(rws)) + return; + pipe_mutex_destroy(r300screen->cmask_mutex); if (rws) diff --git a/src/gallium/drivers/r600/r600_pipe.c b/src/gallium/drivers/r600/r600_pipe.c index 50ff06c9f0d..d86bb18034a 100644 --- a/src/gallium/drivers/r600/r600_pipe.c +++ b/src/gallium/drivers/r600/r600_pipe.c @@ -958,6 +958,9 @@ static void r600_destroy_screen(struct pipe_screen* pscreen) if (rscreen == NULL) return; + if (!radeon_winsys_unref(rscreen->b.ws)) + return; + pipe_mutex_destroy(rscreen->aux_context_lock); rscreen->aux_context->destroy(rscreen->aux_context); diff --git a/src/gallium/drivers/radeonsi/radeonsi_pipe.c b/src/gallium/drivers/radeonsi/radeonsi_pipe.c index 138268ca418..16ec51fa63b 100644 --- a/src/gallium/drivers/radeonsi/radeonsi_pipe.c +++ b/src/gallium/drivers/radeonsi/radeonsi_pipe.c @@ -648,6 +648,9 @@ static void r600_destroy_screen(struct pipe_screen* pscreen) if (rscreen == NULL) return; + if (!radeon_winsys_unref(rscreen->b.ws)) + return; + if (rscreen->fences.bo) { struct r600_fence_block *entry, *tmp; |