aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/drm_cache.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/drm_cache.c')
-rw-r--r--drivers/gpu/drm/drm_cache.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/drivers/gpu/drm/drm_cache.c b/drivers/gpu/drm/drm_cache.c
index 3dbc7f17eb1..4a4274b348b 100644
--- a/drivers/gpu/drm/drm_cache.c
+++ b/drivers/gpu/drm/drm_cache.c
@@ -101,6 +101,31 @@ drm_clflush_pages(struct page *pages[], unsigned long num_pages)
101EXPORT_SYMBOL(drm_clflush_pages); 101EXPORT_SYMBOL(drm_clflush_pages);
102 102
103void 103void
104drm_clflush_sg(struct sg_table *st)
105{
106#if defined(CONFIG_X86)
107 if (cpu_has_clflush) {
108 struct scatterlist *sg;
109 int i;
110
111 mb();
112 for_each_sg(st->sgl, sg, st->nents, i)
113 drm_clflush_page(sg_page(sg));
114 mb();
115
116 return;
117 }
118
119 if (on_each_cpu(drm_clflush_ipi_handler, NULL, 1) != 0)
120 printk(KERN_ERR "Timed out waiting for cache flush.\n");
121#else
122 printk(KERN_ERR "Architecture has no drm_cache.c support\n");
123 WARN_ON_ONCE(1);
124#endif
125}
126EXPORT_SYMBOL(drm_clflush_sg);
127
128void
104drm_clflush_virt_range(char *addr, unsigned long length) 129drm_clflush_virt_range(char *addr, unsigned long length)
105{ 130{
106#if defined(CONFIG_X86) 131#if defined(CONFIG_X86)