From patchwork Wed Jun 3 08:31:31 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Zimmermann X-Patchwork-Id: 11585309 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0AF3E14E3 for ; Wed, 3 Jun 2020 08:32:24 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E7E3720678 for ; Wed, 3 Jun 2020 08:32:23 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E7E3720678 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id AE5696E311; Wed, 3 Jun 2020 08:32:01 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by gabe.freedesktop.org (Postfix) with ESMTPS id E5EA96E212 for ; Wed, 3 Jun 2020 08:31:55 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 2C901B0BE; Wed, 3 Jun 2020 08:31:56 +0000 (UTC) From: Thomas Zimmermann To: abrodkin@synopsys.com, airlied@linux.ie, daniel@ffwll.ch, james.qian.wang@arm.com, liviu.dudau@arm.com, mihail.atanassov@arm.com, brian.starkey@arm.com, joel@jms.id.au, andrew@aj.id.au, sam@ravnborg.org, bbrezillon@kernel.org, nicolas.ferre@microchip.com, alexandre.belloni@bootlin.com, ludovic.desroches@microchip.com, maarten.lankhorst@linux.intel.com, mripard@kernel.org, stefan@agner.ch, alison.wang@nxp.com, xinliang.liu@linaro.org, zourongrong@gmail.com, john.stultz@linaro.org, kong.kongxinwei@hisilicon.com, puck.chen@hisilicon.com, p.zabel@pengutronix.de, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, paul@crapouillou.net, linus.walleij@linaro.org, narmstrong@baylibre.com, khilman@baylibre.com, marex@denx.de, laurent.pinchart@ideasonboard.com, kieran.bingham+renesas@ideasonboard.com, benjamin.gaignard@linaro.org, vincent.abriou@st.com, yannick.fertre@st.com, philippe.cornu@st.com, mcoquelin.stm32@gmail.com, alexandre.torgue@st.com, wens@csie.org, jsarha@ti.com, tomi.valkeinen@ti.com, noralf@tronnes.org Subject: [PATCH v2 22/23] drm/zte: Use GEM CMA object functions Date: Wed, 3 Jun 2020 10:31:31 +0200 Message-Id: <20200603083132.4610-23-tzimmermann@suse.de> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200603083132.4610-1-tzimmermann@suse.de> References: <20200603083132.4610-1-tzimmermann@suse.de> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arm-kernel@lists.infradead.org, Thomas Zimmermann , linux-aspeed@lists.ozlabs.org, dri-devel@lists.freedesktop.org, Emil Velikov Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" The zte driver uses the default implementation for CMA functions. The DRM_GEM_CMA_DRIVER_OPS macro now sets these defaults in struct drm_driver. Using DRM_GEM_CMA_DRIVER_OPS introduces several changes: the driver now sets .gem_create_object to drm_cma_gem_create_object_default_funcs(), which sets CMA GEM object functions. GEM object functions implement the rsp operations where possible. Corresponding interfaces in struct drm_driver are cleared. Prime import now uses drm_gem_cma_prime_import_sg_table_vmap(), which maps the imported buffer upon import. Mmap operations are performed by drm_gem_prime_mmap(), which goes through GEM file operations. These changes have been part of the aspeed driver for some time. Signed-off-by: Thomas Zimmermann Acked-by: Emil Velikov --- drivers/gpu/drm/zte/zx_drm_drv.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/drivers/gpu/drm/zte/zx_drm_drv.c b/drivers/gpu/drm/zte/zx_drm_drv.c index 1141c1ed1ed04..31014a451f8bd 100644 --- a/drivers/gpu/drm/zte/zx_drm_drv.c +++ b/drivers/gpu/drm/zte/zx_drm_drv.c @@ -36,16 +36,7 @@ DEFINE_DRM_GEM_CMA_FOPS(zx_drm_fops); static struct drm_driver zx_drm_driver = { .driver_features = DRIVER_GEM | DRIVER_MODESET | DRIVER_ATOMIC, - .gem_free_object_unlocked = drm_gem_cma_free_object, - .gem_vm_ops = &drm_gem_cma_vm_ops, - .dumb_create = drm_gem_cma_dumb_create, - .prime_handle_to_fd = drm_gem_prime_handle_to_fd, - .prime_fd_to_handle = drm_gem_prime_fd_to_handle, - .gem_prime_get_sg_table = drm_gem_cma_prime_get_sg_table, - .gem_prime_import_sg_table = drm_gem_cma_prime_import_sg_table, - .gem_prime_vmap = drm_gem_cma_prime_vmap, - .gem_prime_vunmap = drm_gem_cma_prime_vunmap, - .gem_prime_mmap = drm_gem_cma_prime_mmap, + DRM_GEM_CMA_DRIVER_OPS, .fops = &zx_drm_fops, .name = "zx-vou", .desc = "ZTE VOU Controller DRM",