From patchwork Wed Jul 13 08:41:07 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 9227103 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 50B4A6075D for ; Wed, 13 Jul 2016 08:42:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 405C92574A for ; Wed, 13 Jul 2016 08:42:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 32D902766D; Wed, 13 Jul 2016 08:42:38 +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 A95DB2574A for ; Wed, 13 Jul 2016 08:42:37 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6B8C56E6BA; Wed, 13 Jul 2016 08:42:36 +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 954336E6B9 for ; Wed, 13 Jul 2016 08:42:12 +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 <0OA800G5MW684C30@mailout4.w1.samsung.com> for dri-devel@lists.freedesktop.org; Wed, 13 Jul 2016 09:42:08 +0100 (BST) X-AuditID: cbfec7f4-f796c6d000001486-63-5785fee07dfd Received: from eusync3.samsung.com ( [203.254.199.213]) by eucpsbgm1.samsung.com (EUCPMTA) with SMTP id 81.A0.05254.0EEF5875; Wed, 13 Jul 2016 09:42:08 +0100 (BST) Received: from AMDC2174.DIGITAL.local ([106.120.53.17]) by eusync3.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0OA800KINW5J0E10@eusync3.samsung.com>; Wed, 13 Jul 2016 09:42:08 +0100 (BST) From: Krzysztof Kozlowski To: Andrew Morton Subject: [PATCH v6 16/46] drm/rockship: dma-mapping: Use unsigned long for dma_attrs Date: Wed, 13 Jul 2016 10:41:07 +0200 Message-id: <1468399300-5399-16-git-send-email-k.kozlowski@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1468399300-5399-15-git-send-email-k.kozlowski@samsung.com> References: <1468399167-28083-1-git-send-email-k.kozlowski@samsung.com> <1468399300-5399-1-git-send-email-k.kozlowski@samsung.com> <1468399300-5399-2-git-send-email-k.kozlowski@samsung.com> <1468399300-5399-3-git-send-email-k.kozlowski@samsung.com> <1468399300-5399-4-git-send-email-k.kozlowski@samsung.com> <1468399300-5399-5-git-send-email-k.kozlowski@samsung.com> <1468399300-5399-6-git-send-email-k.kozlowski@samsung.com> <1468399300-5399-7-git-send-email-k.kozlowski@samsung.com> <1468399300-5399-8-git-send-email-k.kozlowski@samsung.com> <1468399300-5399-9-git-send-email-k.kozlowski@samsung.com> <1468399300-5399-10-git-send-email-k.kozlowski@samsung.com> <1468399300-5399-11-git-send-email-k.kozlowski@samsung.com> <1468399300-5399-12-git-send-email-k.kozlowski@samsung.com> <1468399300-5399-13-git-send-email-k.kozlowski@samsung.com> <1468399300-5399-14-git-send-email-k.kozlowski@samsung.com> <1468399300-5399-15-git-send-email-k.kozlowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrOLMWRmVeSWpSXmKPExsVy+t/xq7oP/rWGG3xeq2TRe+4kk8Wc9WvY LDbOWM9qceXrezaL0xMWMVn8f/Sa1eL1C0OLTY+vsVpc3jWHzeLTg//MFjumHGBy4PbYvELL 48SM3ywe2789YPW4332cyWPzknqPv7P2s3j0bVnF6LH92jxmj8+b5AI4o7hsUlJzMstSi/Tt Ergymg5+Zyo4K1VxfdpDtgbGzWJdjJwcEgImEnce97JD2GISF+6tZwOxhQSWMkosv20DYTcy SfzqZQWx2QSMJTYvXwJWIyKgK7Hq+S7mLkYuDmaBL0wSs/7NZAZJCAuESVzofAc0lIODRUBV onOBL0iYV8Bd4sulJSwQu+QkTh6bzApSwingIfGkNwNkjJDAA3aJee3T2CYw8i5gZFjFKJpa mlxQnJSea6hXnJhbXJqXrpecn7uJERKcX3YwLj5mdYhRgINRiYeXUaQ1XIg1say4MvcQowQH s5II79O/QCHelMTKqtSi/Pii0pzU4kOM0hwsSuK8c3e9DxESSE8sSc1OTS1ILYLJMnFwSjUw ttmd7lG56VAmdX43R0T+Mi4+G1+9hJ06L6rnljVW9dYrxPPw1ra+XO5tr5MsayRS/+HhnhQm TrlLuvfT7d/Pa+Ses8XozqPqb1fnTqwUTujaXfBVb+KajKfqZSoW9xY8WhbvHrS94OT0z0HP tnz4XBPMyOjUbfVgSz9X1LEveavkV4RVypsqsRRnJBpqMRcVJwIAZpbAI0oCAAA= 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 [for drm] Acked-by: Daniel Vetter --- 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 059e902f872d..28b2a828c650 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 %zu 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);