diff options
author | Marek Olšák <[email protected]> | 2017-01-17 20:10:15 +0100 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2017-01-18 19:51:31 +0100 |
commit | 4bde7d3d3c90e3930e56b83f8e517d6ce6ea26d4 (patch) | |
tree | 56e29d9ceffa045f8edebcaffbb9ee1be7d3eb1b /src/gallium/drivers/radeonsi/si_cp_dma.c | |
parent | d93b0eacb7ea1596331e31826a6bd749b97b96b0 (diff) |
radeonsi: skip an unnecessary mutex lock for L2 prefetches
the mutex lock is inside util_range_add.
Reviewed-by: Nicolai Hähnle <[email protected]>
Diffstat (limited to 'src/gallium/drivers/radeonsi/si_cp_dma.c')
-rw-r--r-- | src/gallium/drivers/radeonsi/si_cp_dma.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/gallium/drivers/radeonsi/si_cp_dma.c b/src/gallium/drivers/radeonsi/si_cp_dma.c index 06e4899a887..582e5995164 100644 --- a/src/gallium/drivers/radeonsi/si_cp_dma.c +++ b/src/gallium/drivers/radeonsi/si_cp_dma.c @@ -315,11 +315,13 @@ void si_copy_buffer(struct si_context *sctx, if (!size) return; - /* 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, - dst_offset + size); + if (dst != src || dst_offset != src_offset) { + /* 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, + dst_offset + size); + } dst_offset += r600_resource(dst)->gpu_address; src_offset += r600_resource(src)->gpu_address; |