Skip to content

Commit

Permalink
drm/ttm: powerpc: Fix Highmem cache flushing.
Browse files Browse the repository at this point in the history
Temporarily maps highmem pages while flushing to get a valid virtual
address to flush.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
  • Loading branch information
Thomas Hellstrom authored and Dave Airlie committed Jul 29, 2009
1 parent 73ba651 commit f121ecf
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions drivers/gpu/drm/ttm/ttm_tt.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,16 @@ void ttm_tt_cache_flush(struct page *pages[], unsigned long num_pages)
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);
}
struct page *page = pages[i];
void *page_virtual;

if (unlikely(page == NULL))
continue;

page_virtual = kmap_atomic(page, KM_USER0);
flush_dcache_range((unsigned long) page_virtual,
(unsigned long) page_virtual + PAGE_SIZE);
kunmap_atomic(page_virtual, KM_USER0);
}
#else
if (on_each_cpu(ttm_tt_ipi_handler, NULL, 1) != 0)
Expand Down

0 comments on commit f121ecf

Please sign in to comment.