From patchwork Thu Jun 30 08:25:42 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 9206873 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 52C0E60752 for ; Thu, 30 Jun 2016 08:27:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 43CB4285B7 for ; Thu, 30 Jun 2016 08:27:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3847B2865A; Thu, 30 Jun 2016 08:27:19 +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 E2A91285B7 for ; Thu, 30 Jun 2016 08:27:18 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E6EBA6E837; Thu, 30 Jun 2016 08:27:10 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mailout4.w1.samsung.com (mailout4.w1.samsung.com [210.118.77.14]) by gabe.freedesktop.org (Postfix) with ESMTPS id 1C2496E82F for ; Thu, 30 Jun 2016 08:27:09 +0000 (UTC) Received: from eucpsbgm1.samsung.com (unknown [203.254.199.244]) by mailout4.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0O9K00LKQST7WW80@mailout4.w1.samsung.com> for dri-devel@lists.freedesktop.org; Thu, 30 Jun 2016 09:27:07 +0100 (BST) X-AuditID: cbfec7f4-f796c6d000001486-05-5774d7dba21b Received: from eusync2.samsung.com ( [203.254.199.212]) by eucpsbgm1.samsung.com (EUCPMTA) with SMTP id 35.CD.05254.BD7D4775; Thu, 30 Jun 2016 09:27:07 +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:07 +0100 (BST) From: Krzysztof Kozlowski To: Andrew Morton Subject: [PATCH v5 15/44] drm/rockship: dma-mapping: Use unsigned long for dma_attrs Date: Thu, 30 Jun 2016 10:25:42 +0200 Message-id: <1467275171-6298-15-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+NgFtrFLMWRmVeSWpSXmKPExsVy+t/xK7q3r5eEG7zfymnRe+4kk8Wc9WvY LDbOWM9qceXrezaL0xMWMVn8f/Sa1eL1C0OLTY+vsVpc3jWHzeLTg//MFjumHGBy4PbYvELL 48SM3ywe2789YPW4332cyWPzknqPv7P2s3j0bVnF6LH92jxmj8+b5AI4o7hsUlJzMstSi/Tt Ergybu3cwVYwQapiT+cF5gbGf6JdjJwcEgImEifuHmCDsMUkLtxbD2RzcQgJLGWU+LC8hxHC aWSSmLfiBlgVm4CxxOblS8BsEQFdiVXPdzGDFDELfGGSmPVvJjNIQlggTOLwg+3sIDaLgKrE wtv7GUFsXgF3iZsnfjFCrJOTOHlsMmsXIwcHJ1B89nd/iGUtjBLH9k1insDIu4CRYRWjaGpp ckFxUnquoV5xYm5xaV66XnJ+7iZGSIh+2cG4+JjVIUYBDkYlHl4H5pJwIdbEsuLK3EOMEhzM SiK8268AhXhTEiurUovy44tKc1KLDzFKc7AoifPO3fU+REggPbEkNTs1tSC1CCbLxMEp1cA4 R+rbttWmG3i9rWdmT0lWsxVbzLNm8Qdz5YrJ/9zMV6Ydfses/vFufFjR//ubj0W1RuvN2BWZ ka/nwfbUqO3ui82R09eVMHi8MbyfsWKv49K9M6wKA45kf2nW9p12TpJ/nVIOa47B9cj067o6 AcU6h+YyCVr73i8/Wfedq/G690dNoa/rOn4qsRRnJBpqMRcVJwIAh0fKI00CAAA= Cc: Krzysztof Kozlowski , Bartlomiej Zolnierkiewicz , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, hch@infradead.org, linux-rockchip@lists.infradead.org, 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/rockchip/rockchip_drm_gem.c | 17 +++++++---------- drivers/gpu/drm/rockchip/rockchip_drm_gem.h | 2 +- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_gem.c b/drivers/gpu/drm/rockchip/rockchip_drm_gem.c index 9c2d8a894093..7b1788e2a808 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_gem.c +++ b/drivers/gpu/drm/rockchip/rockchip_drm_gem.c @@ -17,8 +17,6 @@ #include #include -#include - #include "rockchip_drm_drv.h" #include "rockchip_drm_gem.h" @@ -28,15 +26,14 @@ static int rockchip_gem_alloc_buf(struct rockchip_gem_object *rk_obj, struct drm_gem_object *obj = &rk_obj->base; struct drm_device *drm = obj->dev; - init_dma_attrs(&rk_obj->dma_attrs); - dma_set_attr(DMA_ATTR_WRITE_COMBINE, &rk_obj->dma_attrs); + rk_obj->dma_attrs = DMA_ATTR_WRITE_COMBINE; if (!alloc_kmap) - dma_set_attr(DMA_ATTR_NO_KERNEL_MAPPING, &rk_obj->dma_attrs); + rk_obj->dma_attrs |= DMA_ATTR_NO_KERNEL_MAPPING; rk_obj->kvaddr = dma_alloc_attrs(drm->dev, obj->size, &rk_obj->dma_addr, GFP_KERNEL, - &rk_obj->dma_attrs); + rk_obj->dma_attrs); if (!rk_obj->kvaddr) { DRM_ERROR("failed to allocate %#x byte dma buffer", obj->size); return -ENOMEM; @@ -51,7 +48,7 @@ static void rockchip_gem_free_buf(struct rockchip_gem_object *rk_obj) struct drm_device *drm = obj->dev; dma_free_attrs(drm->dev, obj->size, rk_obj->kvaddr, rk_obj->dma_addr, - &rk_obj->dma_attrs); + rk_obj->dma_attrs); } static int rockchip_drm_gem_object_mmap(struct drm_gem_object *obj, @@ -70,7 +67,7 @@ static int rockchip_drm_gem_object_mmap(struct drm_gem_object *obj, vma->vm_pgoff = 0; ret = dma_mmap_attrs(drm->dev, vma, rk_obj->kvaddr, rk_obj->dma_addr, - obj->size, &rk_obj->dma_attrs); + obj->size, rk_obj->dma_attrs); if (ret) drm_gem_vm_close(vma); @@ -262,7 +259,7 @@ struct sg_table *rockchip_gem_prime_get_sg_table(struct drm_gem_object *obj) ret = dma_get_sgtable_attrs(drm->dev, sgt, rk_obj->kvaddr, rk_obj->dma_addr, obj->size, - &rk_obj->dma_attrs); + rk_obj->dma_attrs); if (ret) { DRM_ERROR("failed to allocate sgt, %d\n", ret); kfree(sgt); @@ -276,7 +273,7 @@ void *rockchip_gem_prime_vmap(struct drm_gem_object *obj) { struct rockchip_gem_object *rk_obj = to_rockchip_obj(obj); - if (dma_get_attr(DMA_ATTR_NO_KERNEL_MAPPING, &rk_obj->dma_attrs)) + if (dma_get_attr(DMA_ATTR_NO_KERNEL_MAPPING, rk_obj->dma_attrs)) return NULL; return rk_obj->kvaddr; diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_gem.h b/drivers/gpu/drm/rockchip/rockchip_drm_gem.h index ad22618473a4..18b3488db4ec 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_gem.h +++ b/drivers/gpu/drm/rockchip/rockchip_drm_gem.h @@ -23,7 +23,7 @@ struct rockchip_gem_object { void *kvaddr; dma_addr_t dma_addr; - struct dma_attrs dma_attrs; + unsigned long dma_attrs; }; struct sg_table *rockchip_gem_prime_get_sg_table(struct drm_gem_object *obj);