Skip to content

Commit

Permalink
drm/ttm: Add some powerpc cache flush code.
Browse files Browse the repository at this point in the history
Optimise the powerpc flushing path for TTM.

Signed-off-by: Dave Airlie <airlied@redhat.com>
  • Loading branch information
Michel Dänzer authored and Dave Airlie committed Jun 18, 2009
1 parent 919f32f commit 46f4b3e
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion drivers/gpu/drm/ttm/ttm_tt.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
;
Expand All @@ -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
Expand Down

0 comments on commit 46f4b3e

Please sign in to comment.