diff options
Diffstat (limited to 'src/gallium/drivers/nouveau/nvc0/nvc0_query_hw_sm.c')
-rw-r--r-- | src/gallium/drivers/nouveau/nvc0/nvc0_query_hw_sm.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_query_hw_sm.c b/src/gallium/drivers/nouveau/nvc0/nvc0_query_hw_sm.c index d472120..982042e 100644 --- a/src/gallium/drivers/nouveau/nvc0/nvc0_query_hw_sm.c +++ b/src/gallium/drivers/nouveau/nvc0/nvc0_query_hw_sm.c @@ -1662,6 +1662,7 @@ nve4_hw_sm_begin_query(struct nvc0_context *nvc0, struct nvc0_hw_query *hq) return false; } + pipe_mutex_lock(screen->base.push_mutex); assert(cfg->num_counters <= 4); PUSH_SPACE(push, 4 * 8 * + 6); @@ -1710,6 +1711,7 @@ nve4_hw_sm_begin_query(struct nvc0_context *nvc0, struct nvc0_hw_query *hq) BEGIN_NVC0(push, NVE4_CP(MP_PM_SET(c)), 1); PUSH_DATA (push, 0); } + pipe_mutex_unlock(screen->base.push_mutex); return true; } @@ -1733,6 +1735,7 @@ nvc0_hw_sm_begin_query(struct nvc0_context *nvc0, struct nvc0_hw_query *hq) return false; } + pipe_mutex_lock(screen->base.push_mutex); assert(cfg->num_counters <= 8); PUSH_SPACE(push, 8 * 8 + 2); @@ -1779,6 +1782,7 @@ nvc0_hw_sm_begin_query(struct nvc0_context *nvc0, struct nvc0_hw_query *hq) BEGIN_NVC0(push, NVC0_CP(MP_PM_SET(c)), 1); PUSH_DATA (push, 0); } + pipe_mutex_unlock(screen->base.push_mutex); return true; } @@ -1866,6 +1870,7 @@ nvc0_hw_sm_end_query(struct nvc0_context *nvc0, struct nvc0_hw_query *hq) if (unlikely(!screen->pm.prog)) screen->pm.prog = nvc0_hw_sm_get_program(screen); + pipe_mutex_lock(screen->base.push_mutex); /* disable all counting */ PUSH_SPACE(push, 8); for (c = 0; c < 8; ++c) @@ -1893,6 +1898,7 @@ nvc0_hw_sm_end_query(struct nvc0_context *nvc0, struct nvc0_hw_query *hq) /* upload input data for the compute shader which reads MP counters */ nvc0_hw_sm_upload_input(nvc0, hq); + pipe_mutex_unlock(screen->base.push_mutex); pipe->bind_compute_state(pipe, screen->pm.prog); for (i = 0; i < 3; i++) { @@ -1906,6 +1912,7 @@ nvc0_hw_sm_end_query(struct nvc0_context *nvc0, struct nvc0_hw_query *hq) nouveau_bufctx_reset(nvc0->bufctx_cp, NVC0_BIND_CP_QUERY); + pipe_mutex_lock(screen->base.push_mutex); /* re-activate other counters */ PUSH_SPACE(push, 16); mask = 0; @@ -1930,6 +1937,7 @@ nvc0_hw_sm_end_query(struct nvc0_context *nvc0, struct nvc0_hw_query *hq) PUSH_DATA (push, (cfg->ctr[i].func << 4) | cfg->ctr[i].mode); } } + pipe_mutex_unlock(screen->base.push_mutex); } static inline bool |