radeonsi: use unsynchronized transfers for shader binary uploads
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Tue, 25 Apr 2017 22:36:12 +0000 (00:36 +0200)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Wed, 26 Apr 2017 17:15:22 +0000 (19:15 +0200)
Because the buffer is new, it can't be referenced by any CS.

This can save few CPU cycles by skipping the whole
PIPE_TRANSFER_UNSYNCHRONIZED if in amdgpu_bo_map().

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
src/gallium/drivers/radeonsi/si_shader.c

index 3c2c7f5c75b03f3d3fcf420ff65bab0427145d55..69634b12c33dac36c24e7582f5d9aed561a9af83 100644 (file)
@@ -6185,7 +6185,8 @@ int si_shader_binary_upload(struct si_screen *sscreen, struct si_shader *shader)
 
        /* Upload. */
        ptr = sscreen->b.ws->buffer_map(shader->bo->buf, NULL,
-                                       PIPE_TRANSFER_READ_WRITE);
+                                       PIPE_TRANSFER_READ_WRITE |
+                                       PIPE_TRANSFER_UNSYNCHRONIZED);
 
        if (prolog) {
                util_memcpy_cpu_to_le32(ptr, prolog->code, prolog->code_size);