From mboxrd@z Thu Jan 1 00:00:00 1970 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 451F6C433F5 for ; Tue, 11 Jan 2022 13:01:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240214AbiAKNBw (ORCPT ); Tue, 11 Jan 2022 08:01:52 -0500 Received: from wnew1-smtp.messagingengine.com ([64.147.123.26]:53951 "EHLO wnew1-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239661AbiAKNBt (ORCPT ); Tue, 11 Jan 2022 08:01:49 -0500 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailnew.west.internal (Postfix) with ESMTP id AB3202B000AA; Tue, 11 Jan 2022 08:01:47 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Tue, 11 Jan 2022 08:01:49 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cerno.tech; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm1; bh=t/jyaTfuGX6T5u75/bYTe7A2rVR H5GYboErwsWPA6rE=; b=kx30Q9n7m32+u8SHiRHmXjmosz7FoQfkUP1T9hoWVvA YvzyGLSDM1giV+3UbFMqdvEhmocpa0uerfDoKgBwoIXz+7kQkEhwqUgt8l60uX3F mRLMNsN+QmgV4sZZOGxSgL/Z2CTEvazPnItv0nIXxXj6wjoh9qc9GAhsqaUobACy 2zIMEApg+UTaDvOWEQUvT2cYqAjt1EziRRf1KhuO0oSOs3TxY9Jiz8BWzBz9L2tn zu0SzQUF07HDHnYw0zP50SVNqswAmu2jTUo/bgP6wLnIaEQVTkFOqYrmRjk1jtSl eEdd2y3cfSumuTJ3oa2+Go80on7h7z8EW/BHURE3ENQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type: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=t/jyaT fuGX6T5u75/bYTe7A2rVRH5GYboErwsWPA6rE=; b=d4FzuOZb/w9q75M0aNRZ6v zWTwmMMDLgFsKbruGT9IF38yO/kfoiquCSk3EDruAKQS5z8iIlS7TFnRb7pKYOGn Xxuhgc9D2bhl6uDzFM5mIGrOqfvm/VwlcwwBE/THZxfXXRPl7651FXtWhPd7+47i YGhao5EQIZM/vDSazpWrvfEGkBwmF9uV9kWwjTDMDkUyKoMSWT0bMetC7RPs7dSm k6WKdnknlvr+e6QjhihUv5oOeof0AmsTSXWPmn7oeFoCVBt27DZfbjXGnK1UcEkd JkBiKTPP4pQlGFFkVMJirUh5Gl095UvjwVneUaMjo0NfSxDeWa//fpc5sG/BEXHA == X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvuddrudehfedggeejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvffukfhfgggtuggjsehgtderredttddvnecuhfhrohhmpeforgigihhm vgcutfhiphgrrhguuceomhgrgihimhgvsegtvghrnhhordhtvggthheqnecuggftrfgrth htvghrnhepleekgeehhfdutdeljefgleejffehfffgieejhffgueefhfdtveetgeehieeh gedunecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepmh grgihimhgvsegtvghrnhhordhtvggthh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 11 Jan 2022 08:01:45 -0500 (EST) Date: Tue, 11 Jan 2022 14:01:44 +0100 From: Maxime Ripard To: Thomas Zimmermann Cc: Florian Fainelli , Ray Jui , Nicolas Saenz Julienne , Daniel Vetter , David Airlie , Maarten Lankhorst , Scott Branden , Rob Herring , Frank Rowand , devicetree@vger.kernel.org, Dom Cobley , Tim Gover , Dave Stevenson , dri-devel@lists.freedesktop.org, bcm-kernel-feedback-list@broadcom.com, linux-rpi-kernel@lists.infradead.org, Phil Elwell , linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH RESEND v4 v5 4/4] drm/vc4: Notify the firmware when DRM is in charge Message-ID: <20220111130144.y2fs74tkpe7ecada@houat> References: <20211215095117.176435-1-maxime@cerno.tech> <20211215095117.176435-5-maxime@cerno.tech> <1a42431d-59bc-53e0-199b-815c96f97a29@suse.de> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="eknbquhrmytuqbad" Content-Disposition: inline In-Reply-To: <1a42431d-59bc-53e0-199b-815c96f97a29@suse.de> Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org --eknbquhrmytuqbad Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi Thomas, On Tue, Jan 11, 2022 at 10:38:36AM +0100, Thomas Zimmermann wrote: > Hi >=20 > Am 15.12.21 um 10:51 schrieb Maxime Ripard: > > Once the call to drm_fb_helper_remove_conflicting_framebuffers() has > > been made, simplefb has been unregistered and the KMS driver is entirely > > in charge of the display. > >=20 > > Thus, we can notify the firmware it can free whatever resource it was > > using to maintain simplefb functional. > >=20 > > Signed-off-by: Maxime Ripard > > --- > > drivers/gpu/drm/vc4/vc4_drv.c | 22 ++++++++++++++++++++++ > > 1 file changed, 22 insertions(+) > >=20 > > diff --git a/drivers/gpu/drm/vc4/vc4_drv.c b/drivers/gpu/drm/vc4/vc4_dr= v.c > > index 86c61ee120b7..a03053c8e22c 100644 > > --- a/drivers/gpu/drm/vc4/vc4_drv.c > > +++ b/drivers/gpu/drm/vc4/vc4_drv.c > > @@ -37,6 +37,8 @@ > > #include > > #include > > +#include > > + > > #include "uapi/drm/vc4_drm.h" > > #include "vc4_drv.h" > > @@ -215,6 +217,7 @@ static void vc4_match_add_drivers(struct device *de= v, > > static int vc4_drm_bind(struct device *dev) > > { > > struct platform_device *pdev =3D to_platform_device(dev); > > + struct rpi_firmware *firmware =3D NULL; > > struct drm_device *drm; > > struct vc4_dev *vc4; > > struct device_node *node; > > @@ -251,10 +254,29 @@ static int vc4_drm_bind(struct device *dev) > > if (ret) > > return ret; > > + node =3D of_find_compatible_node(NULL, NULL, "raspberrypi,bcm2835-fir= mware"); > > + if (node) { > > + firmware =3D rpi_firmware_get(node); > > + of_node_put(node); > > + > > + if (!firmware) > > + return -EPROBE_DEFER; > > + } > > + >=20 > The code is >=20 > Acked-by: Thomas Zimmermann Thanks for your review > Just for my understanding: >=20 > You retrieve the firmware before killing simpledrm simply to keep the > display on if it fails, right? Exactly > What's the possible error that would justify a retry (via EPROBE_DEFER)? The firmware there is backed by a driver that might not have probed yet, in which case we just want to retry later on Maxime --eknbquhrmytuqbad Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYKAB0WIQRcEzekXsqa64kGDp7j7w1vZxhRxQUCYd1/uAAKCRDj7w1vZxhR xeldAQDChNSM76RAq7W2gPVkPoweMGpJz6/TGfj4Pi+ZULSuwQD8CmSAhoMN2pve 3O2WrSSFt3UJzozo/w6KXpBiFXR9+A8= =Lqs6 -----END PGP SIGNATURE----- --eknbquhrmytuqbad-- From mboxrd@z Thu Jan 1 00:00:00 1970 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (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 61843C433EF for ; Tue, 11 Jan 2022 13:01:52 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 250A610E50E; Tue, 11 Jan 2022 13:01:51 +0000 (UTC) Received: from wnew1-smtp.messagingengine.com (wnew1-smtp.messagingengine.com [64.147.123.26]) by gabe.freedesktop.org (Postfix) with ESMTPS id CDF3410E50E for ; Tue, 11 Jan 2022 13:01:49 +0000 (UTC) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailnew.west.internal (Postfix) with ESMTP id AB3202B000AA; Tue, 11 Jan 2022 08:01:47 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Tue, 11 Jan 2022 08:01:49 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cerno.tech; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm1; bh=t/jyaTfuGX6T5u75/bYTe7A2rVR H5GYboErwsWPA6rE=; b=kx30Q9n7m32+u8SHiRHmXjmosz7FoQfkUP1T9hoWVvA YvzyGLSDM1giV+3UbFMqdvEhmocpa0uerfDoKgBwoIXz+7kQkEhwqUgt8l60uX3F mRLMNsN+QmgV4sZZOGxSgL/Z2CTEvazPnItv0nIXxXj6wjoh9qc9GAhsqaUobACy 2zIMEApg+UTaDvOWEQUvT2cYqAjt1EziRRf1KhuO0oSOs3TxY9Jiz8BWzBz9L2tn zu0SzQUF07HDHnYw0zP50SVNqswAmu2jTUo/bgP6wLnIaEQVTkFOqYrmRjk1jtSl eEdd2y3cfSumuTJ3oa2+Go80on7h7z8EW/BHURE3ENQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type: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=t/jyaT fuGX6T5u75/bYTe7A2rVRH5GYboErwsWPA6rE=; b=d4FzuOZb/w9q75M0aNRZ6v zWTwmMMDLgFsKbruGT9IF38yO/kfoiquCSk3EDruAKQS5z8iIlS7TFnRb7pKYOGn Xxuhgc9D2bhl6uDzFM5mIGrOqfvm/VwlcwwBE/THZxfXXRPl7651FXtWhPd7+47i YGhao5EQIZM/vDSazpWrvfEGkBwmF9uV9kWwjTDMDkUyKoMSWT0bMetC7RPs7dSm k6WKdnknlvr+e6QjhihUv5oOeof0AmsTSXWPmn7oeFoCVBt27DZfbjXGnK1UcEkd JkBiKTPP4pQlGFFkVMJirUh5Gl095UvjwVneUaMjo0NfSxDeWa//fpc5sG/BEXHA == X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvuddrudehfedggeejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvffukfhfgggtuggjsehgtderredttddvnecuhfhrohhmpeforgigihhm vgcutfhiphgrrhguuceomhgrgihimhgvsegtvghrnhhordhtvggthheqnecuggftrfgrth htvghrnhepleekgeehhfdutdeljefgleejffehfffgieejhffgueefhfdtveetgeehieeh gedunecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepmh grgihimhgvsegtvghrnhhordhtvggthh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 11 Jan 2022 08:01:45 -0500 (EST) Date: Tue, 11 Jan 2022 14:01:44 +0100 From: Maxime Ripard To: Thomas Zimmermann Subject: Re: [PATCH RESEND v4 v5 4/4] drm/vc4: Notify the firmware when DRM is in charge Message-ID: <20220111130144.y2fs74tkpe7ecada@houat> References: <20211215095117.176435-1-maxime@cerno.tech> <20211215095117.176435-5-maxime@cerno.tech> <1a42431d-59bc-53e0-199b-815c96f97a29@suse.de> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="eknbquhrmytuqbad" Content-Disposition: inline In-Reply-To: <1a42431d-59bc-53e0-199b-815c96f97a29@suse.de> X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, Nicolas Saenz Julienne , Dom Cobley , Scott Branden , Dave Stevenson , David Airlie , Ray Jui , dri-devel@lists.freedesktop.org, Rob Herring , Florian Fainelli , bcm-kernel-feedback-list@broadcom.com, Tim Gover , Daniel Vetter , Frank Rowand , Phil Elwell , linux-arm-kernel@lists.infradead.org, linux-rpi-kernel@lists.infradead.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" --eknbquhrmytuqbad Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi Thomas, On Tue, Jan 11, 2022 at 10:38:36AM +0100, Thomas Zimmermann wrote: > Hi >=20 > Am 15.12.21 um 10:51 schrieb Maxime Ripard: > > Once the call to drm_fb_helper_remove_conflicting_framebuffers() has > > been made, simplefb has been unregistered and the KMS driver is entirely > > in charge of the display. > >=20 > > Thus, we can notify the firmware it can free whatever resource it was > > using to maintain simplefb functional. > >=20 > > Signed-off-by: Maxime Ripard > > --- > > drivers/gpu/drm/vc4/vc4_drv.c | 22 ++++++++++++++++++++++ > > 1 file changed, 22 insertions(+) > >=20 > > diff --git a/drivers/gpu/drm/vc4/vc4_drv.c b/drivers/gpu/drm/vc4/vc4_dr= v.c > > index 86c61ee120b7..a03053c8e22c 100644 > > --- a/drivers/gpu/drm/vc4/vc4_drv.c > > +++ b/drivers/gpu/drm/vc4/vc4_drv.c > > @@ -37,6 +37,8 @@ > > #include > > #include > > +#include > > + > > #include "uapi/drm/vc4_drm.h" > > #include "vc4_drv.h" > > @@ -215,6 +217,7 @@ static void vc4_match_add_drivers(struct device *de= v, > > static int vc4_drm_bind(struct device *dev) > > { > > struct platform_device *pdev =3D to_platform_device(dev); > > + struct rpi_firmware *firmware =3D NULL; > > struct drm_device *drm; > > struct vc4_dev *vc4; > > struct device_node *node; > > @@ -251,10 +254,29 @@ static int vc4_drm_bind(struct device *dev) > > if (ret) > > return ret; > > + node =3D of_find_compatible_node(NULL, NULL, "raspberrypi,bcm2835-fir= mware"); > > + if (node) { > > + firmware =3D rpi_firmware_get(node); > > + of_node_put(node); > > + > > + if (!firmware) > > + return -EPROBE_DEFER; > > + } > > + >=20 > The code is >=20 > Acked-by: Thomas Zimmermann Thanks for your review > Just for my understanding: >=20 > You retrieve the firmware before killing simpledrm simply to keep the > display on if it fails, right? Exactly > What's the possible error that would justify a retry (via EPROBE_DEFER)? The firmware there is backed by a driver that might not have probed yet, in which case we just want to retry later on Maxime --eknbquhrmytuqbad Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYKAB0WIQRcEzekXsqa64kGDp7j7w1vZxhRxQUCYd1/uAAKCRDj7w1vZxhR xeldAQDChNSM76RAq7W2gPVkPoweMGpJz6/TGfj4Pi+ZULSuwQD8CmSAhoMN2pve 3O2WrSSFt3UJzozo/w6KXpBiFXR9+A8= =Lqs6 -----END PGP SIGNATURE----- --eknbquhrmytuqbad-- From mboxrd@z Thu Jan 1 00:00:00 1970 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 6C485C433EF for ; Tue, 11 Jan 2022 13:03:15 +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-Type: List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: In-Reply-To:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date: Reply-To:Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date :Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=hCPdRqXoTu2W2NlOIXwlYMz0tQhZle5lR8KiVitKDRk=; b=Q0mHu/v6rW7py03RkDFXYcVh31 wGNxeF8UZyftF3PzgnuspLf0zYvjAx5n0tgxdbJ2aRofqQzQ5SiKchUFD8DI6ptxSRWsW7U53N7m9 39okwt2hoqQLbUu7c/mA0+c+epYtq4aLDxhjLFSvh+zTgTqd4Dn0wzZvCgEVxJPr1/6b3wQPDnIlN JBQgs5h92E/ctyNgBF/Bl3t7MrVcX+5zJFbTBRxRv9IZFTxa+pbJykoWgCjbNY+hgVVtfs/U9oW1Y beM9PJO8ui8CxZdOxRKX1BdgkWu0VHEgh0ODCMEtZDAhIZksfdmdH2XPlSErFDJXx+TkUNfOhBbaN YLz+kxNw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1n7Gmf-00GHBu-OE; Tue, 11 Jan 2022 13:01:53 +0000 Received: from wnew1-smtp.messagingengine.com ([64.147.123.26]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1n7Gmc-00GHBG-8g; Tue, 11 Jan 2022 13:01:51 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailnew.west.internal (Postfix) with ESMTP id AB3202B000AA; Tue, 11 Jan 2022 08:01:47 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Tue, 11 Jan 2022 08:01:49 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cerno.tech; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm1; bh=t/jyaTfuGX6T5u75/bYTe7A2rVR H5GYboErwsWPA6rE=; b=kx30Q9n7m32+u8SHiRHmXjmosz7FoQfkUP1T9hoWVvA YvzyGLSDM1giV+3UbFMqdvEhmocpa0uerfDoKgBwoIXz+7kQkEhwqUgt8l60uX3F mRLMNsN+QmgV4sZZOGxSgL/Z2CTEvazPnItv0nIXxXj6wjoh9qc9GAhsqaUobACy 2zIMEApg+UTaDvOWEQUvT2cYqAjt1EziRRf1KhuO0oSOs3TxY9Jiz8BWzBz9L2tn zu0SzQUF07HDHnYw0zP50SVNqswAmu2jTUo/bgP6wLnIaEQVTkFOqYrmRjk1jtSl eEdd2y3cfSumuTJ3oa2+Go80on7h7z8EW/BHURE3ENQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type: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=t/jyaT fuGX6T5u75/bYTe7A2rVRH5GYboErwsWPA6rE=; b=d4FzuOZb/w9q75M0aNRZ6v zWTwmMMDLgFsKbruGT9IF38yO/kfoiquCSk3EDruAKQS5z8iIlS7TFnRb7pKYOGn Xxuhgc9D2bhl6uDzFM5mIGrOqfvm/VwlcwwBE/THZxfXXRPl7651FXtWhPd7+47i YGhao5EQIZM/vDSazpWrvfEGkBwmF9uV9kWwjTDMDkUyKoMSWT0bMetC7RPs7dSm k6WKdnknlvr+e6QjhihUv5oOeof0AmsTSXWPmn7oeFoCVBt27DZfbjXGnK1UcEkd JkBiKTPP4pQlGFFkVMJirUh5Gl095UvjwVneUaMjo0NfSxDeWa//fpc5sG/BEXHA == X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvuddrudehfedggeejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvffukfhfgggtuggjsehgtderredttddvnecuhfhrohhmpeforgigihhm vgcutfhiphgrrhguuceomhgrgihimhgvsegtvghrnhhordhtvggthheqnecuggftrfgrth htvghrnhepleekgeehhfdutdeljefgleejffehfffgieejhffgueefhfdtveetgeehieeh gedunecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepmh grgihimhgvsegtvghrnhhordhtvggthh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 11 Jan 2022 08:01:45 -0500 (EST) Date: Tue, 11 Jan 2022 14:01:44 +0100 From: Maxime Ripard To: Thomas Zimmermann Cc: Florian Fainelli , Ray Jui , Nicolas Saenz Julienne , Daniel Vetter , David Airlie , Maarten Lankhorst , Scott Branden , Rob Herring , Frank Rowand , devicetree@vger.kernel.org, Dom Cobley , Tim Gover , Dave Stevenson , dri-devel@lists.freedesktop.org, bcm-kernel-feedback-list@broadcom.com, linux-rpi-kernel@lists.infradead.org, Phil Elwell , linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH RESEND v4 v5 4/4] drm/vc4: Notify the firmware when DRM is in charge Message-ID: <20220111130144.y2fs74tkpe7ecada@houat> References: <20211215095117.176435-1-maxime@cerno.tech> <20211215095117.176435-5-maxime@cerno.tech> <1a42431d-59bc-53e0-199b-815c96f97a29@suse.de> MIME-Version: 1.0 In-Reply-To: <1a42431d-59bc-53e0-199b-815c96f97a29@suse.de> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220111_050150_362041_268BC79F X-CRM114-Status: GOOD ( 26.64 ) 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: , Content-Type: multipart/mixed; boundary="===============5757131549858251061==" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org --===============5757131549858251061== Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="eknbquhrmytuqbad" Content-Disposition: inline --eknbquhrmytuqbad Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi Thomas, On Tue, Jan 11, 2022 at 10:38:36AM +0100, Thomas Zimmermann wrote: > Hi >=20 > Am 15.12.21 um 10:51 schrieb Maxime Ripard: > > Once the call to drm_fb_helper_remove_conflicting_framebuffers() has > > been made, simplefb has been unregistered and the KMS driver is entirely > > in charge of the display. > >=20 > > Thus, we can notify the firmware it can free whatever resource it was > > using to maintain simplefb functional. > >=20 > > Signed-off-by: Maxime Ripard > > --- > > drivers/gpu/drm/vc4/vc4_drv.c | 22 ++++++++++++++++++++++ > > 1 file changed, 22 insertions(+) > >=20 > > diff --git a/drivers/gpu/drm/vc4/vc4_drv.c b/drivers/gpu/drm/vc4/vc4_dr= v.c > > index 86c61ee120b7..a03053c8e22c 100644 > > --- a/drivers/gpu/drm/vc4/vc4_drv.c > > +++ b/drivers/gpu/drm/vc4/vc4_drv.c > > @@ -37,6 +37,8 @@ > > #include > > #include > > +#include > > + > > #include "uapi/drm/vc4_drm.h" > > #include "vc4_drv.h" > > @@ -215,6 +217,7 @@ static void vc4_match_add_drivers(struct device *de= v, > > static int vc4_drm_bind(struct device *dev) > > { > > struct platform_device *pdev =3D to_platform_device(dev); > > + struct rpi_firmware *firmware =3D NULL; > > struct drm_device *drm; > > struct vc4_dev *vc4; > > struct device_node *node; > > @@ -251,10 +254,29 @@ static int vc4_drm_bind(struct device *dev) > > if (ret) > > return ret; > > + node =3D of_find_compatible_node(NULL, NULL, "raspberrypi,bcm2835-fir= mware"); > > + if (node) { > > + firmware =3D rpi_firmware_get(node); > > + of_node_put(node); > > + > > + if (!firmware) > > + return -EPROBE_DEFER; > > + } > > + >=20 > The code is >=20 > Acked-by: Thomas Zimmermann Thanks for your review > Just for my understanding: >=20 > You retrieve the firmware before killing simpledrm simply to keep the > display on if it fails, right? Exactly > What's the possible error that would justify a retry (via EPROBE_DEFER)? The firmware there is backed by a driver that might not have probed yet, in which case we just want to retry later on Maxime --eknbquhrmytuqbad Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYKAB0WIQRcEzekXsqa64kGDp7j7w1vZxhRxQUCYd1/uAAKCRDj7w1vZxhR xeldAQDChNSM76RAq7W2gPVkPoweMGpJz6/TGfj4Pi+ZULSuwQD8CmSAhoMN2pve 3O2WrSSFt3UJzozo/w6KXpBiFXR9+A8= =Lqs6 -----END PGP SIGNATURE----- --eknbquhrmytuqbad-- --===============5757131549858251061== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel --===============5757131549858251061==--