diff options
author | Kyle McMartin <kyle@mcmartin.ca> | 2008-01-17 18:51:56 -0500 |
---|---|---|
committer | Eric Anholt <eric@anholt.net> | 2008-01-17 16:55:44 -0800 |
commit | c6f175cbea1dba3fc26426243acc55b89b8a8064 (patch) | |
tree | cdf5d0b2106e9afef173d96b92c21d72ff40095a | |
parent | 44a9fa8cc6c7d598163d1885bf69e4bf747a004b (diff) |
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>
-rw-r--r-- | linux-core/i915_buffer.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/linux-core/i915_buffer.c b/linux-core/i915_buffer.c index 3dd236dd..08067476 100644 --- a/linux-core/i915_buffer.c +++ b/linux-core/i915_buffer.c @@ -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(); } |