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: 10656987 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 CD387109C for ; Fri, 26 Oct 2018 07:22:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B34222C822 for ; Fri, 26 Oct 2018 07:22:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A6C932C829; Fri, 26 Oct 2018 07:22:53 +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=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 489782C822 for ; Fri, 26 Oct 2018 07:22:53 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 727926E3F8; Fri, 26 Oct 2018 07:22:49 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mailgw02.mediatek.com (unknown [210.61.82.184]) by gabe.freedesktop.org (Postfix) with ESMTPS id D7D566E3F8 for ; Fri, 26 Oct 2018 07:22:47 +0000 (UTC) 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-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development 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 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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