From e1ab834557473d0d53d6122c3043a81d97475438 Mon Sep 17 00:00:00 2001 From: Jason Ekstrand Date: Mon, 10 Sep 2018 16:43:34 -0500 Subject: anv/memcpy: Use addresses instead of bo+offset Reviewed-by: Eric Engestrom --- src/intel/vulkan/genX_cmd_buffer.c | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) (limited to 'src/intel/vulkan/genX_cmd_buffer.c') diff --git a/src/intel/vulkan/genX_cmd_buffer.c b/src/intel/vulkan/genX_cmd_buffer.c index 80bebf5a12c..933566e91e7 100644 --- a/src/intel/vulkan/genX_cmd_buffer.c +++ b/src/intel/vulkan/genX_cmd_buffer.c @@ -872,20 +872,21 @@ genX(copy_fast_clear_dwords)(struct anv_cmd_buffer *cmd_buffer, assert(cmd_buffer && image); assert(image->aspects & VK_IMAGE_ASPECT_ANY_COLOR_BIT_ANV); - struct anv_bo *ss_bo = - &cmd_buffer->device->surface_state_pool.block_pool.bo; - uint32_t ss_clear_offset = surface_state.offset + - cmd_buffer->device->isl_dev.ss.clear_value_offset; + struct anv_address ss_clear_addr = { + .bo = &cmd_buffer->device->surface_state_pool.block_pool.bo, + .offset = surface_state.offset + + cmd_buffer->device->isl_dev.ss.clear_value_offset, + }; const struct anv_address entry_addr = anv_image_get_clear_color_addr(cmd_buffer->device, image, aspect); unsigned copy_size = cmd_buffer->device->isl_dev.ss.clear_value_size; if (copy_from_surface_state) { - genX(cmd_buffer_mi_memcpy)(cmd_buffer, entry_addr.bo, entry_addr.offset, - ss_bo, ss_clear_offset, copy_size); + genX(cmd_buffer_mi_memcpy)(cmd_buffer, entry_addr, + ss_clear_addr, copy_size); } else { - genX(cmd_buffer_mi_memcpy)(cmd_buffer, ss_bo, ss_clear_offset, - entry_addr.bo, entry_addr.offset, copy_size); + genX(cmd_buffer_mi_memcpy)(cmd_buffer, ss_clear_addr, + entry_addr, copy_size); /* Updating a surface state object may require that the state cache be * invalidated. From the SKL PRM, Shared Functions -> State -> State @@ -1501,8 +1502,15 @@ genX(CmdExecuteCommands)( struct anv_state dst_state = secondary->state.render_pass_states; assert(src_state.alloc_size == dst_state.alloc_size); - genX(cmd_buffer_so_memcpy)(primary, ss_bo, dst_state.offset, - ss_bo, src_state.offset, + genX(cmd_buffer_so_memcpy)(primary, + (struct anv_address) { + .bo = ss_bo, + .offset = dst_state.offset, + }, + (struct anv_address) { + .bo = ss_bo, + .offset = src_state.offset, + }, src_state.alloc_size); } -- cgit v1.2.3