Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 306990
b: refs/heads/master
c: 6d5cd9c
h: refs/heads/master
v: v3
  • Loading branch information
Daniel Vetter committed Mar 27, 2012
1 parent a27f071 commit 8394c6d
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: dbf7bff074d5fdc87c61b1b41d8e809109cf0bf8
refs/heads/master: 6d5cd9cb1e32e4f4e4468704430b26bcb0bfb129
23 changes: 23 additions & 0 deletions trunk/drivers/gpu/drm/drm_cache.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,3 +98,26 @@ drm_clflush_pages(struct page *pages[], unsigned long num_pages)
#endif
}
EXPORT_SYMBOL(drm_clflush_pages);

void
drm_clflush_virt_range(char *addr, unsigned long length)
{
#if defined(CONFIG_X86)
if (cpu_has_clflush) {
char *end = addr + length;
mb();
for (; addr < end; addr += boot_cpu_data.x86_clflush_size)
clflush(addr);
clflush(end - 1);
mb();
return;
}

if (on_each_cpu(drm_clflush_ipi_handler, NULL, 1) != 0)
printk(KERN_ERR "Timed out waiting for cache flush.\n");
#else
printk(KERN_ERR "Architecture has no drm_cache.c support\n");
WARN_ON_ONCE(1);
#endif
}
EXPORT_SYMBOL(drm_clflush_virt_range);
1 change: 1 addition & 0 deletions trunk/include/drm/drmP.h
Original file line number Diff line number Diff line change
Expand Up @@ -1332,6 +1332,7 @@ extern int drm_remove_magic(struct drm_master *master, drm_magic_t magic);

/* Cache management (drm_cache.c) */
void drm_clflush_pages(struct page *pages[], unsigned long num_pages);
void drm_clflush_virt_range(char *addr, unsigned long length);

/* Locking IOCTL support (drm_lock.h) */
extern int drm_lock(struct drm_device *dev, void *data,
Expand Down

0 comments on commit 8394c6d

Please sign in to comment.