diff options
author | Marek Olšák <[email protected]> | 2016-07-15 23:17:43 +0200 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2016-08-06 14:29:30 +0200 |
commit | b403eb338533894ee012a96bf55653996c92ec7c (patch) | |
tree | 8641d50cb06751289431b5b9f2107206edaef5ee /src/gallium | |
parent | 16d568d91166f800dc694510b7c455798bb3b1c0 (diff) |
gallium/radeon: count contexts
We don't wanna use unflushed fences when we have multiple contexts.
Reviewed-by: Nicolai Hähnle <[email protected]>
Diffstat (limited to 'src/gallium')
-rw-r--r-- | src/gallium/drivers/radeon/r600_pipe_common.c | 3 | ||||
-rw-r--r-- | src/gallium/drivers/radeon/r600_pipe_common.h | 1 |
2 files changed, 4 insertions, 0 deletions
diff --git a/src/gallium/drivers/radeon/r600_pipe_common.c b/src/gallium/drivers/radeon/r600_pipe_common.c index 7fd3fe08f63..5e9d0b65fc7 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); diff --git a/src/gallium/drivers/radeon/r600_pipe_common.h b/src/gallium/drivers/radeon/r600_pipe_common.h index 91e3cb29928..ccaaeeb2441 100644 --- a/src/gallium/drivers/radeon/r600_pipe_common.h +++ b/src/gallium/drivers/radeon/r600_pipe_common.h @@ -363,6 +363,7 @@ struct r600_common_screen { uint64_t debug_flags; bool has_cp_dma; bool has_streamout; + int num_contexts; /* Texture filter settings. */ int force_aniso; /* -1 = disabled */ |