From patchwork Wed Nov 17 14:50:38 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 12692923 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id AAD95C433F5 for ; Wed, 17 Nov 2021 14:53:14 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 7905961269 for ; Wed, 17 Nov 2021 14:53:14 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 7905961269 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=cerno.tech Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org 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=A1e23QHnKuYW5c /TH3/C+yClkqcoxjP2zco1SICSRRpGIk5+cXptZyG2XMFc1ZezC7hiPJSEYk1tchnu0UyBgOmmK+E 74AV8fKSt0ifVMCIFDB/zsFSGQ/ZuWC5NY0Za6AVgNYNQKyUmZoaMJJVunlycH+R6C7KqiyL+ljel BI9ecMqWahbvGMmVdEkc/UW3YzP/fXt5QyM5BA6+YcDh4P6+MMiPsEfbd70McPD4dSUcur9bxErY+ Wr0fAS1pG15Imm00TgfLt9kN6nYwI7IGnpFQ2ATFphacVuuMrDiP9d0hCGcSnrsZqlwd+aYBHFAQS Jeb32GcVxdLgfeTgomHg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mnMHd-005EK3-WB; Wed, 17 Nov 2021 14:51:34 +0000 Received: from new1-smtp.messagingengine.com ([66.111.4.221]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mnMGw-005E7a-Mn; Wed, 17 Nov 2021 14:50:53 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailnew.nyi.internal (Postfix) with ESMTP id E9A0F580874; Wed, 17 Nov 2021 09:50:49 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Wed, 17 Nov 2021 09:50:49 -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=ATM+7D/krNYW4HVDb1QG53YCR1Run P1/yGlc7N2g06NiZBX+cVpBHVNzN4bHFDDxCyGzT0e/ZrqtxqWPfyEihIovf2OZm lNJPR1NEe/juvh+RbGD3s/Rj+7bCbEWj3EYGUQivmSgIikSQjYlKfJKN7DDOGmUJ nRf7jhUr0kAp8X6/J40983x8Gwmxs9qL9t6+P7/Xa7smKdR68bNPI0PwYXi5hnak FN3KTju4iArMD5HvxF5uGN5VjOcnYlqZWu6cLSOVN7OxZ2HXdMWLPSKPwNGnZGSV Qdbarz9LwK04Mb9WhtO/OmfUWriVOEaxLCXCf7M7dqdVW5Htk6LwLrGlA== 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=gweAVR6U 0fi/f4CPRy4xUsCFgy9tsEawncK/81xV6AgLwUOv0xzn1r+FSI04m07JGwWW/Jwm DK12x2ywVZZWj4al8OE7ko1wDahLt2E+Y/7aDhw+4Xlf1Jwrb1TRSzSfYfT6xHu8 Z6URqx9WpX1E6k309xFqP4kDGOaDUuRxj9nN3Of6vRVn2AjOQDiCrDloR7Wx552o B2kieFRVCqxIp4N9YLS+Xt/sZKP8KZPuxjJhUVIQ525z32NC3oqPR37UFAAMlI8u u3NVFqamfVkFWUOrQu9yatyxmLv1Pz/0Qocl+yfnV4LTa/YzjysaVivQw3cKLl2k BnH8p0pDripenA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvuddrfeeggdeifecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofgjfhgggfestdekredtredttdenucfhrhhomhepofgrgihimhgv ucftihhprghrugcuoehmrgigihhmvgestggvrhhnohdrthgvtghhqeenucggtffrrghtth gvrhhnpedvkeelveefffekjefhffeuleetleefudeifeehuddugffghffhffehveevheeh vdenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehmrg igihhmvgestggvrhhnohdrthgvtghh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 17 Nov 2021 09:50:48 -0500 (EST) From: Maxime Ripard To: Scott Branden , Nicolas Saenz Julienne , Rob Herring , Frank Rowand , Ray Jui , Florian Fainelli , Daniel Vetter , David Airlie , Maarten Lankhorst , Thomas Zimmermann , Maxime Ripard Cc: linux-rpi-kernel@lists.infradead.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, Dave Stevenson , Phil Elwell , Tim Gover , Dom Cobley , devicetree@vger.kernel.org, bcm-kernel-feedback-list@broadcom.com Subject: [PATCH 3/5] drm/vc4: Remove conflicting framebuffers before callind bind_all Date: Wed, 17 Nov 2021 15:50:38 +0100 Message-Id: <20211117145040.334827-4-maxime@cerno.tech> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211117145040.334827-1-maxime@cerno.tech> References: <20211117145040.334827-1-maxime@cerno.tech> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211117_065050_867572_62C16BD8 X-CRM114-Status: GOOD ( 12.07 ) 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;