From patchwork Wed Dec 15 09:51:16 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 12696225 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 CB425C433F5 for ; Wed, 15 Dec 2021 09:54:21 +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=7z5jWjWGgunYNMwN3IV2jfvfhwdALbwHy2DQbNhwe2g=; b=J2NFzISw3/KQ/2 WWeG/Jw1poS9oOfXMr3CnVLlvWDNf491sSSuyNUqbG7a3BEZT17daBqL7YQwLKj8HQ1pnv5qkTA9i kgjbCN3s8chGhCNL7uolDap3VSzNm6lYhnu2m3/XF/gPu4Te3q7530+rErj5NUr0g0A9CIgk67ega 3KJzISmLoteqGNG+wrQ69c3fUGfaj2iegthevuIGTpIF/WY3P/uxNJWSum45ZmUIxadfmaS1Yrk9v ZxGl5YedLq9WsNVJYEGKedQC/c9rAv6EvQLe4lK8QOsmEa1lrE+g89v7QopblR200usGYEdBm2D0b ZPJEMGDXgpJc63UHuGLg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mxQxo-00HazT-Dz; Wed, 15 Dec 2021 09:52:45 +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 1mxQwZ-00HaIh-RO; Wed, 15 Dec 2021 09:51:29 +0000 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailnew.nyi.internal (Postfix) with ESMTP id 256F6580189; Wed, 15 Dec 2021 04:51:27 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Wed, 15 Dec 2021 04:51:27 -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=DWisH74FtOO6D ZDcdH7fo1vJbnYXx33V9C3uMX9AN78=; b=ENqrJGi/DV9k310RNLr4UDCw96Svf 3f/OOVZ4aA6QCkIOPQcZjM55v4m6vRDoYm64Cz+vs6yrCwNcTvs23asnzcD5C54U keFiPE4qvdqWRxvS0dnRzOCpZcEpFyENnrMAh3725cZAC95GJjy5wMOHCXjl/9+E KrYG/xx9drtMTeqnDEoriXT+KHZ5hKSoa34yvHP81akhehQsEDPH91wezjg97aip wMK/WroWEic4ofygehBRUCXPoGIab/2FgOjA49CvYiobn4aU670ihDJwvEStun7U W3FZU1KYQ21K6b2SE2QhXeO8sW7BEUC2pWVL7nvkjvdyRCSkIS1ruc8gw== 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=DWisH74FtOO6DZDcdH7fo1vJbnYXx33V9C3uMX9AN78=; b=UXz82kFk Q6gE0JeKtxUrcGpKnnLDeBMbCNWBx3Ju51i1mxzj8GcmslViYNZ/1HnbJqB54H1L SIWomJHPNEJ9A6j3yDiZdwuUB4G/isIJfHJNL06siuzfJ3wZmfrMtHkNoAIYJKKG xXyYwtPznrtMEX3Jm/1v/YUVjvkAjsddP69LtJN6qiGoPQezlM+9xwULEGF/0sbh ECT8lFaKjubzrN3LidimAhDLc8cKk0CRWaR4e9QX07iljGRJFSOiFUG4zvwmoEy2 GXVBKHlEijeoFVaph6+Srz8awJDzWq8jKcO/gjVH1ymnG9BK/TGNhK02ePyXl5DI ysbTcatvMPAa1A== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvuddrledvgddtlecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofgjfhgggfestdekredtredttdenucfhrhhomhepofgrgihimhgv ucftihhprghrugcuoehmrgigihhmvgestggvrhhnohdrthgvtghhqeenucggtffrrghtth gvrhhnpedvkeelveefffekjefhffeuleetleefudeifeehuddugffghffhffehveevheeh vdenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehmrg igihhmvgestggvrhhnohdrthgvtghh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 15 Dec 2021 04:51:26 -0500 (EST) From: Maxime Ripard To: Florian Fainelli , Ray Jui , Nicolas Saenz Julienne , Daniel Vetter , David Airlie , Maarten Lankhorst , Thomas Zimmermann , Maxime Ripard , Scott Branden , Rob Herring , Frank Rowand Cc: bcm-kernel-feedback-list@broadcom.com, Dave Stevenson , Phil Elwell , Tim Gover , Dom Cobley , devicetree@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH RESEND v4 v5 3/4] drm/vc4: Remove conflicting framebuffers before callind bind_all Date: Wed, 15 Dec 2021 10:51:16 +0100 Message-Id: <20211215095117.176435-4-maxime@cerno.tech> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211215095117.176435-1-maxime@cerno.tech> References: <20211215095117.176435-1-maxime@cerno.tech> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211215_015128_029770_0CDF6DD6 X-CRM114-Status: GOOD ( 11.09 ) 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. Acked-by: Nicolas Saenz Julienne 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 d3cae84a4c4e..86c61ee120b7 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;