summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/radeon/r600_pipe_common.c
diff options
context:
space:
mode:
authorMarek Olšák <marek.olsak@amd.com>2016-07-15 23:17:43 +0200
committerMarek Olšák <marek.olsak@amd.com>2016-08-06 14:29:30 +0200
commitb403eb338533894ee012a96bf55653996c92ec7c (patch)
tree8641d50cb06751289431b5b9f2107206edaef5ee /src/gallium/drivers/radeon/r600_pipe_common.c
parent16d568d91166f800dc694510b7c455798bb3b1c0 (diff)
downloadexternal_mesa3d-b403eb338533894ee012a96bf55653996c92ec7c.zip
external_mesa3d-b403eb338533894ee012a96bf55653996c92ec7c.tar.gz
external_mesa3d-b403eb338533894ee012a96bf55653996c92ec7c.tar.bz2
gallium/radeon: count contexts
We don't wanna use unflushed fences when we have multiple contexts. Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Diffstat (limited to 'src/gallium/drivers/radeon/r600_pipe_common.c')
-rw-r--r--src/gallium/drivers/radeon/r600_pipe_common.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/gallium/drivers/radeon/r600_pipe_common.c b/src/gallium/drivers/radeon/r600_pipe_common.c
index 7fd3fe0..5e9d0b6 100644
--- a/src/gallium/drivers/radeon/r600_pipe_common.c
+++ b/src/gallium/drivers/radeon/r600_pipe_common.c
@@ -471,6 +471,7 @@ bool r600_common_context_init(struct r600_common_context *rctx,
rctx->dma.flush = r600_flush_dma_ring;
}
+ p_atomic_inc(&rscreen->num_contexts);
return true;
}
@@ -478,6 +479,8 @@ void r600_common_context_cleanup(struct r600_common_context *rctx)
{
unsigned i,j;
+ p_atomic_dec(&rctx->screen->num_contexts);
+
/* Release DCC stats. */
for (i = 0; i < ARRAY_SIZE(rctx->dcc_stats); i++) {
assert(!rctx->dcc_stats[i].query_active);