]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ENGR00170452: gpu-viv: change from dma_sync_single_for_device to outer_clean_range
authorwu guoxing <b39297@freescale.com>
Fri, 16 Dec 2011 04:15:05 +0000 (12:15 +0800)
committerLothar Waßmann <LW@KARO-electronics.de>
Fri, 24 May 2013 06:33:39 +0000 (08:33 +0200)
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 <b39297@freescale.com>
Acked-by: Lily Zhang <r58066@freescale.com>
drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_os.c

index c22aa460d2f4ca6847aa1dcf5aeab12a5d6e356e..eacee2791b9383dd293d38d90fe7985f039f7aa1 100644 (file)
@@ -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]);
         }