From patchwork Mon Dec 13 09:25:01 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 12695849 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 D6523C433F5 for ; Mon, 13 Dec 2021 09:27:46 +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=J8dMK0gihcpLG1 KcggXuY0d7YJgX7eKme/58Xylsao9RIjaxT9c/VW4LJ16lpVYzoey88IxStzsgTx+cuu0CVUHOJGS Oy4sM2xWA25GRM8YBvuKpwzCNWZxvIC3I/ggmiLcctml2swwcrTd6ekrEWnMrhwS8ak5IKcYId3lC B6HtUw8oXwHr5ZIf2ur2/z59pjPkJVOcJscPyHd5HhtqnPi6j4IrAxfahGWkJvaPQJYMbaxJUVHhW GXPu2NxGqbQBTkudhuPUH3NJyV4HX29IaWHcOBeYv5jS4oaXOQgHMPI03X3N+COQVrxfMaetyvlyZ H5mnAiQyMVTdvwUQfwZQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mwhap-008cYk-RY; Mon, 13 Dec 2021 09:26:00 +0000 Received: from wnew2-smtp.messagingengine.com ([64.147.123.27]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mwha8-008cKa-5z; Mon, 13 Dec 2021 09:25:17 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailnew.west.internal (Postfix) with ESMTP id B22982B0014C; Mon, 13 Dec 2021 04:25:11 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Mon, 13 Dec 2021 04:25:13 -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=GT17Pp+h7LI2KePn1RiW05qnhxmnG pnjA6McVw+q/BT5+YcTRIbMde5jpYa4MqOijkixtSNsiecFi3UhuJno8+r/NtSyd ABeIar+El5QpIPeZVNn4dRgQ7Zn0gQq2kuhNNuRILxH16SNf6uTePYOKFxtlHSpz tmKPDVdqADeXY6uzJaCyJZhhqDyaCTumJtq0yhnEr0uNp/njIiHhNan4Q+ak8b/M DmM13s7abKfsxVHRVcY/CFMk9pXKu/znZ5wOToaLnfgIUdC6zncUu3JCU5OgAKwm HnI/zCwEtGZ9iMOQizO9rnHjm4SWutjEnawYK0RT3LiGf8AbwqnUX8kLg== 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=QV3+3fYT HEAaB0nAVwTELqx9rnVhp5JTZl83A1+eOeAyqggXNuk2JhNaxZ0iKgz33N2tpyNH 1h4hUwG9UA4poZAKTG/AhNjL6+VMIGVOujT38zjHdl15sgwojhATgEtodLFmju9n d8tbAKWwwu2LH5LsesoOBmhdYw7bdAH16KKv6VRnpZayV9m3GvbwaOs6k95GVmx3 i0ovAVCzjGiYwc+4SrRzjAFQmHSo5QCYN5OaHl7q2kzsQ2V5CTIv/FDuW2UPXHUr uBQoHNDrFNzTSTynzq7kQFifUmC8y3gqI2uGrxSECMbHnhT+nvkI4+VFH0OdIHY/ tdVNViSNLzpDkA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvuddrkeekgddtfecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofgjfhgggfestdekredtredttdenucfhrhhomhepofgrgihimhgv ucftihhprghrugcuoehmrgigihhmvgestggvrhhnohdrthgvtghhqeenucggtffrrghtth gvrhhnpedvkeelveefffekjefhffeuleetleefudeifeehuddugffghffhffehveevheeh vdenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehmrg igihhmvgestggvrhhnohdrthgvtghh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 13 Dec 2021 04:25:10 -0500 (EST) From: Maxime Ripard To: Ray Jui , Florian Fainelli , Maarten Lankhorst , Thomas Zimmermann , Maxime Ripard , Scott Branden , Rob Herring , Frank Rowand , Daniel Vetter , David Airlie , Nicolas Saenz Julienne Cc: Dave Stevenson , Phil Elwell , Tim Gover , Dom Cobley , linux-rpi-kernel@lists.infradead.org, dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, bcm-kernel-feedback-list@broadcom.com Subject: [PATCH v3 1/3] firmware: raspberrypi: Add RPI_FIRMWARE_NOTIFY_DISPLAY_DONE Date: Mon, 13 Dec 2021 10:25:01 +0100 Message-Id: <20211213092503.57379-2-maxime@cerno.tech> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211213092503.57379-1-maxime@cerno.tech> References: <20211213092503.57379-1-maxime@cerno.tech> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211213_012516_315441_BE962270 X-CRM114-Status: UNSURE ( 7.81 ) 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 Mon Dec 13 09:25:02 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 12695850 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 42D78C433F5 for ; Mon, 13 Dec 2021 09:28: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=BJnaeRWtHL8eoLq+2XDNIQGYveYlg0blsVOsFwteZnc=; b=uyFt9/qlnmX61U LQ3qO9rHVNcRX/7wtyVdumuc4WH+l6IkV9pGnQakQa1wG/i2kMrn7fOL5rOmQJQuUhyT9+DVpZG8E wgO2ITKnL4JIczgr/i7JMXVIbxDegvxXWsazqN1m/V7aovYivZ2kUgU1diSFO5e5gOb8vlmue1oJF iOBYd/N6iwYTXio4gJduXyvPqVLGUAIi9/55C1tdOZTwZLX/BvaStCoj8jnys6XXJ3scB9/ifCouv Sp3aHK/UDkWQ8XKgauTJGSIrNdF4VerZ0y7kbVutkf7KaiWkm2robHK3Syi88ph1hi/wacSKCP5/A HSSdPxUE1YwSvVO9gp/g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mwhbQ-008ciZ-1o; Mon, 13 Dec 2021 09:26:37 +0000 Received: from wnew2-smtp.messagingengine.com ([64.147.123.27]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mwhaC-008cNA-4T; Mon, 13 Dec 2021 09:25:21 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailnew.west.internal (Postfix) with ESMTP id 970522B0014C; Mon, 13 Dec 2021 04:25:17 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Mon, 13 Dec 2021 04:25:19 -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=yQw9DXa8mMxZk wpFz13lFKHWrNaJJt0CezYCd2GiA6o=; b=d2GPi9d0aM+UzxZ7JlmT/9l7uvNSx 1e5gI6Jfma7IYxImjXP7Ssaf1DVsC2ZMWWYk6GtWEz8kY/wRAwy0sDycong/7EQr kJp/pifgZTHfqH9h3zSQzWIki749RgP2SlzVhbo31l8XLRSYmIQsI1UrBhxcQ/XZ J4s0Ra5D5DyKonnMs+L4Ks5VTbe3D3U48KMqVf13Ovhv2oR7u6Mj3fcuDMlkZnU4 PY3ZIUMwmgACnQHELaVnUT/dfAg8/CWlWmHJcIR6Lyilg1qv+WwASyDFA8Leo56z NaoSfsaXg5IpJUzbxjXpODG9MEKVYxtkWzCpzd6rsZdrGObzRdwN01JTA== 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=yQw9DXa8mMxZkwpFz13lFKHWrNaJJt0CezYCd2GiA6o=; b=MtB+R0Jb PVc1ViZSf5qy5sTcgy071EkcAD6O8c8qed8sQFDscCV/6bVKKBri6bMLWX+hviF6 nhWaLQK84MkdMzGsUKO1KJnAEdkQVzmSsFIM4LrLS5enP24GLNhzOvBCrXg7P73K JUZFMmqxw1HE164C5slJCxajITMlLkltJV9sL1USoiBvLL0h8/OYxJ6nSTklP0h2 N8Ht3TZUe/1KLDKlP9mcLQBipLNDXF7ToZVCelR8luldK4EQ973Guz11Woexk3Fi OWOJ4PRGT+t8TNA9jTbwqdJ+R4QjwKWc334xPKRI25JM+/rnZ66Alo1GynfuX2Im 3pzUWXRFEzU4VA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvuddrkeekgddtgecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofgjfhgggfestdekredtredttdenucfhrhhomhepofgrgihimhgv ucftihhprghrugcuoehmrgigihhmvgestggvrhhnohdrthgvtghhqeenucggtffrrghtth gvrhhnpedvkeelveefffekjefhffeuleetleefudeifeehuddugffghffhffehveevheeh vdenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehmrg igihhmvgestggvrhhnohdrthgvtghh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 13 Dec 2021 04:25:15 -0500 (EST) From: Maxime Ripard To: Ray Jui , Florian Fainelli , Maarten Lankhorst , Thomas Zimmermann , Maxime Ripard , Scott Branden , Rob Herring , Frank Rowand , Daniel Vetter , David Airlie , Nicolas Saenz Julienne Cc: Dave Stevenson , Phil Elwell , Tim Gover , Dom Cobley , linux-rpi-kernel@lists.infradead.org, dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, bcm-kernel-feedback-list@broadcom.com Subject: [PATCH v3 2/3] drm/vc4: Remove conflicting framebuffers before callind bind_all Date: Mon, 13 Dec 2021 10:25:02 +0100 Message-Id: <20211213092503.57379-3-maxime@cerno.tech> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211213092503.57379-1-maxime@cerno.tech> References: <20211213092503.57379-1-maxime@cerno.tech> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211213_012520_278326_A7313BA7 X-CRM114-Status: GOOD ( 11.15 ) 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 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; From patchwork Mon Dec 13 09:25:03 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 12695851 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 4D4DCC433F5 for ; Mon, 13 Dec 2021 09:29:25 +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=JArIxZkmpVCyHmJs32VjrhkyyrNL544CIembxrQ8GC8=; b=A/x56IupA2FCHC wZxLMei6pZaBNolqlcDEzA6qx/Lh99z+c45J9I7+UZKRGvnui1ZZWyyMCyrDVXS1X34dUCwrDtl8I AnPLi69WK5Clg8pjuwyhyX3gkk1MraKqiMIkHugVnuSqYiX7DuEerrAhMfHug4rIjBGvkPDXetH3M 418+NE7OZDoZJ7Ti50RcgoPQ8rwyOzA90bxIhLlwLa2YvP6NDpAjyHCoFDvuhFuZLCT3A3RKqd8mZ YpauT0tNpVRCI5P1wxOUdvWch95UbQh/zAMGmeA0ietaaOJ/rTbV0M5DjMrv70YHf9z4WzPFoCchv +dEUt0yxl/Pqn0vid6+A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mwhcC-008cxD-UE; Mon, 13 Dec 2021 09:27:25 +0000 Received: from wnew2-smtp.messagingengine.com ([64.147.123.27]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mwhaH-008cPy-V3; Mon, 13 Dec 2021 09:25:29 +0000 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailnew.west.internal (Postfix) with ESMTP id 1A0442B0014C; Mon, 13 Dec 2021 04:25:23 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Mon, 13 Dec 2021 04:25: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=7jmrCIXairoj2 k92Bls3rCi+HRGAZUgUDSdIAr+qd3w=; b=Xqu4nXaJgm0YY7mmzGaIkuQz+L+f+ tP4MzMaCWVmdfwFf+irFqEOPebvNpfSWFucam697d8KjfZXid0/KI76WLhEJDewv y/HMj/HT7bsU2Y8VVzEfPrmEglS48ogrufABnfdZ3/ntRte5ltxy01One88kKcUt 1jECO91/HUVD5UXROkAEE0CdhKjgZjLVTdRdatEDxWwzvB/006C5+50o6THTSXYL nmOH2nbHEHITZQCRP5azlBYLHZJSe+5+exDHSTZ1Z4mtWuPlA34KD8Mo0XKxpQyx QIYW8Ygtuwoz+oG3PvX94mvGfvYZSiAT3EM8XepBu7iSmLDpy6bSaP5YA== 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=7jmrCIXairoj2k92Bls3rCi+HRGAZUgUDSdIAr+qd3w=; b=mcJ88QeW 9NdxXH/qUh2jzxaSt97jMZH/QO9N9jIsHUYZ8oWgtfSf2KibYVhgHxDKhM3WSY7l JtdB93HGoOlo8nkib+G3g3VqeJPsXd8OL5hRlBpYPlmkHruc8FYbKGaCnw355l6S U2h6ixmbg6BgmQD9obx0HB7W+KdNp07VuPoJbRw9mypilYqXxWoQcd6xPNtuE47g UMda2Wr8nq4tLhiukA+UyDYQk5gF9W0h8XAtNDyy8sRrh3zT7gn7BVGeaeplmWkK KPN/jrxTMOmAehkUvjHsX3ai2e3ooUNn0W1IKwMObQ/AI6hGYCJoeXcqtGD/Y4zq JyJ8f2IyRBa25A== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvuddrkeekgddtgecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofgjfhgggfestdekredtredttdenucfhrhhomhepofgrgihimhgv ucftihhprghrugcuoehmrgigihhmvgestggvrhhnohdrthgvtghhqeenucggtffrrghtth gvrhhnpedvkeelveefffekjefhffeuleetleefudeifeehuddugffghffhffehveevheeh vdenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehmrg igihhmvgestggvrhhnohdrthgvtghh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 13 Dec 2021 04:25:21 -0500 (EST) From: Maxime Ripard To: Ray Jui , Florian Fainelli , Maarten Lankhorst , Thomas Zimmermann , Maxime Ripard , Scott Branden , Rob Herring , Frank Rowand , Daniel Vetter , David Airlie , Nicolas Saenz Julienne Cc: Dave Stevenson , Phil Elwell , Tim Gover , Dom Cobley , linux-rpi-kernel@lists.infradead.org, dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, bcm-kernel-feedback-list@broadcom.com Subject: [PATCH v3 3/3] drm/vc4: Notify the firmware when DRM is in charge Date: Mon, 13 Dec 2021 10:25:03 +0100 Message-Id: <20211213092503.57379-4-maxime@cerno.tech> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211213092503.57379-1-maxime@cerno.tech> References: <20211213092503.57379-1-maxime@cerno.tech> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211213_012526_106001_749780D3 X-CRM114-Status: GOOD ( 13.12 ) 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 --- 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 8ab89f805826..e26897cb49a9 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;