diff options
author | Ross Zwisler <ross.zwisler@linux.intel.com> | 2014-02-26 14:06:51 -0500 |
---|---|---|
committer | H. Peter Anvin <hpa@linux.intel.com> | 2014-02-27 11:26:20 -0500 |
commit | 2a0c772f1967565d5b71a98012e74d5a7bddc1c4 (patch) | |
tree | 0a6bc099e63beb9ba42bccd8e0e63dbbde8af073 /drivers/gpu/drm | |
parent | 8b80fd8b45458a7d0b726d454c51c5219e0fb2ee (diff) |
x86: Use clflushopt in drm_clflush_page
If clflushopt is available on the system, use it instead of clflush in
drm_clflush_page.
Signed-off-by: Ross Zwisler <ross.zwisler@linux.intel.com>
Link: http://lkml.kernel.org/r/1393441612-19729-4-git-send-email-ross.zwisler@linux.intel.com
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Diffstat (limited to 'drivers/gpu/drm')
-rw-r--r-- | drivers/gpu/drm/drm_cache.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/gpu/drm/drm_cache.c b/drivers/gpu/drm/drm_cache.c index bb8f58012189..c518fb6cfb63 100644 --- a/drivers/gpu/drm/drm_cache.c +++ b/drivers/gpu/drm/drm_cache.c | |||
@@ -32,6 +32,12 @@ | |||
32 | #include <drm/drmP.h> | 32 | #include <drm/drmP.h> |
33 | 33 | ||
34 | #if defined(CONFIG_X86) | 34 | #if defined(CONFIG_X86) |
35 | |||
36 | /* | ||
37 | * clflushopt is an unordered instruction which needs fencing with mfence or | ||
38 | * sfence to avoid ordering issues. For drm_clflush_page this fencing happens | ||
39 | * in the caller. | ||
40 | */ | ||
35 | static void | 41 | static void |
36 | drm_clflush_page(struct page *page) | 42 | drm_clflush_page(struct page *page) |
37 | { | 43 | { |
@@ -44,7 +50,7 @@ drm_clflush_page(struct page *page) | |||
44 | 50 | ||
45 | page_virtual = kmap_atomic(page); | 51 | page_virtual = kmap_atomic(page); |
46 | for (i = 0; i < PAGE_SIZE; i += size) | 52 | for (i = 0; i < PAGE_SIZE; i += size) |
47 | clflush(page_virtual + i); | 53 | clflushopt(page_virtual + i); |
48 | kunmap_atomic(page_virtual); | 54 | kunmap_atomic(page_virtual); |
49 | } | 55 | } |
50 | 56 | ||