g2d: fix use of ION API for 4.14 kernel
authorCho KyongHo <pullip.cho@samsung.com>
Mon, 12 Feb 2018 05:50:34 +0000 (14:50 +0900)
committerSeungchul Kim <sc377.kim@samsung.com>
Mon, 28 May 2018 05:28:03 +0000 (14:28 +0900)
ION is dramatically changed in 4.14 kernel including kernel API and
the header files. But the symantics of ION API is not changed.

Change-Id: I24ca55a603d5a39ce0da40d18782e40b4a14e43b
Signed-off-by: Cho KyongHo <pullip.cho@samsung.com>
drivers/gpu/exynos/g2d/g2d_drv.c
drivers/gpu/exynos/g2d/g2d_uapi_process.c

index 1465d10435fa26d6e2eaddc87d82a68e9c28f058..d21a6ea7f781ad8d237a95ff2f7150db63e59621 100644 (file)
@@ -782,6 +782,8 @@ static int g2d_probe(struct platform_device *pdev)
                return ret;
        }
 
+       dma_set_mask(&pdev->dev, DMA_BIT_MASK(36));
+
        g2d_dev->clock = devm_clk_get(&pdev->dev, "gate");
        if (IS_ERR(g2d_dev->clock)) {
                dev_err(&pdev->dev, "Failed to get clock (%ld)\n",
index 7d7f656b5e191676b0028fdbfb1a0061bcf002e1..4c9d46e5a2572a162864539730681ea0a0ff6935 100644 (file)
 #include <linux/dma-buf.h>
 #include <linux/sync_file.h>
 #include <linux/iommu.h>
-#include <linux/ion.h>
+#include <linux/ion_exynos.h>
 #include <linux/slab.h>
 #include <linux/sched/mm.h>
-#include <linux/exynos_ion.h>
 #include <linux/exynos_iovmm.h>
 
 #include <asm/cacheflush.h>
@@ -76,8 +75,8 @@ static void g2d_clean_caches_layer(struct device *dev, struct g2d_layer *layer,
 
                dmabuf = layer->buffer[i].dmabuf.dmabuf;
                if ((layer->buffer_type == G2D_BUFTYPE_DMABUF) &&
-                               ion_cached_needsync_dmabuf(dmabuf) &&
-                                       ion_may_hwrender_dmabuf(dmabuf)) {
+                               ion_cached_dmabuf(dmabuf) &&
+                                       ion_hwrender_dmabuf(dmabuf)) {
                                dma_sync_sg_for_cpu(dev,
                                        layer->buffer[i].dmabuf.sgt->sgl,
                                        layer->buffer[i].dmabuf.sgt->orig_nents,
@@ -232,10 +231,10 @@ static int g2d_get_dmabuf(struct g2d_task *task,
        if (dir != DMA_TO_DEVICE)
                prot |= IOMMU_WRITE;
 
-       if (ion_cached_needsync_dmabuf(dmabuf)) {
+       if (ion_cached_dmabuf(dmabuf)) {
                task->total_cached_len += buffer->payload;
 
-               if ((dir == DMA_TO_DEVICE) && ion_may_hwrender_dmabuf(dmabuf))
+               if ((dir == DMA_TO_DEVICE) && ion_hwrender_dmabuf(dmabuf))
                        task->total_hwrender_len += buffer->payload;
        }