mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-24 21:50:12 +01:00
anv: Move to a function code to clflush batch buffers
This also need to be executed in Xe kmd, so moving it to a function. No changes in behavior intended here. Signed-off-by: José Roberto de Souza <jose.souza@intel.com> Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22171>
This commit is contained in:
parent
88d074cb8f
commit
91ee00a741
3 changed files with 23 additions and 10 deletions
|
|
@ -1398,3 +1398,21 @@ anv_queue_submit_simple_batch(struct anv_queue *queue,
|
|||
|
||||
return result;
|
||||
}
|
||||
|
||||
void
|
||||
anv_cmd_buffer_clflush(struct anv_cmd_buffer **cmd_buffers,
|
||||
uint32_t num_cmd_buffers)
|
||||
{
|
||||
#ifdef SUPPORT_INTEL_INTEGRATED_GPUS
|
||||
struct anv_batch_bo **bbo;
|
||||
|
||||
__builtin_ia32_mfence();
|
||||
|
||||
for (uint32_t i = 0; i < num_cmd_buffers; i++) {
|
||||
u_vector_foreach(bbo, &cmd_buffers[i]->seen_bbos) {
|
||||
for (uint32_t l = 0; l < (*bbo)->length; l += CACHELINE_SIZE)
|
||||
__builtin_ia32_clflush((*bbo)->bo->map + l);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2878,6 +2878,9 @@ anv_cmd_buffer_exec_batch_debug(struct anv_queue *queue,
|
|||
struct anv_cmd_buffer **cmd_buffers,
|
||||
struct anv_query_pool *perf_query_pool,
|
||||
uint32_t perf_query_pass);
|
||||
void
|
||||
anv_cmd_buffer_clflush(struct anv_cmd_buffer **cmd_buffers,
|
||||
uint32_t num_cmd_buffers);
|
||||
|
||||
/**
|
||||
* A allocation tied to a command buffer.
|
||||
|
|
|
|||
|
|
@ -403,16 +403,8 @@ setup_execbuf_for_cmd_buffers(struct anv_execbuf *execbuf,
|
|||
}
|
||||
|
||||
#ifdef SUPPORT_INTEL_INTEGRATED_GPUS
|
||||
if (device->physical->memory.need_clflush) {
|
||||
__builtin_ia32_mfence();
|
||||
struct anv_batch_bo **bbo;
|
||||
for (uint32_t i = 0; i < num_cmd_buffers; i++) {
|
||||
u_vector_foreach(bbo, &cmd_buffers[i]->seen_bbos) {
|
||||
for (uint32_t l = 0; l < (*bbo)->length; l += CACHELINE_SIZE)
|
||||
__builtin_ia32_clflush((*bbo)->bo->map + l);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (device->physical->memory.need_clflush)
|
||||
anv_cmd_buffer_clflush(cmd_buffers, num_cmd_buffers);
|
||||
#endif
|
||||
|
||||
execbuf->execbuf = (struct drm_i915_gem_execbuffer2) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue