diff options
author | Marek Olšák <[email protected]> | 2019-09-25 21:38:40 -0400 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2019-10-07 20:05:00 -0400 |
commit | 732ea0b213ce534c2ac05ced8ead2df8fa769efb (patch) | |
tree | f6d7168f59565a5e8d6e5f2e5409ff68d150a5fc /src/gallium/drivers/r600 | |
parent | 59dd4dafb5fea8a76e43d1280650b087809945a1 (diff) |
gallium: add PIPE_RESOURCE_FLAG_SINGLE_THREAD_USE to skip util_range lock
u_upload_mgr sets it, so that util_range_add can skip the lock.
The time spent in tc_transfer_flush_region decreases from 0.8% to 0.2%
in torcs on radeonsi.
Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/gallium/drivers/r600')
-rw-r--r-- | src/gallium/drivers/r600/evergreen_hw_context.c | 4 | ||||
-rw-r--r-- | src/gallium/drivers/r600/evergreen_state.c | 2 | ||||
-rw-r--r-- | src/gallium/drivers/r600/r600_buffer_common.c | 6 | ||||
-rw-r--r-- | src/gallium/drivers/r600/r600_hw_context.c | 4 | ||||
-rw-r--r-- | src/gallium/drivers/r600/r600_streamout.c | 2 |
5 files changed, 9 insertions, 9 deletions
diff --git a/src/gallium/drivers/r600/evergreen_hw_context.c b/src/gallium/drivers/r600/evergreen_hw_context.c index 5e0e27b0f16..da8553886ce 100644 --- a/src/gallium/drivers/r600/evergreen_hw_context.c +++ b/src/gallium/drivers/r600/evergreen_hw_context.c @@ -43,7 +43,7 @@ void evergreen_dma_copy_buffer(struct r600_context *rctx, /* Mark the buffer range of destination as valid (initialized), * so that transfer_map knows it should wait for the GPU when mapping * that range. */ - util_range_add(&rdst->valid_buffer_range, dst_offset, + util_range_add(&rdst->b.b, &rdst->valid_buffer_range, dst_offset, dst_offset + size); dst_offset += rdst->gpu_address; @@ -93,7 +93,7 @@ void evergreen_cp_dma_clear_buffer(struct r600_context *rctx, /* Mark the buffer range of destination as valid (initialized), * so that transfer_map knows it should wait for the GPU when mapping * that range. */ - util_range_add(&r600_resource(dst)->valid_buffer_range, offset, + util_range_add(dst, &r600_resource(dst)->valid_buffer_range, offset, offset + size); offset += r600_resource(dst)->gpu_address; diff --git a/src/gallium/drivers/r600/evergreen_state.c b/src/gallium/drivers/r600/evergreen_state.c index b8315612fdd..ca2ad5e6fbb 100644 --- a/src/gallium/drivers/r600/evergreen_state.c +++ b/src/gallium/drivers/r600/evergreen_state.c @@ -1308,7 +1308,7 @@ void evergreen_init_color_surface_rat(struct r600_context *rctx, surf->cb_color_view = 0; /* Set the buffer range the GPU will have access to: */ - util_range_add(&r600_resource(pipe_buffer)->valid_buffer_range, + util_range_add(pipe_buffer, &r600_resource(pipe_buffer)->valid_buffer_range, 0, pipe_buffer->width0); } diff --git a/src/gallium/drivers/r600/r600_buffer_common.c b/src/gallium/drivers/r600/r600_buffer_common.c index 04f80daec1d..d0f44dcb662 100644 --- a/src/gallium/drivers/r600/r600_buffer_common.c +++ b/src/gallium/drivers/r600/r600_buffer_common.c @@ -498,7 +498,7 @@ static void r600_buffer_do_flush_region(struct pipe_context *ctx, ctx->resource_copy_region(ctx, dst, 0, box->x, 0, 0, src, 0, &dma_box); } - util_range_add(&rbuffer->valid_buffer_range, box->x, + util_range_add(&rbuffer->b.b, &rbuffer->valid_buffer_range, box->x, box->x + box->width); } @@ -643,8 +643,8 @@ r600_buffer_from_user_memory(struct pipe_screen *screen, rbuffer->domains = RADEON_DOMAIN_GTT; rbuffer->flags = 0; rbuffer->b.is_user_ptr = true; - util_range_add(&rbuffer->valid_buffer_range, 0, templ->width0); - util_range_add(&rbuffer->b.valid_buffer_range, 0, templ->width0); + util_range_add(&rbuffer->b.b, &rbuffer->valid_buffer_range, 0, templ->width0); + util_range_add(&rbuffer->b.b, &rbuffer->b.valid_buffer_range, 0, templ->width0); /* Convert a user pointer to a buffer. */ rbuffer->buf = ws->buffer_from_ptr(ws, user_memory, templ->width0); diff --git a/src/gallium/drivers/r600/r600_hw_context.c b/src/gallium/drivers/r600/r600_hw_context.c index abf5d03e4f9..494b7ed69eb 100644 --- a/src/gallium/drivers/r600/r600_hw_context.c +++ b/src/gallium/drivers/r600/r600_hw_context.c @@ -510,7 +510,7 @@ void r600_cp_dma_copy_buffer(struct r600_context *rctx, /* Mark the buffer range of destination as valid (initialized), * so that transfer_map knows it should wait for the GPU when mapping * that range. */ - util_range_add(&r600_resource(dst)->valid_buffer_range, dst_offset, + util_range_add(dst, &r600_resource(dst)->valid_buffer_range, dst_offset, dst_offset + size); dst_offset += r600_resource(dst)->gpu_address; @@ -592,7 +592,7 @@ void r600_dma_copy_buffer(struct r600_context *rctx, /* Mark the buffer range of destination as valid (initialized), * so that transfer_map knows it should wait for the GPU when mapping * that range. */ - util_range_add(&rdst->valid_buffer_range, dst_offset, + util_range_add(&rdst->b.b, &rdst->valid_buffer_range, dst_offset, dst_offset + size); size >>= 2; /* convert to dwords */ diff --git a/src/gallium/drivers/r600/r600_streamout.c b/src/gallium/drivers/r600/r600_streamout.c index de3e767acc0..f925c07b26d 100644 --- a/src/gallium/drivers/r600/r600_streamout.c +++ b/src/gallium/drivers/r600/r600_streamout.c @@ -65,7 +65,7 @@ r600_create_so_target(struct pipe_context *ctx, t->b.buffer_offset = buffer_offset; t->b.buffer_size = buffer_size; - util_range_add(&rbuffer->valid_buffer_range, buffer_offset, + util_range_add(buffer, &rbuffer->valid_buffer_range, buffer_offset, buffer_offset + buffer_size); return &t->b; } |