From patchwork Thu Jun 30 08:25:39 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 9206867 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id AC08860752 for ; Thu, 30 Jun 2016 08:27:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9CE26285B7 for ; Thu, 30 Jun 2016 08:27:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 914352865A; Thu, 30 Jun 2016 08:27:15 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 53C48285B7 for ; Thu, 30 Jun 2016 08:27:13 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D28EC6E82F; Thu, 30 Jun 2016 08:27:09 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mailout1.w1.samsung.com (mailout1.w1.samsung.com [210.118.77.11]) by gabe.freedesktop.org (Postfix) with ESMTPS id 9065B6E82F for ; Thu, 30 Jun 2016 08:27:08 +0000 (UTC) Received: from eucpsbgm1.samsung.com (unknown [203.254.199.244]) by mailout1.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0O9K00MMTST5UB80@mailout1.w1.samsung.com> for dri-devel@lists.freedesktop.org; Thu, 30 Jun 2016 09:27:05 +0100 (BST) X-AuditID: cbfec7f4-f796c6d000001486-f7-5774d7d985af Received: from eusync2.samsung.com ( [203.254.199.212]) by eucpsbgm1.samsung.com (EUCPMTA) with SMTP id 62.CD.05254.9D7D4775; Thu, 30 Jun 2016 09:27:05 +0100 (BST) Received: from AMDC2174.DIGITAL.local ([106.120.53.17]) by eusync2.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0O9K00F5WSS0I050@eusync2.samsung.com>; Thu, 30 Jun 2016 09:27:05 +0100 (BST) From: Krzysztof Kozlowski To: Andrew Morton Subject: [PATCH v5 12/44] drm/mediatek: dma-mapping: Use unsigned long for dma_attrs Date: Thu, 30 Jun 2016 10:25:39 +0200 Message-id: <1467275171-6298-12-git-send-email-k.kozlowski@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1467275171-6298-1-git-send-email-k.kozlowski@samsung.com> References: <1467275019-30789-1-git-send-email-k.kozlowski@samsung.com> <1467275171-6298-1-git-send-email-k.kozlowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrPLMWRmVeSWpSXmKPExsVy+t/xK7o3r5eEG5z7yGfRe+4kk8Wc9WvY LDbOWM9qceXrezaL0xMWMVm8fmFosenxNVaLy7vmsFlcbr7IaNHUYuzA5bFz1l12j80rtDxO zPjN4rH92wNWj/vdx5k8Ni+p9+jbsorR4/MmuQCOKC6blNSczLLUIn27BK6MS9u62AoOilY0 7nvG2MD4UbCLkZNDQsBE4v7OqywQtpjEhXvr2boYuTiEBJYySnTO+cYI4TQySdyb0McEUsUm YCyxefkSNhBbREBXYtXzXcwgRcwCN5kk1q95xAiSEBYIk5h64CPYWBYBVYl/3cuZQWxeAXeJ xpOzoNbJSZw8Npm1i5GDgxMoPvu7P8SyFkaJY/smMU9g5F3AyLCKUTS1NLmgOCk911CvODG3 uDQvXS85P3cTIyQYv+xgXHzM6hCjAAejEg+vA3NJuBBrYllxZe4hRgkOZiUR3u1XgEK8KYmV ValF+fFFpTmpxYcYpTlYlMR55+56HyIkkJ5YkpqdmlqQWgSTZeLglGpgnLYzzZPzjvWyu0vV Ln5/3nqd32zKg1CFSVV/G9bVZq09+fXgtT3xX6R4E9jn3DU4pfPm4Nu+EL555+f+Phv5uSTx 343vahfeLDu8Zp3irNxdzZ8m7qyTW3SxKL434qf6sgP3dKIXiRxoNdmX7ZHN9SOV7XjGm76y HRpsf3/sjeLZEsM/Uyr1c4cSS3FGoqEWc1FxIgDSYYxlQgIAAA== Cc: Krzysztof Kozlowski , Bartlomiej Zolnierkiewicz , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, hch@infradead.org, linux-mediatek@lists.infradead.org, Matthias Brugger , linux-arm-kernel@lists.infradead.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Split out subsystem specific changes for easier reviews. This will be squashed with main commit. Signed-off-by: Krzysztof Kozlowski --- drivers/gpu/drm/mediatek/mtk_drm_gem.c | 13 ++++++------- drivers/gpu/drm/mediatek/mtk_drm_gem.h | 2 +- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/mediatek/mtk_drm_gem.c b/drivers/gpu/drm/mediatek/mtk_drm_gem.c index fa2ec0cd00e8..7abc550ebc00 100644 --- a/drivers/gpu/drm/mediatek/mtk_drm_gem.c +++ b/drivers/gpu/drm/mediatek/mtk_drm_gem.c @@ -54,15 +54,14 @@ struct mtk_drm_gem_obj *mtk_drm_gem_create(struct drm_device *dev, obj = &mtk_gem->base; - init_dma_attrs(&mtk_gem->dma_attrs); - dma_set_attr(DMA_ATTR_WRITE_COMBINE, &mtk_gem->dma_attrs); + mtk_gem->dma_attrs = DMA_ATTR_WRITE_COMBINE; if (!alloc_kmap) - dma_set_attr(DMA_ATTR_NO_KERNEL_MAPPING, &mtk_gem->dma_attrs); + mtk_gem->dma_attrs |= DMA_ATTR_NO_KERNEL_MAPPING; mtk_gem->cookie = dma_alloc_attrs(priv->dma_dev, obj->size, &mtk_gem->dma_addr, GFP_KERNEL, - &mtk_gem->dma_attrs); + mtk_gem->dma_attrs); if (!mtk_gem->cookie) { DRM_ERROR("failed to allocate %zx byte dma buffer", obj->size); ret = -ENOMEM; @@ -93,7 +92,7 @@ void mtk_drm_gem_free_object(struct drm_gem_object *obj) drm_prime_gem_destroy(obj, mtk_gem->sg); else dma_free_attrs(priv->dma_dev, obj->size, mtk_gem->cookie, - mtk_gem->dma_addr, &mtk_gem->dma_attrs); + mtk_gem->dma_addr, mtk_gem->dma_attrs); /* release file pointer to gem object. */ drm_gem_object_release(obj); @@ -173,7 +172,7 @@ static int mtk_drm_gem_object_mmap(struct drm_gem_object *obj, vma->vm_pgoff = 0; ret = dma_mmap_attrs(priv->dma_dev, vma, mtk_gem->cookie, - mtk_gem->dma_addr, obj->size, &mtk_gem->dma_attrs); + mtk_gem->dma_addr, obj->size, mtk_gem->dma_attrs); if (ret) drm_gem_vm_close(vma); @@ -224,7 +223,7 @@ struct sg_table *mtk_gem_prime_get_sg_table(struct drm_gem_object *obj) ret = dma_get_sgtable_attrs(priv->dma_dev, sgt, mtk_gem->cookie, mtk_gem->dma_addr, obj->size, - &mtk_gem->dma_attrs); + mtk_gem->dma_attrs); if (ret) { DRM_ERROR("failed to allocate sgt, %d\n", ret); kfree(sgt); diff --git a/drivers/gpu/drm/mediatek/mtk_drm_gem.h b/drivers/gpu/drm/mediatek/mtk_drm_gem.h index 3a2a5624a1cb..2752718fa5b2 100644 --- a/drivers/gpu/drm/mediatek/mtk_drm_gem.h +++ b/drivers/gpu/drm/mediatek/mtk_drm_gem.h @@ -35,7 +35,7 @@ struct mtk_drm_gem_obj { void *cookie; void *kvaddr; dma_addr_t dma_addr; - struct dma_attrs dma_attrs; + unsigned long dma_attrs; struct sg_table *sg; };