mirror of
https://gitlab.freedesktop.org/mesa/drm.git
synced 2025-12-25 03:40:10 +01:00
i915: fix invalid opcode exception on cpus without clflush
i915_flush_ttm was unconditionally executing a clflush instruction to (obviously) flush the cache. Instead, check if the cpu supports clflush, and if not, fall back to calling wbinvd to flush the entire cache. Signed-off-by: Kyle McMartin <kmcmartin@redhat.com>
This commit is contained in:
parent
44a9fa8cc6
commit
c6f175cbea
1 changed files with 11 additions and 0 deletions
|
|
@ -286,7 +286,18 @@ void i915_flush_ttm(struct drm_ttm *ttm)
|
|||
return;
|
||||
|
||||
DRM_MEMORYBARRIER();
|
||||
|
||||
#ifdef CONFIG_X86_32
|
||||
/* Hopefully nobody has built an x86-64 processor without clflush */
|
||||
if (!cpu_has_clflush) {
|
||||
wbinvd();
|
||||
DRM_MEMORYBARRIER();
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
for (i = ttm->num_pages - 1; i >= 0; i--)
|
||||
drm_cache_flush_page(drm_ttm_get_page(ttm, i));
|
||||
|
||||
DRM_MEMORYBARRIER();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue