diff --git a/src/gallium/drivers/radeonsi/gfx10_query.c b/src/gallium/drivers/radeonsi/gfx10_query.c index f31d4ed03a7..a8ba299aca1 100644 --- a/src/gallium/drivers/radeonsi/gfx10_query.c +++ b/src/gallium/drivers/radeonsi/gfx10_query.c @@ -79,7 +79,7 @@ static bool gfx10_alloc_query_buffer(struct si_context *sctx) qbuf = list_first_entry(&sctx->shader_query_buffers, struct gfx10_sh_query_buffer, list); if (!qbuf->refcount && - !si_rings_is_buffer_referenced(sctx, qbuf->buf->buf, RADEON_USAGE_READWRITE) && + !si_cs_is_buffer_referenced(sctx, qbuf->buf->buf, RADEON_USAGE_READWRITE) && sctx->ws->buffer_wait(qbuf->buf->buf, 0, RADEON_USAGE_READWRITE)) { /* Can immediately re-use the oldest buffer */ list_del(&qbuf->list); @@ -251,7 +251,7 @@ static bool gfx10_sh_query_get_result(struct si_context *sctx, struct si_query * if (rquery->b.flushed) map = sctx->ws->buffer_map(qbuf->buf->buf, NULL, usage); else - map = si_buffer_map_sync_with_rings(sctx, qbuf->buf, usage); + map = si_buffer_map(sctx, qbuf->buf, usage); if (!map) return false; diff --git a/src/gallium/drivers/radeonsi/si_buffer.c b/src/gallium/drivers/radeonsi/si_buffer.c index 6ac94e33dda..7c800e19098 100644 --- a/src/gallium/drivers/radeonsi/si_buffer.c +++ b/src/gallium/drivers/radeonsi/si_buffer.c @@ -30,8 +30,8 @@ #include #include -bool si_rings_is_buffer_referenced(struct si_context *sctx, struct pb_buffer *buf, - enum radeon_bo_usage usage) +bool si_cs_is_buffer_referenced(struct si_context *sctx, struct pb_buffer *buf, + enum radeon_bo_usage usage) { if (sctx->ws->cs_is_buffer_referenced(&sctx->gfx_cs, buf, usage)) { return true; @@ -43,8 +43,8 @@ bool si_rings_is_buffer_referenced(struct si_context *sctx, struct pb_buffer *bu return false; } -void *si_buffer_map_sync_with_rings(struct si_context *sctx, struct si_resource *resource, - unsigned usage) +void *si_buffer_map(struct si_context *sctx, struct si_resource *resource, + unsigned usage) { enum radeon_bo_usage rusage = RADEON_USAGE_READWRITE; bool busy = false; @@ -300,7 +300,7 @@ static bool si_invalidate_buffer(struct si_context *sctx, struct si_resource *bu return false; /* Check if mapping this buffer would cause waiting for the GPU. */ - if (si_rings_is_buffer_referenced(sctx, buf->buf, RADEON_USAGE_READWRITE) || + if (si_cs_is_buffer_referenced(sctx, buf->buf, RADEON_USAGE_READWRITE) || !sctx->ws->buffer_wait(buf->buf, 0, RADEON_USAGE_READWRITE)) { /* Reallocate the buffer in the same pipe_resource. */ si_alloc_resource(sctx->screen, buf); @@ -457,7 +457,7 @@ static void *si_buffer_transfer_map(struct pipe_context *ctx, struct pipe_resour /* Check if mapping this buffer would cause waiting for the GPU. */ if (buf->flags & RADEON_FLAG_SPARSE || force_discard_range || - si_rings_is_buffer_referenced(sctx, buf->buf, RADEON_USAGE_READWRITE) || + si_cs_is_buffer_referenced(sctx, buf->buf, RADEON_USAGE_READWRITE) || !sctx->ws->buffer_wait(buf->buf, 0, RADEON_USAGE_READWRITE)) { /* Do a wait-free write-only transfer using a temporary buffer. */ struct u_upload_mgr *uploader; @@ -505,7 +505,7 @@ static void *si_buffer_transfer_map(struct pipe_context *ctx, struct pipe_resour si_sdma_copy_buffer(sctx, &staging->b.b, resource, box->x % SI_MAP_BUFFER_ALIGNMENT, box->x, box->width); - data = si_buffer_map_sync_with_rings(sctx, staging, usage & ~PIPE_MAP_UNSYNCHRONIZED); + data = si_buffer_map(sctx, staging, usage & ~PIPE_MAP_UNSYNCHRONIZED); if (!data) { si_resource_reference(&staging, NULL); return NULL; @@ -518,7 +518,7 @@ static void *si_buffer_transfer_map(struct pipe_context *ctx, struct pipe_resour } } - data = si_buffer_map_sync_with_rings(sctx, buf, usage); + data = si_buffer_map(sctx, buf, usage); if (!data) { return NULL; } diff --git a/src/gallium/drivers/radeonsi/si_perfcounter.c b/src/gallium/drivers/radeonsi/si_perfcounter.c index a1b516f48d8..1f2605ee648 100644 --- a/src/gallium/drivers/radeonsi/si_perfcounter.c +++ b/src/gallium/drivers/radeonsi/si_perfcounter.c @@ -1060,7 +1060,7 @@ static bool si_pc_query_get_result(struct si_context *sctx, struct si_query *squ if (squery->b.flushed) map = sctx->ws->buffer_map(qbuf->buf->buf, NULL, usage); else - map = si_buffer_map_sync_with_rings(sctx, qbuf->buf, usage); + map = si_buffer_map(sctx, qbuf->buf, usage); if (!map) return false; diff --git a/src/gallium/drivers/radeonsi/si_pipe.h b/src/gallium/drivers/radeonsi/si_pipe.h index 7eb286bfa6e..0cebbb596b2 100644 --- a/src/gallium/drivers/radeonsi/si_pipe.h +++ b/src/gallium/drivers/radeonsi/si_pipe.h @@ -1320,10 +1320,10 @@ void si_decompress_dcc(struct si_context *sctx, struct si_texture *tex); void si_flush_implicit_resources(struct si_context *sctx); /* si_buffer.c */ -bool si_rings_is_buffer_referenced(struct si_context *sctx, struct pb_buffer *buf, - enum radeon_bo_usage usage); -void *si_buffer_map_sync_with_rings(struct si_context *sctx, struct si_resource *resource, - unsigned usage); +bool si_cs_is_buffer_referenced(struct si_context *sctx, struct pb_buffer *buf, + enum radeon_bo_usage usage); +void *si_buffer_map(struct si_context *sctx, struct si_resource *resource, + unsigned usage); void si_init_resource_fields(struct si_screen *sscreen, struct si_resource *res, uint64_t size, unsigned alignment); bool si_alloc_resource(struct si_screen *sscreen, struct si_resource *res); diff --git a/src/gallium/drivers/radeonsi/si_query.c b/src/gallium/drivers/radeonsi/si_query.c index d3450310b18..6f4d651fe7c 100644 --- a/src/gallium/drivers/radeonsi/si_query.c +++ b/src/gallium/drivers/radeonsi/si_query.c @@ -607,7 +607,7 @@ void si_query_buffer_reset(struct si_context *sctx, struct si_query_buffer *buff return; /* Discard even the oldest buffer if it can't be mapped without a stall. */ - if (si_rings_is_buffer_referenced(sctx, buffer->buf->buf, RADEON_USAGE_READWRITE) || + if (si_cs_is_buffer_referenced(sctx, buffer->buf->buf, RADEON_USAGE_READWRITE) || !sctx->ws->buffer_wait(buffer->buf->buf, 0, RADEON_USAGE_READWRITE)) { si_resource_reference(&buffer->buf, NULL); } else { @@ -1462,7 +1462,7 @@ bool si_query_hw_get_result(struct si_context *sctx, struct si_query *squery, bo if (squery->b.flushed) map = sctx->ws->buffer_map(qbuf->buf->buf, NULL, usage); else - map = si_buffer_map_sync_with_rings(sctx, qbuf->buf, usage); + map = si_buffer_map(sctx, qbuf->buf, usage); if (!map) return false; diff --git a/src/gallium/drivers/radeonsi/si_texture.c b/src/gallium/drivers/radeonsi/si_texture.c index 9656b826d96..c77f4e28d45 100644 --- a/src/gallium/drivers/radeonsi/si_texture.c +++ b/src/gallium/drivers/radeonsi/si_texture.c @@ -1877,7 +1877,7 @@ static void *si_texture_transfer_map(struct pipe_context *ctx, struct pipe_resou use_staging_texture = tex->buffer.domains & RADEON_DOMAIN_VRAM || tex->buffer.flags & RADEON_FLAG_GTT_WC; /* Write & linear only: */ - else if (si_rings_is_buffer_referenced(sctx, tex->buffer.buf, RADEON_USAGE_READWRITE) || + else if (si_cs_is_buffer_referenced(sctx, tex->buffer.buf, RADEON_USAGE_READWRITE) || !sctx->ws->buffer_wait(tex->buffer.buf, 0, RADEON_USAGE_READWRITE)) { /* It's busy. */ if (si_can_invalidate_texture(sctx->screen, tex, usage, box)) @@ -1955,7 +1955,7 @@ static void *si_texture_transfer_map(struct pipe_context *ctx, struct pipe_resou if (sizeof(void *) == 4) usage |= RADEON_MAP_TEMPORARY; - if (!(map = si_buffer_map_sync_with_rings(sctx, buf, usage))) + if (!(map = si_buffer_map(sctx, buf, usage))) goto fail_trans; *ptransfer = &trans->b.b;