Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp564312yba; Thu, 18 Apr 2019 06:06:47 -0700 (PDT) X-Google-Smtp-Source: APXvYqyIAjJkGamvlX1lxai+y8wf2Zu6n1lm+HdEVpNk3HRlxcSxVWavXKscXft9wME8WhBpjjTr X-Received: by 2002:a63:6ac1:: with SMTP id f184mr83896953pgc.25.1555592807238; Thu, 18 Apr 2019 06:06:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555592807; cv=none; d=google.com; s=arc-20160816; b=o+aRLquFoZH7fx9fpxAssZJBW4Qmo89vs5rib5EcniME/4O5xv8BBsk/aEsrWecxzI JkDvnOA3gsIB75IyinxoSkBi7VIMgFc0Ec1IXn/jApH2BJh7r6SxINwYxZt3NfOxTw5A lqZ5GIGeNv+d+ZSIBKaE6F7YPtDNWUHkmjxn7GY7a2XxSWbfjvoVkdpMl2Xc60EnZ8n9 roDrhU5nai53EmMZkfDGttdZbLQg/gwEP5P+wTUPc+IEQCvu8vS4900BWchW0su1wv4N 8b/XRKm/s/E+iKrEhB4GTA7HCzQiRIRxOldJpirwy9II+jTAH8IF31FnUbiwPMecIHOD KtkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=DsxJ6ZU3On+u6eOmemDjDOA079iEBKoUKDWNIMpTL0A=; b=vmC0+C/vHrVDV3hUuK9E0MX2C4ZZHVSLC9sS6dtXEjUR2IYwAmMqsQ9K04Brwk5fpt eItfVEOCmmjeM+XZqZcYQYFleiF4YzcW+JMrJrxbabp0rzYlbiGhgVOOvO0NzrQ8Dwhx qg9vinUaIGT6rW/BqDgSY1qTRQchNvfPg1WCs6p0d2WW2CTFXlywxlMATePESL3wSQyA 9VpV7WcpXAI9PGWvT8SkiYkp1jvgCMU+aAMSMCw2FJ0sHPhnijcAUeu5qEISbR5pu0L7 HypipcV9HMiLQYdK4ykcBVeXq5L0XB35PTm9zyLRfvqOSbAuauLGY+2r5lyHKclawm4m VbcA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s205si1914988pgs.467.2019.04.18.06.06.29; Thu, 18 Apr 2019 06:06:47 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388582AbfDRNFd (ORCPT + 99 others); Thu, 18 Apr 2019 09:05:33 -0400 Received: from relay2-d.mail.gandi.net ([217.70.183.194]:59257 "EHLO relay2-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727807AbfDRNFc (ORCPT ); Thu, 18 Apr 2019 09:05:32 -0400 X-Originating-IP: 90.88.160.238 Received: from localhost.localdomain (aaubervilliers-681-1-42-238.w90-88.abo.wanadoo.fr [90.88.160.238]) (Authenticated sender: paul.kocialkowski@bootlin.com) by relay2-d.mail.gandi.net (Postfix) with ESMTPSA id 5B2514001A; Thu, 18 Apr 2019 13:05:29 +0000 (UTC) From: Paul Kocialkowski To: dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-sunxi@googlegroups.com Cc: Maxime Ripard , David Airlie , Daniel Vetter , Chen-Yu Tsai , Thomas Petazzoni , Paul Kocialkowski Subject: [PATCH v2] drm/sun4i: Use DRM_GEM_CMA_VMAP_DRIVER_OPS for GEM operations Date: Thu, 18 Apr 2019 15:05:09 +0200 Message-Id: <20190418130509.3569-1-paul.kocialkowski@bootlin.com> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Our driver makes a typical use of CMA, with GEM object allocated as GEM CMA objects. Use DRM_GEM_CMA_VMAP_DRIVER_OPS to describe the ops instead of duplicating them. Because DRM_GEM_CMA_VMAP_DRIVER_OPS implements a gem_create_object op which sets per-object funcs (drm_cma_gem_default_funcs), we can also get rid of free_object_unlocked and gem_vm_ops, which are superseded by the object funcs. Signed-off-by: Paul Kocialkowski --- Changes since v1: * Made sure our dumb_create overwrites the OPS's dumb_create. drivers/gpu/drm/sun4i/sun4i_drv.c | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/drivers/gpu/drm/sun4i/sun4i_drv.c b/drivers/gpu/drm/sun4i/sun4i_drv.c index 3ebd9f5e2719..c8c0ab3da972 100644 --- a/drivers/gpu/drm/sun4i/sun4i_drv.c +++ b/drivers/gpu/drm/sun4i/sun4i_drv.c @@ -52,22 +52,8 @@ static struct drm_driver sun4i_drv_driver = { .minor = 0, /* GEM Operations */ + DRM_GEM_CMA_VMAP_DRIVER_OPS, .dumb_create = drm_sun4i_gem_dumb_create, - .gem_free_object_unlocked = drm_gem_cma_free_object, - .gem_vm_ops = &drm_gem_cma_vm_ops, - - /* PRIME Operations */ - .prime_handle_to_fd = drm_gem_prime_handle_to_fd, - .prime_fd_to_handle = drm_gem_prime_fd_to_handle, - .gem_prime_import = drm_gem_prime_import, - .gem_prime_export = drm_gem_prime_export, - .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, - - /* Frame Buffer Operations */ }; static int sun4i_drv_bind(struct device *dev) -- 2.21.0