From patchwork Fri Dec 3 13:51:25 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 12694709 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 3546FC433F5 for ; Fri, 3 Dec 2021 13:54:05 +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=vGdrQJSXBc4evTNO+ybbN3rMSmbfdlpViz639LiMKjk=; b=3iXAMMwiVW4SNp 72Avc0S7+t8qdWXwbFp/BePJEXBvrT/IvS8TnMj1zjvH+2skLMX3AdFUPuduWYG3DUhD+jpQRoozM vDwHOuA9Sn4QEtkZgGktmVFEpqeK4KONBXZr0805KBYayixbqpUNMvIKfGfwjKn234gGvHc5ORPV2 FJOXtHZTPOFM0iceZSzIHd36Miov2bER66yJGDaxc9xL3zZpNP5jzQcwKnKwg6oAiZasypHCEsJwa WB+GSvv2BNfBXUwmXjkweAXrubVnle6/hN+ZubijdTT5WbqUsZq6+/6BMZ+o5Q47p1TdYQxKzzZSG idVboADR95qSIMrd9dBw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mt8z9-00G3tP-5w; Fri, 03 Dec 2021 13:52:23 +0000 Received: from new2-smtp.messagingengine.com ([66.111.4.224]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mt8yN-00G3Yu-CZ; Fri, 03 Dec 2021 13:51:36 +0000 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailnew.nyi.internal (Postfix) with ESMTP id A67895800E3; Fri, 3 Dec 2021 08:51:34 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Fri, 03 Dec 2021 08:51:34 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cerno.tech; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm1; bh=qzonQ7o9ZUVo8 KUbjrot/21pyteCYG+CTBgNW3fAN9E=; b=EfZuJi27liTCfWjlQqmjBzt74HNdk xazXacFE3NahqCyNp/XNeCaaxm097r5duNBDEhdzY0Uak1lZuSkxQpQ5By0okgRo LC8ynN21c6BYz7Rd3kBaetghlu7NHJNw0ldthqFY1svY7vMxEhqazEQtANIhIlrV vsnMUf/cm8HgPsZhIKRxwFZT/L9DCf8VO5z4eURUru2G4+dimdtDKBD2yv458Bvu aSki6Fc43xSn4+fTIuZ65HptoY9G5vyK901iAEpdaoS/4kA5iIGk7rSqeoPaYJ/T u83QcNTBK0grtGk3mXWwWrZc/uDzcfhF/AUFPiUIHXq83Kq8naRgINkHQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; bh=qzonQ7o9ZUVo8KUbjrot/21pyteCYG+CTBgNW3fAN9E=; b=AeX+9Fr+ gECxhwVDigZMK7Owxc+I1xm3IfXD2TCMd3fV2w1g7jXhclKKYXmT18XHfLPm9e7l XGOlZ6PHFwfU9F9tclTgueybZXgH964DSIf+QiNQxbCmSl23BQkI2auP/nsYD8UN otA77hxyjJ2c+C2CLI4H4yEyvidSBLwh7dXaYJFbtyuK8fPhoKhAjByqzMmCpBag ZITHBM+jgqNBKYkcG350GziqNIqVmThR1Lrrhm8FdFcCIBzNaaMdqSDXIDzkbNuG lVMfN9EPZo23lUScOlYUDLcTeEraLip/3I0VHgKPW7c0nN5pw2rRbhY+PnrOEy3l WFSQd6vpDBZD0w== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvuddrieejgdehlecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofgjfhgggfestdekredtredttdenucfhrhhomhepofgrgihimhgv ucftihhprghrugcuoehmrgigihhmvgestggvrhhnohdrthgvtghhqeenucggtffrrghtth gvrhhnpedvkeelveefffekjefhffeuleetleefudeifeehuddugffghffhffehveevheeh vdenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehmrg igihhmvgestggvrhhnohdrthgvtghh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 3 Dec 2021 08:51:33 -0500 (EST) From: Maxime Ripard To: Ray Jui , Scott Branden , Maarten Lankhorst , Thomas Zimmermann , Maxime Ripard , Rob Herring , Frank Rowand , Florian Fainelli , Nicolas Saenz Julienne , Daniel Vetter , David Airlie Cc: Dave Stevenson , Phil Elwell , Tim Gover , Dom Cobley , linux-rpi-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, dri-devel@lists.freedesktop.org, bcm-kernel-feedback-list@broadcom.com Subject: [PATCH v2 2/3] drm/vc4: Remove conflicting framebuffers before callind bind_all Date: Fri, 3 Dec 2021 14:51:25 +0100 Message-Id: <20211203135126.700165-3-maxime@cerno.tech> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211203135126.700165-1-maxime@cerno.tech> References: <20211203135126.700165-1-maxime@cerno.tech> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211203_055135_538709_C802143C X-CRM114-Status: GOOD ( 11.41 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The bind hooks will modify their controller registers, so simplefb is going to be unusable anyway. Let's avoid any transient state where it could still be in the system but no longer functionnal. Signed-off-by: Maxime Ripard --- drivers/gpu/drm/vc4/vc4_drv.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/vc4/vc4_drv.c b/drivers/gpu/drm/vc4/vc4_drv.c index 16abc3a3d601..8ab89f805826 100644 --- a/drivers/gpu/drm/vc4/vc4_drv.c +++ b/drivers/gpu/drm/vc4/vc4_drv.c @@ -251,6 +251,10 @@ static int vc4_drm_bind(struct device *dev) if (ret) return ret; + ret = drm_aperture_remove_framebuffers(false, &vc4_drm_driver); + if (ret) + return ret; + ret = component_bind_all(dev, drm); if (ret) return ret; @@ -259,10 +263,6 @@ static int vc4_drm_bind(struct device *dev) if (ret) goto unbind_all; - ret = drm_aperture_remove_framebuffers(false, &vc4_drm_driver); - if (ret) - goto unbind_all; - ret = vc4_kms_load(drm); if (ret < 0) goto unbind_all;