anv: Rename clflush_range and state_clflush
authorJason Ekstrand <jason.ekstrand@intel.com>
Mon, 20 Feb 2017 18:28:27 +0000 (10:28 -0800)
committerJason Ekstrand <jason.ekstrand@intel.com>
Tue, 21 Feb 2017 20:26:35 +0000 (12:26 -0800)
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 <lionel.g.landwerlin@intel.com>
src/intel/vulkan/anv_batch_chain.c
src/intel/vulkan/anv_cmd_buffer.c
src/intel/vulkan/anv_device.c
src/intel/vulkan/anv_image.c
src/intel/vulkan/anv_private.h
src/intel/vulkan/gen7_cmd_buffer.c
src/intel/vulkan/gen8_cmd_buffer.c
src/intel/vulkan/genX_blorp_exec.c
src/intel/vulkan/genX_cmd_buffer.c
src/intel/vulkan/genX_pipeline.c

index f5859460664091659fdbac9d4109e59c71141fc7..3f6039e816bc1e31421c9ad66bfb26f7fd62f126 100644 (file)
@@ -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
index 8c08f8d48e6ec79dc86c233676ccb07e9e647d2e..e82cfd298cb7a9fdfbfa7a885eaa26235c03d4b0 100644 (file)
@@ -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;
 }
index 2ba827cc3800b92c99dc9cfbfbf839708510308f..f14c1abc795f50788a1fe7ca85da73887c9a0fe5 100644 (file)
@@ -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(
index cf4304a0cc3b2b7bf9b1694b30857a021331d5d7..c0142c80c4deee109e591b059d187487e416a79e 100644 (file)
@@ -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;
index c36fdcf75b4d1bd2c73afd007eace8aa0827f57b..fa114b9967a1aec68937376b6976a2257ef2085f 100644 (file)
@@ -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,
index c1a25e8ce2608ecba3a32a8a0b159d14ad2f1ccf..3f7376c9a7dae8aa601ad5bb8d21cedb1f12b7e2 100644 (file)
@@ -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;
index 59fd537219bc576ffebf8092fe574d466958294f..7c9bfd01cffb4db0169ffa3907ad85a922081202 100644 (file)
@@ -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;
index 139c387216845913afd833276ee3162c70493096..b617e781573f856944365ed491544a8f34c9cb0f 100644 (file)
@@ -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
index f45b714dfb2f3d941b28d41d222c1a5820a567fb..ebf54fd9f1802748aef49c1c3d3c3d513bd10156 100644 (file)
@@ -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;
index a9396da48acbf8f67fd4cfdbec5c5391bffae052..e461e6e35636b6d89e9c1904cd871bcdd2dd41df 100644 (file)
@@ -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;