radv: add radv_emit_prefetch_TC_L2_async() helper
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Wed, 8 Nov 2017 11:12:30 +0000 (12:12 +0100)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Mon, 13 Nov 2017 10:03:13 +0000 (11:03 +0100)
Will be used for VBO descriptors prefetching.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
src/amd/vulkan/radv_cmd_buffer.c

index 3bf2d4a8b933c97668c77b51eb573b272224a015..1d552e265aebad5ca8c853adbd11bd3002af303e 100644 (file)
@@ -660,6 +660,14 @@ radv_emit_graphics_raster_state(struct radv_cmd_buffer *cmd_buffer,
                               raster->pa_su_sc_mode_cntl);
 }
 
+static inline void
+radv_emit_prefetch_TC_L2_async(struct radv_cmd_buffer *cmd_buffer, uint64_t va,
+                              unsigned size)
+{
+       if (cmd_buffer->device->physical_device->rad_info.chip_class >= CIK)
+               si_cp_dma_prefetch(cmd_buffer, va, size);
+}
+
 static void
 radv_emit_shader_prefetch(struct radv_cmd_buffer *cmd_buffer,
                          struct radv_shader_variant *shader)
@@ -674,8 +682,7 @@ radv_emit_shader_prefetch(struct radv_cmd_buffer *cmd_buffer,
        va = radv_buffer_get_va(shader->bo) + shader->bo_offset;
 
        radv_cs_add_buffer(ws, cs, shader->bo, 8);
-       if (cmd_buffer->device->physical_device->rad_info.chip_class >= CIK)
-               si_cp_dma_prefetch(cmd_buffer, va, shader->code_size);
+       radv_emit_prefetch_TC_L2_async(cmd_buffer, va, shader->code_size);
 }
 
 static void