[Mesa-dev] [RFC PATCH 10/14] anv: Add clflush to states.

Rafael Antognolli rafael.antognolli at intel.com
Sat Dec 8 00:05:49 UTC 2018


TODO: This is just flushing the entire dynamic states on every execbuf.
Maybe it's too much. However, in theory we should be already flushing
the states as needed, but I think we didn't hit any bug due to the
coherence implied by userptr.
---
 src/intel/vulkan/anv_batch_chain.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/intel/vulkan/anv_batch_chain.c b/src/intel/vulkan/anv_batch_chain.c
index 65df28ccb91..99009679435 100644
--- a/src/intel/vulkan/anv_batch_chain.c
+++ b/src/intel/vulkan/anv_batch_chain.c
@@ -1366,6 +1366,10 @@ anv_reloc_list_add_dep(struct anv_cmd_buffer *cmd_buffer,
 
    anv_block_pool_foreach_bo(bo_list, iter, bo) {
       _mesa_set_add(relocs->deps, bo);
+      if (!cmd_buffer->device->info.has_llc) {
+         for (uint32_t i = 0; i < bo->size; i += CACHELINE_SIZE)
+            __builtin_ia32_clflush(bo->map + i);
+      }
    }
 }
 
-- 
2.17.1



More information about the mesa-dev mailing list