From: wu guoxing Date: Fri, 16 Dec 2011 04:15:05 +0000 (+0800) Subject: ENGR00170452: gpu-viv: change from dma_sync_single_for_device to outer_clean_range X-Git-Tag: v3.0.35-fsl~1754 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=ce509ece5ece124bb711342ed16db97c66ae3e8c;p=karo-tx-linux.git ENGR00170452: gpu-viv: change from dma_sync_single_for_device to outer_clean_range dma_sync_single_for_device can only used for kernel physical memory, while in gpu, we will also clean user physical memory for pixmap, direct texture, etc. outer_clean_range can operate on both. Signed-off-by: Wu Guoxing Acked-by: Lily Zhang --- diff --git a/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_os.c b/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_os.c index c22aa460d2f4..eacee2791b93 100644 --- a/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_os.c +++ b/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_os.c @@ -4957,16 +4957,8 @@ OnError: for (i = 0; i < pageCount; i++) { - /* Flush(clean) the data cache. */ -#if !defined(ANDROID) - dma_sync_single_for_device( - gcvNULL, - page_to_phys(pages[i]), - PAGE_SIZE, - DMA_TO_DEVICE); -#else - flush_dcache_page(pages[i]); -#endif + unsigned long paddr = page_to_phys(pages[i]); + outer_clean_range(paddr, paddr + PAGE_SIZE); } #if gcdENABLE_VG @@ -5267,6 +5259,8 @@ OnError: /* Release the page cache. */ for (i = 0; i < pageCount; i++) { + unsigned long paddr = page_to_phys(pages[i]); + gcmkTRACE_ZONE( gcvLEVEL_INFO, gcvZONE_OS, "%s(%d): pages[%d]: 0x%X.", @@ -5279,14 +5273,10 @@ OnError: SetPageDirty(pages[i]); } -#if !defined(ANDROID) - /* Invalidate the data cache. */ - dma_sync_single_for_device( - gcvNULL, - page_to_phys(pages[i]), - PAGE_SIZE, - DMA_FROM_DEVICE); -#endif + flush_dcache_page(pages[i]); + + outer_inv_range(paddr, paddr + PAGE_SIZE); + page_cache_release(pages[i]); }