dect
/
linux-2.6
Archived
13
0
Fork 0

drm/ttm: Add some powerpc cache flush code.

Optimise the powerpc flushing path for TTM.

Signed-off-by: Dave Airlie <airlied@redhat.com>
This commit is contained in:
Michel Dänzer 2009-06-15 16:56:13 +02:00 committed by Dave Airlie
parent 919f32f1df
commit 46f4b3eab7
1 changed files with 10 additions and 1 deletions

View File

@ -68,7 +68,7 @@ static void ttm_tt_cache_flush_clflush(struct page *pages[],
ttm_tt_clflush_page(*pages++);
mb();
}
#else
#elif !defined(__powerpc__)
static void ttm_tt_ipi_handler(void *null)
{
;
@ -83,6 +83,15 @@ void ttm_tt_cache_flush(struct page *pages[], unsigned long num_pages)
ttm_tt_cache_flush_clflush(pages, num_pages);
return;
}
#elif defined(__powerpc__)
unsigned long i;
for (i = 0; i < num_pages; ++i) {
if (pages[i]) {
unsigned long start = (unsigned long)page_address(pages[i]);
flush_dcache_range(start, start + PAGE_SIZE);
}
}
#else
if (on_each_cpu(ttm_tt_ipi_handler, NULL, 1) != 0)
printk(KERN_ERR TTM_PFX