From bb415e24d914d67b2867045b68c99e9801e34b59 Mon Sep 17 00:00:00 2001 From: Cho KyongHo Date: Mon, 12 Feb 2018 14:50:34 +0900 Subject: [PATCH] g2d: fix use of ION API for 4.14 kernel 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 --- drivers/gpu/exynos/g2d/g2d_drv.c | 2 ++ drivers/gpu/exynos/g2d/g2d_uapi_process.c | 11 +++++------ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/exynos/g2d/g2d_drv.c b/drivers/gpu/exynos/g2d/g2d_drv.c index 1465d10435fa..d21a6ea7f781 100644 --- a/drivers/gpu/exynos/g2d/g2d_drv.c +++ b/drivers/gpu/exynos/g2d/g2d_drv.c @@ -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", diff --git a/drivers/gpu/exynos/g2d/g2d_uapi_process.c b/drivers/gpu/exynos/g2d/g2d_uapi_process.c index 7d7f656b5e19..4c9d46e5a257 100644 --- a/drivers/gpu/exynos/g2d/g2d_uapi_process.c +++ b/drivers/gpu/exynos/g2d/g2d_uapi_process.c @@ -18,10 +18,9 @@ #include #include #include -#include +#include #include #include -#include #include #include @@ -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; } -- 2.20.1