From patchwork Tue Jun 20 12:03:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Zimmermann X-Patchwork-Id: 13285755 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 67336EB64DB for ; Tue, 20 Jun 2023 12:12:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=4kNZA/XcUklvlx482AFkkNlUYor1SZitZc99N2rhnUE=; b=pxO3ywzX81jC2Y MthSMq/JEJIYOhYTGR/1kHZ3+UqqTfT/RoLqjirMagMJ+pvdMrXXMyyYNYTkvR4O3KjTSAhzmbDuN DPN2AdzSC+2Ue/QBO13oUjEhz6qxUA8itsB5Ss9ZEKFleiBdHF5dMfmT4d7QD7Fc4L/wjrL1emdEl sotKos0jPUG2FIMOOEzauTdECN2F272/omGS/fmrrXN3WZGvYJ3zvSMGBqYnfnzmQD5UqdsFuNTq2 hNmHr1zsrxYfXrscbfVWd+cfFJObW/r091ghPdpc5t6h+OY084Ab3iESeN1TMlXNYU0zbPgxafcEn njyYXLdX4qjccJlF9XMQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qBaDY-00BDD2-0h; Tue, 20 Jun 2023 12:12:16 +0000 Received: from smtp-out2.suse.de ([2001:67c:2178:6::1d]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qBaDU-00BD9z-2B; Tue, 20 Jun 2023 12:12:14 +0000 Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 474801F37C; Tue, 20 Jun 2023 12:12:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1687263125; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=r6XkXAfdTUAGyLfwxszMC+bPXZ6kElStSDtG0UQxN1E=; b=A6beC6BVgirwu2Nw6CAZoiZ+VtfjqlphCPYhDWtl086Q2zysAjHpUJR52bxGml3sE/LPtP fC/Q9d8KdGkR4PrsuycQq34ZK9WEf24S6Glm5hnKGjNKK2tBclijN2Ro50jfnloE7G/SFp 4GZSglu94+iYKv4/Pr6MJBbr5gXwMI4= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1687263125; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=r6XkXAfdTUAGyLfwxszMC+bPXZ6kElStSDtG0UQxN1E=; b=ddLksiyxF2xqH1d02sVvi1XsKFHI/V32xC1Bne50Xs5i2I3cUnMz8dHj0IMYK3dvKj+7X8 be2p7SWOimda1cAQ== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 04C8B133A9; Tue, 20 Jun 2023 12:12:04 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id IFqQO5SXkWSwEQAAMHmgww (envelope-from ); Tue, 20 Jun 2023 12:12:04 +0000 From: Thomas Zimmermann To: maarten.lankhorst@linux.intel.com, mripard@kernel.org, airlied@gmail.com, daniel@ffwll.ch, laurent.pinchart@ideasonboard.com, kieran.bingham+renesas@ideasonboard.com, hjc@rock-chips.com, heiko@sntech.de Cc: dri-devel@lists.freedesktop.org, linux-renesas-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, Thomas Zimmermann Subject: [PATCH 2/3] drm/rockchip: Resolve dependency in GEM DMA helpers Date: Tue, 20 Jun 2023 14:03:22 +0200 Message-ID: <20230620121202.28263-3-tzimmermann@suse.de> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230620121202.28263-1-tzimmermann@suse.de> References: <20230620121202.28263-1-tzimmermann@suse.de> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230620_051212_863602_5559FB8E X-CRM114-Status: GOOD ( 14.01 ) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+linux-rockchip=archiver.kernel.org@lists.infradead.org Remove the dependency on the GEM DMA helper library. Rockchip comes with its own implementation of the GEM interface. It only uses the VM callbacks in drm_gem_dma_vm_ops from the GEM DMA helpers. These are not DMA specific. Duplicate drm_gem_dma_vm_ops in rockchip and remove all dependencies on the GEM DMA helper library. Signed-off-by: Thomas Zimmermann --- drivers/gpu/drm/rockchip/Kconfig | 1 - drivers/gpu/drm/rockchip/rockchip_drm_drv.c | 2 +- drivers/gpu/drm/rockchip/rockchip_drm_gem.c | 8 ++++++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/rockchip/Kconfig b/drivers/gpu/drm/rockchip/Kconfig index 1bf3e2829cd07..5f49cd0210e6b 100644 --- a/drivers/gpu/drm/rockchip/Kconfig +++ b/drivers/gpu/drm/rockchip/Kconfig @@ -2,7 +2,6 @@ config DRM_ROCKCHIP tristate "DRM Support for Rockchip" depends on DRM && ROCKCHIP_IOMMU - select DRM_GEM_DMA_HELPER select DRM_KMS_HELPER select DRM_PANEL select VIDEOMODE_HELPERS diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_drv.c b/drivers/gpu/drm/rockchip/rockchip_drm_drv.c index b8cf89f0cc566..b090b8abb6637 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_drv.c +++ b/drivers/gpu/drm/rockchip/rockchip_drm_drv.c @@ -18,7 +18,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_gem.c b/drivers/gpu/drm/rockchip/rockchip_drm_gem.c index b8f8b45ebf594..acb6f122a2dca 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_gem.c +++ b/drivers/gpu/drm/rockchip/rockchip_drm_gem.c @@ -11,13 +11,17 @@ #include #include #include -#include #include #include #include "rockchip_drm_drv.h" #include "rockchip_drm_gem.h" +static const struct vm_operations_struct rockchip_gem_vm_ops = { + .open = drm_gem_vm_open, + .close = drm_gem_vm_close, +}; + static int rockchip_gem_iommu_map(struct rockchip_gem_object *rk_obj) { struct drm_device *drm = rk_obj->base.dev; @@ -276,7 +280,7 @@ static const struct drm_gem_object_funcs rockchip_gem_object_funcs = { .vmap = rockchip_gem_prime_vmap, .vunmap = rockchip_gem_prime_vunmap, .mmap = rockchip_drm_gem_object_mmap, - .vm_ops = &drm_gem_dma_vm_ops, + .vm_ops = &rockchip_gem_vm_ops, }; static struct rockchip_gem_object *