From: Jason Ekstrand Date: Mon, 20 Feb 2017 18:28:27 +0000 (-0800) Subject: anv: Rename clflush_range and state_clflush X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=f9d7d27d6dc46696c0c8479a3180c57774991129;p=mesa.git anv: Rename clflush_range and state_clflush It's a bit shorter and easier to work with. Also, we're about to add a helper called clflush which does the clflush but without any memory fencing. Reviewed-by: Lionel Landwerlin --- diff --git a/src/intel/vulkan/anv_batch_chain.c b/src/intel/vulkan/anv_batch_chain.c index f5859460664..3f6039e816b 100644 --- a/src/intel/vulkan/anv_batch_chain.c +++ b/src/intel/vulkan/anv_batch_chain.c @@ -1063,7 +1063,7 @@ write_reloc(const struct anv_device *device, void *p, uint64_t v, bool flush) } if (flush && !device->info.has_llc) - anv_clflush_range(p, reloc_size); + anv_flush_range(p, reloc_size); } static void diff --git a/src/intel/vulkan/anv_cmd_buffer.c b/src/intel/vulkan/anv_cmd_buffer.c index 8c08f8d48e6..e82cfd298cb 100644 --- a/src/intel/vulkan/anv_cmd_buffer.c +++ b/src/intel/vulkan/anv_cmd_buffer.c @@ -588,7 +588,7 @@ anv_cmd_buffer_emit_dynamic(struct anv_cmd_buffer *cmd_buffer, memcpy(state.map, data, size); if (!cmd_buffer->device->info.has_llc) - anv_state_clflush(state); + anv_state_flush(state); VG(VALGRIND_CHECK_MEM_IS_DEFINED(state.map, size)); @@ -610,7 +610,7 @@ anv_cmd_buffer_merge_dynamic(struct anv_cmd_buffer *cmd_buffer, p[i] = a[i] | b[i]; if (!cmd_buffer->device->info.has_llc) - anv_state_clflush(state); + anv_state_flush(state); VG(VALGRIND_CHECK_MEM_IS_DEFINED(p, dwords * 4)); @@ -647,7 +647,7 @@ anv_cmd_buffer_push_constants(struct anv_cmd_buffer *cmd_buffer, } if (!cmd_buffer->device->info.has_llc) - anv_state_clflush(state); + anv_state_flush(state); return state; } @@ -707,7 +707,7 @@ anv_cmd_buffer_cs_push_constants(struct anv_cmd_buffer *cmd_buffer) } if (!cmd_buffer->device->info.has_llc) - anv_state_clflush(state); + anv_state_flush(state); return state; } diff --git a/src/intel/vulkan/anv_device.c b/src/intel/vulkan/anv_device.c index 2ba827cc380..f14c1abc795 100644 --- a/src/intel/vulkan/anv_device.c +++ b/src/intel/vulkan/anv_device.c @@ -862,7 +862,7 @@ anv_state_pool_emit_data(struct anv_state_pool *pool, size_t size, size_t align, memcpy(state.map, p, size); if (!pool->block_pool->device->info.has_llc) - anv_state_clflush(state); + anv_state_flush(state); return state; } @@ -913,7 +913,7 @@ anv_device_submit_simple_batch(struct anv_device *device, memcpy(bo.map, batch->start, size); if (!device->info.has_llc) - anv_clflush_range(bo.map, size); + anv_flush_range(bo.map, size); exec_bos[0] = &bo; exec2_objects[0].handle = bo.gem_handle; @@ -2063,7 +2063,7 @@ anv_fill_buffer_surface_state(struct anv_device *device, struct anv_state state, .stride = stride); if (!device->info.has_llc) - anv_state_clflush(state); + anv_state_flush(state); } void anv_DestroySampler( diff --git a/src/intel/vulkan/anv_image.c b/src/intel/vulkan/anv_image.c index cf4304a0cc3..c0142c80c4d 100644 --- a/src/intel/vulkan/anv_image.c +++ b/src/intel/vulkan/anv_image.c @@ -575,7 +575,7 @@ anv_CreateImageView(VkDevice _device, .mocs = device->default_mocs); if (!device->info.has_llc) - anv_state_clflush(iview->sampler_surface_state); + anv_state_flush(iview->sampler_surface_state); } else { iview->sampler_surface_state.alloc_size = 0; } @@ -627,8 +627,8 @@ anv_CreateImageView(VkDevice _device, &surface->isl, &iview->isl); if (!device->info.has_llc) { - anv_state_clflush(iview->storage_surface_state); - anv_state_clflush(iview->writeonly_storage_surface_state); + anv_state_flush(iview->storage_surface_state); + anv_state_flush(iview->writeonly_storage_surface_state); } } else { iview->storage_surface_state.alloc_size = 0; diff --git a/src/intel/vulkan/anv_private.h b/src/intel/vulkan/anv_private.h index c36fdcf75b4..fa114b9967a 100644 --- a/src/intel/vulkan/anv_private.h +++ b/src/intel/vulkan/anv_private.h @@ -436,7 +436,7 @@ struct anv_state_stream { #define CACHELINE_MASK 63 static inline void -anv_clflush_range(void *start, size_t size) +anv_flush_range(void *start, size_t size) { void *p = (void *) (((uintptr_t) start) & ~CACHELINE_MASK); void *end = start + size; @@ -462,9 +462,9 @@ anv_invalidate_range(void *start, size_t size) } static void inline -anv_state_clflush(struct anv_state state) +anv_state_flush(struct anv_state state) { - anv_clflush_range(state.map, state.alloc_size); + anv_flush_range(state.map, state.alloc_size); } VkResult anv_block_pool_init(struct anv_block_pool *pool, diff --git a/src/intel/vulkan/gen7_cmd_buffer.c b/src/intel/vulkan/gen7_cmd_buffer.c index c1a25e8ce26..3f7376c9a7d 100644 --- a/src/intel/vulkan/gen7_cmd_buffer.c +++ b/src/intel/vulkan/gen7_cmd_buffer.c @@ -91,7 +91,7 @@ gen7_cmd_buffer_emit_scissor(struct anv_cmd_buffer *cmd_buffer) } if (!cmd_buffer->device->info.has_llc) - anv_state_clflush(scissor_state); + anv_state_flush(scissor_state); } #endif @@ -192,7 +192,7 @@ genX(cmd_buffer_flush_dynamic_state)(struct anv_cmd_buffer *cmd_buffer) }; GENX(COLOR_CALC_STATE_pack)(NULL, cc_state.map, &cc); if (!cmd_buffer->device->info.has_llc) - anv_state_clflush(cc_state); + anv_state_flush(cc_state); anv_batch_emit(&cmd_buffer->batch, GENX(3DSTATE_CC_STATE_POINTERS), ccp) { ccp.ColorCalcStatePointer = cc_state.offset; diff --git a/src/intel/vulkan/gen8_cmd_buffer.c b/src/intel/vulkan/gen8_cmd_buffer.c index 59fd537219b..7c9bfd01cff 100644 --- a/src/intel/vulkan/gen8_cmd_buffer.c +++ b/src/intel/vulkan/gen8_cmd_buffer.c @@ -68,7 +68,7 @@ gen8_cmd_buffer_emit_viewport(struct anv_cmd_buffer *cmd_buffer) } if (!cmd_buffer->device->info.has_llc) - anv_state_clflush(sf_clip_state); + anv_state_flush(sf_clip_state); anv_batch_emit(&cmd_buffer->batch, GENX(3DSTATE_VIEWPORT_STATE_POINTERS_SF_CLIP), clip) { @@ -97,7 +97,7 @@ gen8_cmd_buffer_emit_depth_viewport(struct anv_cmd_buffer *cmd_buffer, } if (!cmd_buffer->device->info.has_llc) - anv_state_clflush(cc_state); + anv_state_flush(cc_state); anv_batch_emit(&cmd_buffer->batch, GENX(3DSTATE_VIEWPORT_STATE_POINTERS_CC), cc) { @@ -474,7 +474,7 @@ genX(cmd_buffer_flush_dynamic_state)(struct anv_cmd_buffer *cmd_buffer) GENX(COLOR_CALC_STATE_pack)(NULL, cc_state.map, &cc); if (!cmd_buffer->device->info.has_llc) - anv_state_clflush(cc_state); + anv_state_flush(cc_state); anv_batch_emit(&cmd_buffer->batch, GENX(3DSTATE_CC_STATE_POINTERS), ccp) { ccp.ColorCalcStatePointer = cc_state.offset; @@ -526,7 +526,7 @@ genX(cmd_buffer_flush_dynamic_state)(struct anv_cmd_buffer *cmd_buffer) GEN9_COLOR_CALC_STATE_pack(NULL, cc_state.map, &cc); if (!cmd_buffer->device->info.has_llc) - anv_state_clflush(cc_state); + anv_state_flush(cc_state); anv_batch_emit(&cmd_buffer->batch, GEN9_3DSTATE_CC_STATE_POINTERS, ccp) { ccp.ColorCalcStatePointer = cc_state.offset; diff --git a/src/intel/vulkan/genX_blorp_exec.c b/src/intel/vulkan/genX_blorp_exec.c index 139c3872168..b617e781573 100644 --- a/src/intel/vulkan/genX_blorp_exec.c +++ b/src/intel/vulkan/genX_blorp_exec.c @@ -102,7 +102,7 @@ blorp_alloc_binding_table(struct blorp_batch *batch, unsigned num_entries, } if (!cmd_buffer->device->info.has_llc) - anv_state_clflush(bt_state); + anv_state_flush(bt_state); } static void * @@ -126,7 +126,7 @@ blorp_flush_range(struct blorp_batch *batch, void *start, size_t size) { struct anv_device *device = batch->blorp->driver_ctx; if (!device->info.has_llc) - anv_clflush_range(start, size); + anv_flush_range(start, size); } static void diff --git a/src/intel/vulkan/genX_cmd_buffer.c b/src/intel/vulkan/genX_cmd_buffer.c index f45b714dfb2..ebf54fd9f18 100644 --- a/src/intel/vulkan/genX_cmd_buffer.c +++ b/src/intel/vulkan/genX_cmd_buffer.c @@ -580,7 +580,7 @@ genX(cmd_buffer_setup_attachments)(struct anv_cmd_buffer *cmd_buffer, } if (!cmd_buffer->device->info.has_llc) - anv_state_clflush(state->render_pass_states); + anv_state_flush(state->render_pass_states); } } @@ -1276,7 +1276,7 @@ emit_binding_table(struct anv_cmd_buffer *cmd_buffer, out: if (!cmd_buffer->device->info.has_llc) - anv_state_clflush(*bt_state); + anv_state_flush(*bt_state); return VK_SUCCESS; } @@ -1334,7 +1334,7 @@ emit_samplers(struct anv_cmd_buffer *cmd_buffer, } if (!cmd_buffer->device->info.has_llc) - anv_state_clflush(*state); + anv_state_flush(*state); return VK_SUCCESS; } @@ -1653,7 +1653,7 @@ emit_base_vertex_instance(struct anv_cmd_buffer *cmd_buffer, ((uint32_t *)id_state.map)[1] = base_instance; if (!cmd_buffer->device->info.has_llc) - anv_state_clflush(id_state); + anv_state_flush(id_state); emit_base_vertex_instance_bo(cmd_buffer, &cmd_buffer->device->dynamic_state_block_pool.bo, id_state.offset); @@ -1668,7 +1668,7 @@ emit_draw_index(struct anv_cmd_buffer *cmd_buffer, uint32_t draw_index) ((uint32_t *)state.map)[0] = draw_index; if (!cmd_buffer->device->info.has_llc) - anv_state_clflush(state); + anv_state_flush(state); emit_vertex_bo(cmd_buffer, &cmd_buffer->device->dynamic_state_block_pool.bo, @@ -1947,7 +1947,7 @@ void genX(CmdDispatch)( sizes[1] = y; sizes[2] = z; if (!cmd_buffer->device->info.has_llc) - anv_state_clflush(state); + anv_state_flush(state); cmd_buffer->state.num_workgroups_offset = state.offset; cmd_buffer->state.num_workgroups_bo = &cmd_buffer->device->dynamic_state_block_pool.bo; diff --git a/src/intel/vulkan/genX_pipeline.c b/src/intel/vulkan/genX_pipeline.c index a9396da48ac..e461e6e3563 100644 --- a/src/intel/vulkan/genX_pipeline.c +++ b/src/intel/vulkan/genX_pipeline.c @@ -977,7 +977,7 @@ emit_cb_state(struct anv_pipeline *pipeline, GENX(BLEND_STATE_pack)(NULL, pipeline->blend_state.map, &blend_state); if (!device->info.has_llc) - anv_state_clflush(pipeline->blend_state); + anv_state_flush(pipeline->blend_state); anv_batch_emit(&pipeline->batch, GENX(3DSTATE_BLEND_STATE_POINTERS), bsp) { bsp.BlendStatePointer = pipeline->blend_state.offset;