diff options
author | Thomas Hellstrom <thellstrom@vmware.com> | 2009-07-24 10:22:36 +0200 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2009-07-29 15:56:32 +1000 |
commit | f121ecfebbea1452a17d57c656def7d1537440f7 (patch) | |
tree | ddd80ea0b8d76f4bbd6bc348afbbf5b3dab74bb3 /drivers/gpu | |
parent | 73ba651fc246fcc3e446da4155e0425b4219d2c4 (diff) | |
download | op-kernel-dev-f121ecfebbea1452a17d57c656def7d1537440f7.zip op-kernel-dev-f121ecfebbea1452a17d57c656def7d1537440f7.tar.gz |
drm/ttm: powerpc: Fix Highmem cache flushing.
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>
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/drm/ttm/ttm_tt.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/drivers/gpu/drm/ttm/ttm_tt.c b/drivers/gpu/drm/ttm/ttm_tt.c index 81ab81f..9b2248a 100644 --- a/drivers/gpu/drm/ttm/ttm_tt.c +++ b/drivers/gpu/drm/ttm/ttm_tt.c @@ -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) |