[COMMON] media: scaler: add explict cache maintenance
authorCho KyongHo <pullip.cho@samsung.com>
Tue, 11 Oct 2016 11:19:38 +0000 (20:19 +0900)
committerCosmin Tanislav <demonsingur@gmail.com>
Mon, 22 Apr 2024 17:22:17 +0000 (20:22 +0300)
m2m1shot now provides m2m1shot_sync_for_device/cpu() functions that
explicitly cleaning or invalidating CPU caches. This patch follows
"media: m2m1shot: use exynos_iovmm_map_userptr()" which separate
cache maintenance from m2m1shot_map/unmap_dma_buf().

Change-Id: I8eac9cf955fff3f07aa00a6ea86f401245e21be3
Signed-off-by: Cho KyongHo <pullip.cho@samsung.com>
drivers/media/platform/exynos/scaler/scaler-core.c

index 8c76f5fab1e95a7f2b9044c5a61ed2cc0805d805..8107128f1416f732845b4a314a6088c41b16a778 100644 (file)
@@ -3281,6 +3281,9 @@ static int sc_m2m1shot_prepare_buffer(struct m2m1shot_context *m21ctx,
                return ret;
        }
 
+       m2m1shot_sync_for_device(m21ctx->m21dev->dev,
+                               &buf_dma->plane[plane], dir);
+
        return 0;
 }
 
@@ -3289,6 +3292,8 @@ static void sc_m2m1shot_finish_buffer(struct m2m1shot_context *m21ctx,
                        int plane,
                        enum dma_data_direction dir)
 {
+       m2m1shot_sync_for_cpu(m21ctx->m21dev->dev,
+                             &buf_dma->plane[plane], dir);
        m2m1shot_dma_addr_unmap(m21ctx->m21dev->dev, buf_dma, plane);
        m2m1shot_unmap_dma_buf(m21ctx->m21dev->dev,
                                &buf_dma->plane[plane], dir);