mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 05:18:08 +02:00
anv: Add an invalidate_range helper
This is similar to clflush_range except that it puts the mfence on the other side to ensure caches are flushed prior to reading. Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Cc: "13.0 17.0" <mesa-stable@lists.freedesktop.org>
This commit is contained in:
parent
e8d600710c
commit
8582ab2d6e
1 changed files with 13 additions and 0 deletions
|
|
@ -448,6 +448,19 @@ anv_clflush_range(void *start, size_t size)
|
|||
}
|
||||
}
|
||||
|
||||
static inline void
|
||||
anv_invalidate_range(void *start, size_t size)
|
||||
{
|
||||
void *p = (void *) (((uintptr_t) start) & ~CACHELINE_MASK);
|
||||
void *end = start + size;
|
||||
|
||||
while (p < end) {
|
||||
__builtin_ia32_clflush(p);
|
||||
p += CACHELINE_SIZE;
|
||||
}
|
||||
__builtin_ia32_mfence();
|
||||
}
|
||||
|
||||
static void inline
|
||||
anv_state_clflush(struct anv_state state)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue