From patchwork Wed Dec 15 09:51:14 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 12696224 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 53D44C433F5 for ; Wed, 15 Dec 2021 09:53:56 +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=g4VU7QQfK5xiXZoNMwRxk2+qi3zdWSE25aU8LjKyPAY=; b=g7iDSsz3YtOvSZ Pv1Cncd7HWE1ma+gaiuk8PP88wNNe4Y3V8cMtWfFm45uzpn8BDrStEvrTWFTwBV/xGp2QvzsAcluI Q8v8r0RzX552QW1H5t/SWvmoxaHCDeBpmXiW2KuZHFRZsYQ1rf/j8jE2HOBGb2xhNh4wW1rVhExSZ wfnH95EdT0cZ6WITdSN1elZV83auMWR8DOXXGwUa7ev6zTCXzSn2Y5zTSRPTmPTshJpJwbOFitXB+ RQX9kG30orBpiiJn4fzJKtiH6btLZZ5oGfs57fCSeba7NtUx9HGdQrGM3uwMNbjKkJloIny88Elmm GQKDodDWU1IEsPGeKXFg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mxQxQ-00HalE-2o; Wed, 15 Dec 2021 09:52:20 +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 1mxQwY-00HaEV-CH; Wed, 15 Dec 2021 09:51:27 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailnew.nyi.internal (Postfix) with ESMTP id DF7555800A0; Wed, 15 Dec 2021 04:51:22 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Wed, 15 Dec 2021 04:51:22 -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=ou27pVwzd7MS6 Se+Px0HBJeVzAhbZZsK9+FkURLYL6U=; b=NVlnRkm3pEGyt5bO7vWWKfphtS37T nuMxdqcp0qVacTli3qRSEX4fzBued8zzi60GuEGp04iJhH1i+2djXo/FiqSEaw9l xJSAIJ5guK/hRfWZT1+HIhGFytbYR+jWdqh3M7YUXvWjezYi/hkHGj5hr+RieaBb 08z5sbl12NNTIzvik+O64gQIGgUb5z+/ZIyXvlXz48fwQ4aMhE4KlbIA6CHJ2AiQ Lrbx9uUlaaScy2mAjRGnc24T43EDKyakHct6dtPtcDM/OKyBwmUwzD8CSyvThgYt AZl1WFfPO152oIYRCHzjmg654euliyqGpkRvCap12A1KEbF6a9klDobOQ== 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=ou27pVwzd7MS6Se+Px0HBJeVzAhbZZsK9+FkURLYL6U=; b=ilE5x5hI 7qot68lxNBZ9z2REUyVhaTjMlfpOr7znQ1K4bpWiBn5QsN8OLho0c2duKycHqw9Q 9U9PEAwuvCp9LX/AnfCE3LogPVT/Bhjha+dMInhU+iNiAKAzRA2Rz0grfu7e1GYc PaWxqUe+nyjizgrl4yKdT4xa/FXxMg+9PHIu1Xaao2o+PI8pMuLUtFQmrYAywCK8 Y2dfm+pHI7gmPtTAT1Cbjxo/66mYzso/VhgLP0oNTmmBjIvKu2WnU0rTwUGAoTnx EBrSWbY5IWbeHfBmpz45m/666cC4WTSBj1J7rUaBkcI7AwPbSYD/I7nFyGE7fyEY bqwimYgZxTfyEw== 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:22 -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 1/4] firmware: raspberrypi: Add RPI_FIRMWARE_NOTIFY_DISPLAY_DONE Date: Wed, 15 Dec 2021 10:51:14 +0100 Message-Id: <20211215095117.176435-2-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_015126_529952_4831F761 X-CRM114-Status: UNSURE ( 7.64 ) X-CRM114-Notice: Please train this message. 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 RPI_FIRMWARE_NOTIFY_DISPLAY_DONE firmware call allows to tell the firmware the kernel is in charge of the display now and the firmware can free whatever resources it was using. Acked-by: Nicolas Saenz Julienne Signed-off-by: Maxime Ripard --- include/soc/bcm2835/raspberrypi-firmware.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/soc/bcm2835/raspberrypi-firmware.h b/include/soc/bcm2835/raspberrypi-firmware.h index 73ad784fca96..811ea668c4a1 100644 --- a/include/soc/bcm2835/raspberrypi-firmware.h +++ b/include/soc/bcm2835/raspberrypi-firmware.h @@ -91,6 +91,7 @@ enum rpi_firmware_property_tag { RPI_FIRMWARE_GET_POE_HAT_VAL = 0x00030049, RPI_FIRMWARE_SET_POE_HAT_VAL = 0x00030050, RPI_FIRMWARE_NOTIFY_XHCI_RESET = 0x00030058, + RPI_FIRMWARE_NOTIFY_DISPLAY_DONE = 0x00030066, /* Dispmanx TAGS */ RPI_FIRMWARE_FRAMEBUFFER_ALLOCATE = 0x00040001, From patchwork Wed Dec 15 09:51:15 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 12696223 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 DDDBFC433EF for ; Wed, 15 Dec 2021 09:53:26 +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=6xQta2wb7JZwDzheUK7dvMXo+QQLqx0gUozc2WZh8w4=; b=ifl2r1DHwojS4+ v7I0RG5hAKAwT8VVg6O96TUB1fXVdqsMscQrQkJDV1gKDm6MGSUdlSXxjFuMwjj3zlKjw5gnuTv8f CWMdXjYgTA4k67n6kLOcGk5vgERmuYZGL1LaRkAemTThPxcYsFTrRM0WJc/i9Ln3rA4N/K2OoWKHQ 7JJzNWpWY+eRouDVWjgqGEaEg+LrsgEuxUqZkzB4+Qxafyv1F8S3DQcd8JYHmHUqJmUbV7D8uWz3F COlzv5lW8/ZV3hi+H7JppUsVFNcwUaqepxplvxB1oRZU7HTOf6lMr6X4+f9z/acxO+3prcBss3+qm iuV6rLxyfHs9DsGk6gMw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mxQx2-00HaYj-CA; Wed, 15 Dec 2021 09:51:56 +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 1mxQwX-00HaGt-Pz; Wed, 15 Dec 2021 09:51:27 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailnew.nyi.internal (Postfix) with ESMTP id 0E1CA580152; Wed, 15 Dec 2021 04:51:25 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Wed, 15 Dec 2021 04:51:25 -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=1H6NDako2j0Yo SdZSzMJDj+RXSZgat1EU93Whc14SYU=; b=a5wjuX893CbfOQzVfQWl+IVLB+Eav K9IhSaFZv2sWkTu8InjZZIcXRUadWqvkCTsvA7eK6Vk0pIAJyhQAG1mXHTYdccEL hjKyiOAsgt+N8Tf/09LqptW84jtiFSGfY47sPF8QkS0uBBe0ymLFDi7eAS5D94Xw bXmwrIPLrjv8oCDdT29fq5ZoKdklCitXaCgKRhU/gPqFBLeip6KAAfmJKvkBU8YS DraBY1GxJK5ZfOeb18CQn4/+bvgFERCQEBjM/VQz7MbIXcp1XKbGx2h1OKCloLDA 6ZvSVWjTJDTNhdsajz/z6fSxy11iook8X5Upb6r5zmOTKFiG39+iYYVPA== 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=1H6NDako2j0YoSdZSzMJDj+RXSZgat1EU93Whc14SYU=; b=JeFHN5of 9Ho38MYMUTPPfISw3mt34c140YK+vzQn/Sk7I2EJGQrBWUqQFRK9kkrGbMzUblkN da7EWHV3QAeukJj/XyEiPEAmaM4ELfHlCAEW4oRJp9hp43kPepglPHWPTsNTZ3NM fB/85CCEmbRS9EI/6ctOHdTqawu8cc6ZachRm1N65T+C19ytPqBZ4gqB1Z9tiR3K czPeni0kR7nFvHb4VGRJB+hbR1NXSM5ltwNmCFekdUlemgjOXija7lqCR1HbPeIl 5YCTmxo+nqC75yghrKgP8ztVbHPydu/s/b2r+qYnP9tOHIyvVY3KzTdAKIJ84pWY VxIvqfFGCsFHXA== 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:24 -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 2/4] drm/vc4: Support nomodeset Date: Wed, 15 Dec 2021 10:51:15 +0100 Message-Id: <20211215095117.176435-3-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_015125_970280_9F80C865 X-CRM114-Status: GOOD ( 11.29 ) 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 If we have nomodeset on the kernel command line we should have the firmware framebuffer driver kept as is and not try to load the full-blown KMS driver. In this case, let's just register the v3d driver. Signed-off-by: Maxime Ripard Reviewed-by: Thomas Zimmermann --- drivers/gpu/drm/vc4/vc4_drv.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/gpu/drm/vc4/vc4_drv.c b/drivers/gpu/drm/vc4/vc4_drv.c index 16abc3a3d601..d3cae84a4c4e 100644 --- a/drivers/gpu/drm/vc4/vc4_drv.c +++ b/drivers/gpu/drm/vc4/vc4_drv.c @@ -357,6 +357,9 @@ static int __init vc4_drm_register(void) { int ret; + if (drm_firmware_drivers_only()) + return -ENODEV; + ret = platform_register_drivers(component_drivers, ARRAY_SIZE(component_drivers)); if (ret) 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; From patchwork Wed Dec 15 09:51:17 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 12696226 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 B8992C433F5 for ; Wed, 15 Dec 2021 09:54: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=ShC/juX6KYPTz23WbQMhFgX5fUv6Hz47wtq25E2c+pY=; b=CLBhnIOy0Klutu BW5zlRqJxNpRLiUVY3ODeqtni1/T87IGHAjkaVisl9t5f1A0AhGMul0hJKo8MPXO3DOY1gj3SLZ+a Ik9kumMLSvw2IzGAG2kPfg0EkT/jfmcn0eIs+cJUHM8htc96JvtJ6fXXo44tlgvnrIoyQVwPCuxa0 NcB0lGbTDYHJI28mFoVGeYCLLLkLG3j/M2Bki7EZ3/bcf5ixPgsc1Ez2ZjG5ZON2CyjkBBbVVZZVi Co/OQJ+fnwyxqyxledOY8m5ur+TX66sUAvbyaODxljAlxVFSHvHhXbtck1Nve/BRFcpcRON2E95Ic /wZ0KYs3jg4r/dzFRTIA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mxQy8-00007L-Nc; Wed, 15 Dec 2021 09:53:05 +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 1mxQwb-00HaKX-Ut; Wed, 15 Dec 2021 09:51:31 +0000 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailnew.nyi.internal (Postfix) with ESMTP id 277805801B1; Wed, 15 Dec 2021 04:51:29 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Wed, 15 Dec 2021 04:51:29 -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=RqIRL4ZPwU58/ g8eCUp1MElSyGBaUDT1H6iHs1T1CnU=; b=DthYzW41gxuezgmP8bR68niFtK23u Xo5qYUwb2azfKA4PKGDQp9ru1qgHW+KvtGevtHXFLtl4vIEAlVq36yEHflMMp9rB JpXFyV5Dy+d6mgfHGBOzvGWm43JttmQbEiad402sBgTenA2nkf6IiJZJ2ffTQ+Xa TLDPT+GQzAephZ8wKzlIcTbJlX+BO+iu7Mho7pWxCbY+VbB6hM1aAxr5jH7LSsUz iZcH3Ph+lB/x9QNLGFve0QMp9OyWN0xABKatpQYef+4Ui70JvWvYZMUKKLNPMN1A odMxlksIaAdbwolLgCcQWiu88F4/ukW6HfOTLHQGpovmA5iRA825h2Fvw== 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=RqIRL4ZPwU58/g8eCUp1MElSyGBaUDT1H6iHs1T1CnU=; b=WDNYokl9 myWPIokTCQs1+nPxyNh7ouYOn0iwVukw/LjTC688oItXe2hzvynXwCd/hmK4IyQD t1MttDD/LGJocBAXYb6KZhTzBA2iIDbMLSRDbSX2s5kT6U0QhYEidXZ1/ahoMt5S RV64UJfu3As3N/pe7VBLoVEQPDgMgH3l2QPM0Eaul21vpQqIrkCMQ6sVfgsWJ4Bc isSQZhqhmjuaBfaaUuRCre79N+wvY3JaBnwb+AYeIQlOFMJXPy9SqkaH3lQqp5tq vNP3CdHllM4QFfP/OiGuo6yeZv+DuN4BkGD83wK4tS5+fP/RN0QxvMtSwJ6ipwxv NAxRiU8/b/FigA== 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:28 -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 4/4] drm/vc4: Notify the firmware when DRM is in charge Date: Wed, 15 Dec 2021 10:51:17 +0100 Message-Id: <20211215095117.176435-5-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_015130_156314_02CB4997 X-CRM114-Status: GOOD ( 12.92 ) 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 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. Thus, we can notify the firmware it can free whatever resource it was using to maintain simplefb functional. Signed-off-by: Maxime Ripard Reviewed-by: Javier Martinez Canillas Acked-by: Thomas Zimmermann --- drivers/gpu/drm/vc4/vc4_drv.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/drivers/gpu/drm/vc4/vc4_drv.c b/drivers/gpu/drm/vc4/vc4_drv.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 *dev, static int vc4_drm_bind(struct device *dev) { struct platform_device *pdev = to_platform_device(dev); + struct rpi_firmware *firmware = 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 = of_find_compatible_node(NULL, NULL, "raspberrypi,bcm2835-firmware"); + if (node) { + firmware = rpi_firmware_get(node); + of_node_put(node); + + if (!firmware) + return -EPROBE_DEFER; + } + ret = drm_aperture_remove_framebuffers(false, &vc4_drm_driver); if (ret) return ret; + if (firmware) { + ret = rpi_firmware_property(firmware, + RPI_FIRMWARE_NOTIFY_DISPLAY_DONE, + NULL, 0); + if (ret) + drm_warn(drm, "Couldn't stop firmware display driver: %d\n", ret); + + rpi_firmware_put(firmware); + } + ret = component_bind_all(dev, drm); if (ret) return ret;