From patchwork Fri Jun 10 10:11:29 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 9169265 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 C2604604DB for ; Fri, 10 Jun 2016 10:13:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B2DCB281FE for ; Fri, 10 Jun 2016 10:13:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A78242833F; Fri, 10 Jun 2016 10:13:31 +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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 4CF13281FE for ; Fri, 10 Jun 2016 10:13:31 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1bBJRS-0001ek-Km; Fri, 10 Jun 2016 10:13:30 +0000 Received: from mailout4.w1.samsung.com ([210.118.77.14]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1bBJR4-00015V-8r; Fri, 10 Jun 2016 10:13:07 +0000 Received: from eucpsbgm2.samsung.com (unknown [203.254.199.245]) by mailout4.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0O8J0091NWDBMV50@mailout4.w1.samsung.com>; Fri, 10 Jun 2016 11:12:48 +0100 (BST) X-AuditID: cbfec7f5-f792a6d000001302-da-575a929f7a8f Received: from eusync4.samsung.com ( [203.254.199.214]) by eucpsbgm2.samsung.com (EUCPMTA) with SMTP id 75.63.04866.F929A575; Fri, 10 Jun 2016 11:12:47 +0100 (BST) Received: from AMDC2174.DIGITAL.local ([106.120.53.17]) by eusync4.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0O8J00MI3WC5KUB0@eusync4.samsung.com>; Fri, 10 Jun 2016 11:12:47 +0100 (BST) From: Krzysztof Kozlowski To: Andrew Morton Subject: [PATCH v4 12/44] drm/mediatek: dma-mapping: Use unsigned long for dma_attrs Date: Fri, 10 Jun 2016 12:11:29 +0200 Message-id: <1465553521-27303-13-git-send-email-k.kozlowski@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1465553521-27303-1-git-send-email-k.kozlowski@samsung.com> References: <1465553521-27303-1-git-send-email-k.kozlowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrHLMWRmVeSWpSXmKPExsVy+t/xa7rzJ0WFG+x8YmHRe+4kk8Wc9WvY LP5OOsZusXHGelaLmRtmsFg07t7GbrHw4V1mi8YZ81ktrnx9z2ZxesIiJovXLwwtNj2+xmpx edccNovLzRcZLc5ddrRoajG2uHvvBIvF3Tt9bA5CHr9/TWL0mN1wkcVj77cFLB47Z91l99i8 QsvjxIzfLB7bvz1g9bjffZzJY/OSeo+Wk/tZPPr/Gnj0bVnF6PF5k1wAbxSXTUpqTmZZapG+ XQJXxqVtXWwFB0UrGvc9Y2xg/CjYxcjJISFgIrFi3gxWCFtM4sK99WxdjFwcQgJLGSUWLFrC BOE0Mkm829DGCFLFJmAssXn5EjYQW0RAV2LV813MIEXMAn9ZJKYfvgqWEBYIk7jQ3QQ2lkVA VeJfx3t2EJtXwENi7ddvjBDr5CROHpsMVsMJFO++O5MFxBYScJfY/uQV0wRG3gWMDKsYRVNL kwuKk9JzjfSKE3OLS/PS9ZLzczcxQmLh6w7GpcesDjEKcDAq8fBG7IoMF2JNLCuuzD3EKMHB rCTCa9EXFS7Em5JYWZValB9fVJqTWnyIUZqDRUmcd+au9yFCAumJJanZqakFqUUwWSYOTqkG Rrm+D+faXC6YzdG/WzmV18dzZlNNjYRtgcmT+RMOrDyx/cGz0BtfHSs2OoqciVjzVmrWbxef MMPpy0tt3i7w6TMyuP0ly865QIdlVSyf19zYn1LBl9/9d2Q4HjFHtePn/U9a8tvC5C4VcHql r9cWyLU4rNLEe7PG531k5sMjBWG+0sa/L6frKbEUZyQaajEXFScCAEAaQbSBAgAA X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160610_031306_504724_74670201 X-CRM114-Status: GOOD ( 14.77 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Krzysztof Kozlowski , YT Shen , Bibby Hsieh , Arnd Bergmann , Bartlomiej Zolnierkiewicz , David Airlie , Daniel Vetter , linux-kernel@vger.kernel.org, Mao Huang , hch@infradead.org, CK Hu , linux-mediatek@lists.infradead.org, dri-devel@lists.freedesktop.org, Philipp Zabel , Matthias Brugger , linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.org 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; };