From patchwork Fri Oct 26 07:22:00 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?Q0sgSHUgKOiDoeS/iuWFiSk=?= X-Patchwork-Id: 10657001 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id F3DB65A4 for ; Fri, 26 Oct 2018 07:25:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D9EDB2C83C for ; Fri, 26 Oct 2018 07:25:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CD71A2C844; Fri, 26 Oct 2018 07:25:25 +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=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE,UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 60E312C83C for ; Fri, 26 Oct 2018 07:25:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=G5u0TVb+Qp0kAA1bYWbFXxYSCLUJ4gc1+l81MVVSM/U=; b=jjlSzrz/A/yBn7 G1Zei5pXK2uq67eStScKOjttPXABkPY8X4QI41i/xr7IRUBnL1/384dCFLb4HldcL0UwN6sIJ/bEa oPq2Qq1zWD52hMvpdg9QqFwVM3hXYABSVz2Q8t7liMfvQ4KqhTN5D8rTRoL4uPuuvLfsYbzqz/xEx dDo9PZgRSjBVAD/my8zU5xHvSJ+7fkVSBSZB7UghAkHP6EKTHwMyomoSS9pb1sZo1RsklgL6uMdau JH9bzSPb4POvO/Vkw5zzL1azy7jJjkLQxV1GKIGT9ZItoSXG4hzWzXdFro1ykrJTkgKkZrfNBv/La kVGD3jUzwdfiIRIjgiCg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gFwUh-0007nS-DJ; Fri, 26 Oct 2018 07:25:19 +0000 Received: from [210.61.82.184] (helo=mailgw02.mediatek.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gFwSS-0006Dd-0P; Fri, 26 Oct 2018 07:23:05 +0000 X-UUID: ad7a88e7757649708a23e9b44ad18bb7-20181026 X-UUID: ad7a88e7757649708a23e9b44ad18bb7-20181026 Received: from mtkcas06.mediatek.inc [(172.21.101.30)] by mailgw02.mediatek.com (envelope-from ) (mhqrelay.mediatek.com ESMTP with TLS) with ESMTP id 2037085050; Fri, 26 Oct 2018 15:22:36 +0800 Received: from mtkcas08.mediatek.inc (172.21.101.126) by mtkmbs01n1.mediatek.inc (172.21.101.68) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Fri, 26 Oct 2018 15:22:29 +0800 Received: from mtkslt305.mediatek.inc (10.21.14.140) by mtkcas08.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Fri, 26 Oct 2018 15:22:29 +0800 From: CK Hu To: Daniel Vetter , David Airlie , Gustavo Padovan , Maarten Lankhorst , Sean Paul , CK Hu , Philipp Zabel Subject: [PATCH 0/3] Mediatek drm driver use drm_gem_cma_object instead of mtk_drm_gem_obj Date: Fri, 26 Oct 2018 15:22:00 +0800 Message-ID: <1540538523-1973-1-git-send-email-ck.hu@mediatek.com> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 X-MTK: N X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181026_002300_187966_114823A0 X-CRM114-Status: GOOD ( 11.75 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: srv_heupstream@mediatek.com, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-mediatek@lists.infradead.org, Matthias Brugger , linux-arm-kernel@lists.infradead.org Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Because there are many similar code in drm_gem_cma_helper.c and mtk_drm_gem.c, merging these two files would reduce code size and be easier to maintain. The major difference between these two gem object is that drm_gem_cma_object is for CMA buffer and mtk_drm_gem_obj is for iommu buffer. This series just add two iommu feature which is used by mediatek drm driver into cma helper, so there is still some feature just support CMA buffer. The first feature is making sub device as dma device for dma operation. So far drm core treat drm device as dma device, but mediatek drm device is not a dma device and it use sub device as dma device. The second feature is providing interface to create dumb buffer without mapping kernel virtual address. For iommu buffer, mapping kernel virtual address would reduce free virtual memory area. Some feature still support only CMA buffer, for example, drm_gem_cma_prime_vmap(), so we still treat these helper function as 'cma' helper function. CK Hu (3): drm: Add dma_dev in struct drm_device drm: Add drm_gem_cma_dumb_create_no_kmap() helper function drm/mediatek: Use drm_gem_cma_object instead of mtk_drm_gem_obj drivers/gpu/drm/drm_gem_cma_helper.c | 110 +++++++++++--- drivers/gpu/drm/mediatek/Makefile | 1 - drivers/gpu/drm/mediatek/mtk_drm_crtc.c | 1 - drivers/gpu/drm/mediatek/mtk_drm_drv.c | 15 +- drivers/gpu/drm/mediatek/mtk_drm_drv.h | 1 - drivers/gpu/drm/mediatek/mtk_drm_fb.c | 1 - drivers/gpu/drm/mediatek/mtk_drm_gem.c | 243 ------------------------------- drivers/gpu/drm/mediatek/mtk_drm_gem.h | 56 ------- drivers/gpu/drm/mediatek/mtk_drm_plane.c | 8 +- include/drm/drm_device.h | 1 + include/drm/drm_gem_cma_helper.h | 7 + 11 files changed, 110 insertions(+), 334 deletions(-) delete mode 100644 drivers/gpu/drm/mediatek/mtk_drm_gem.c delete mode 100644 drivers/gpu/drm/mediatek/mtk_drm_gem.h