From patchwork Fri Dec 3 13:51:24 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 12694708 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 DEE39C433EF for ; Fri, 3 Dec 2021 13:53:41 +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=GIMWhuqe/tbkk0IWSAuHew8Lip+MAbH4YhE5HTckw5E=; b=XMyBx7gxETunA+ u1yVT+OjALakDMDFu6gI18gPgtlh0nX5u0vYUnVMiJY4lgFvtmRxHpboCStXEI0I09TNh00V2ifs7 ttIaOR7C9AtOH1fzmg20gmmbc5PaK3A2KNcnr6ccXM0Xbinvvszk7YGgKjUQI+sflaCZtGEiDzu/j TwEwe2IK6Et9ufyEpN/VMKaGqB5cUzArlseI5Al5W13wvjsLSLLSVzE0Wa0KlS/f7+klQIlWBg6kG Vz3XBtqbP9Ye16f+WE+lco3P0/0eCOzwvW5Z1gcvvoyuLvajNBb/HaBeKiSTD9zjYJhS+GYLbtX80 imFV3hP3WjImzSS9oRMg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mt8yk-00G3jH-6a; Fri, 03 Dec 2021 13:51:58 +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 1mt8yL-00G3XV-0V; Fri, 03 Dec 2021 13:51:34 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailnew.nyi.internal (Postfix) with ESMTP id 42E075800E3; Fri, 3 Dec 2021 08:51:32 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Fri, 03 Dec 2021 08:51:32 -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=0dVVB/OyUykQQ BayNdwbSTIU/wmtxvli48qZr0+pxgg=; b=LhsQ+GtDhypuNR/qxlWrY6eXxxPZ8 N8WvBG0xFKKJz2zHMT2nbiJ8GtWemLa/DzgAlM8J2LbEyspL2MyUq8z7TqVSEjVU bJIL/hxP1qolX9+cmLOvNKds5LKObhzrnjB9dYLaNjZpkRQ465So9lmli76NVv7r VkP6utITkDQZe9zxfyHYp5PyD9OF7tZ9RNioKxJDGsX/GeTc/SOGGJksqd+3ZqYY 4rAOKYuewQxlA74DUtRTvKHrXiVut4w38cVCUtOHG4mlDmRCiQSRVtV2ssVjDC/s g/L8dx36BHQXdA52iyKT3Uj1HAx3g6VgEKge4ZvDYSEZ61R8gAAuxhkuQ== 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=0dVVB/OyUykQQBayNdwbSTIU/wmtxvli48qZr0+pxgg=; b=mLkWuLdr N868uFApRKcUpl1Ogy0q8WEpd9KZozK7EYGrSV18QFUKrYvK3nW4RRF9o8EAYH8x ARoV0F0lEPl70rqDzgOUtr3acawUZrKnQtLMs9Ney/6Rw59PSftSxsXsl3vrySog JsWpBPElqoJUq2aQp8pget87RM+PKZCt6rZKbn+HeszRbWEO+GbDsknOwQz68v3t M3IsyjVV3TephyBml20JMB/p/fmfPTjSZulX8odye8iOXOwRDhKkrd9wdDJ6tM7G ouCFfUIYG4xju7OdbVUgPVP6qF55AeLoNns4eMxUMIVycM0Yq21Wm8s+fWhEZ/nC s2sQGUDPUXYANg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvuddrieejgdehlecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofgjfhgggfestdekredtredttdenucfhrhhomhepofgrgihimhgv ucftihhprghrugcuoehmrgigihhmvgestggvrhhnohdrthgvtghhqeenucggtffrrghtth gvrhhnpedvkeelveefffekjefhffeuleetleefudeifeehuddugffghffhffehveevheeh vdenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehmrg igihhmvgestggvrhhnohdrthgvtghh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 3 Dec 2021 08:51:31 -0500 (EST) From: Maxime Ripard To: Ray Jui , Scott Branden , Maarten Lankhorst , Thomas Zimmermann , Maxime Ripard , Rob Herring , Frank Rowand , Florian Fainelli , Nicolas Saenz Julienne , Daniel Vetter , David Airlie Cc: Dave Stevenson , Phil Elwell , Tim Gover , Dom Cobley , linux-rpi-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, dri-devel@lists.freedesktop.org, bcm-kernel-feedback-list@broadcom.com Subject: [PATCH v2 1/3] firmware: raspberrypi: Add RPI_FIRMWARE_NOTIFY_DISPLAY_DONE Date: Fri, 3 Dec 2021 14:51:24 +0100 Message-Id: <20211203135126.700165-2-maxime@cerno.tech> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211203135126.700165-1-maxime@cerno.tech> References: <20211203135126.700165-1-maxime@cerno.tech> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211203_055133_163432_E1ACFA04 X-CRM114-Status: UNSURE ( 8.26 ) 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. 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 Fri Dec 3 13:51:25 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 12694709 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 3546FC433F5 for ; Fri, 3 Dec 2021 13:54:05 +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=vGdrQJSXBc4evTNO+ybbN3rMSmbfdlpViz639LiMKjk=; b=3iXAMMwiVW4SNp 72Avc0S7+t8qdWXwbFp/BePJEXBvrT/IvS8TnMj1zjvH+2skLMX3AdFUPuduWYG3DUhD+jpQRoozM vDwHOuA9Sn4QEtkZgGktmVFEpqeK4KONBXZr0805KBYayixbqpUNMvIKfGfwjKn234gGvHc5ORPV2 FJOXtHZTPOFM0iceZSzIHd36Miov2bER66yJGDaxc9xL3zZpNP5jzQcwKnKwg6oAiZasypHCEsJwa WB+GSvv2BNfBXUwmXjkweAXrubVnle6/hN+ZubijdTT5WbqUsZq6+/6BMZ+o5Q47p1TdYQxKzzZSG idVboADR95qSIMrd9dBw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mt8z9-00G3tP-5w; Fri, 03 Dec 2021 13:52:23 +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 1mt8yN-00G3Yu-CZ; Fri, 03 Dec 2021 13:51:36 +0000 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailnew.nyi.internal (Postfix) with ESMTP id A67895800E3; Fri, 3 Dec 2021 08:51:34 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Fri, 03 Dec 2021 08:51:34 -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=EfZuJi27liTCfWjlQqmjBzt74HNdk xazXacFE3NahqCyNp/XNeCaaxm097r5duNBDEhdzY0Uak1lZuSkxQpQ5By0okgRo LC8ynN21c6BYz7Rd3kBaetghlu7NHJNw0ldthqFY1svY7vMxEhqazEQtANIhIlrV vsnMUf/cm8HgPsZhIKRxwFZT/L9DCf8VO5z4eURUru2G4+dimdtDKBD2yv458Bvu aSki6Fc43xSn4+fTIuZ65HptoY9G5vyK901iAEpdaoS/4kA5iIGk7rSqeoPaYJ/T u83QcNTBK0grtGk3mXWwWrZc/uDzcfhF/AUFPiUIHXq83Kq8naRgINkHQ== 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=AeX+9Fr+ gECxhwVDigZMK7Owxc+I1xm3IfXD2TCMd3fV2w1g7jXhclKKYXmT18XHfLPm9e7l XGOlZ6PHFwfU9F9tclTgueybZXgH964DSIf+QiNQxbCmSl23BQkI2auP/nsYD8UN otA77hxyjJ2c+C2CLI4H4yEyvidSBLwh7dXaYJFbtyuK8fPhoKhAjByqzMmCpBag ZITHBM+jgqNBKYkcG350GziqNIqVmThR1Lrrhm8FdFcCIBzNaaMdqSDXIDzkbNuG lVMfN9EPZo23lUScOlYUDLcTeEraLip/3I0VHgKPW7c0nN5pw2rRbhY+PnrOEy3l WFSQd6vpDBZD0w== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvuddrieejgdehlecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofgjfhgggfestdekredtredttdenucfhrhhomhepofgrgihimhgv ucftihhprghrugcuoehmrgigihhmvgestggvrhhnohdrthgvtghhqeenucggtffrrghtth gvrhhnpedvkeelveefffekjefhffeuleetleefudeifeehuddugffghffhffehveevheeh vdenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehmrg igihhmvgestggvrhhnohdrthgvtghh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 3 Dec 2021 08:51:33 -0500 (EST) From: Maxime Ripard To: Ray Jui , Scott Branden , Maarten Lankhorst , Thomas Zimmermann , Maxime Ripard , Rob Herring , Frank Rowand , Florian Fainelli , Nicolas Saenz Julienne , Daniel Vetter , David Airlie Cc: Dave Stevenson , Phil Elwell , Tim Gover , Dom Cobley , linux-rpi-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, dri-devel@lists.freedesktop.org, bcm-kernel-feedback-list@broadcom.com Subject: [PATCH v2 2/3] drm/vc4: Remove conflicting framebuffers before callind bind_all Date: Fri, 3 Dec 2021 14:51:25 +0100 Message-Id: <20211203135126.700165-3-maxime@cerno.tech> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211203135126.700165-1-maxime@cerno.tech> References: <20211203135126.700165-1-maxime@cerno.tech> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211203_055135_538709_C802143C X-CRM114-Status: GOOD ( 11.41 ) 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; From patchwork Fri Dec 3 13:51:26 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 12694710 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 F054CC433F5 for ; Fri, 3 Dec 2021 13:54:28 +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=RBq/6SkCRGpWZrEamgunlV0RcqfqyzBIgE8wj0aCe+k=; b=usuQLQWrAZEx6Q wfuAKevKUs9YTZBsQ0/JIuYk+4uXTO+/9+71h61N3HA7CkXS3+iNDRL3Op8aw14OAXiY4SeWOIVFO 22OjmzYsZezwO72HJdWlM86U4laczlmaFsEf5gZnwCoEEibfXc7GAd2QqL74ME4Ax7ySlEpq9Bgxw MTzicPlwBmVREm75jYT9ALazG4VsxoHCAg0unBVhl462Qn7rDkQJEgsN8C8hhtPaoR1jnTKe7bRqw SZJNWxytJ97yzKNVqxB1OeqhIX73J1qk8QZ761gOk/bg9FK8XOQvzrGD/YhdggauQuXMWbwO4Vr8E rfrp2eJqFttBT4gPdN+g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mt8ze-00G47Q-OB; Fri, 03 Dec 2021 13:52:55 +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 1mt8yP-00G3a1-G6; Fri, 03 Dec 2021 13:51:39 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailnew.nyi.internal (Postfix) with ESMTP id ADE725800F0; Fri, 3 Dec 2021 08:51:36 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Fri, 03 Dec 2021 08:51:36 -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=HOi4Gz1hW38Xl SjSMQhvunvdi3R7X8A7uhXWityqRXw=; b=QuZxfjfDAuBHCw/qGhRC4wgLfWeav qPT8KIWs+o2yHgHfamUqT+UCa1LzxdvVHvdXEXnNytGaOi/CQW+b6t80sDiu5aEU iHbt/ITVLyfB+e/gavtofrlgAWVYCTYQyY7LcBLEufecbKfgu2ViTpalEYv4Q/LG q5/c9ZwYOguWNkmENK/XlUSTX9PkirZG6h4ZG9Z7ear0dIQ6ulVmu8oW0hbRrWu0 M/nFMZGC4kEWA7f245TA2l9Tt9MNiUvCRO0H23yuAlTnM4sddCJ2AZ2GVAAFLDCZ zdWQSgMwGzq0gQq6HIeQI0YT6HZ9Bvuy/xpi1c5R+zu1NhjpGbJ8HhOlg== 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=HOi4Gz1hW38XlSjSMQhvunvdi3R7X8A7uhXWityqRXw=; b=aNAhwW77 VFU1zk7cp6ftINRSXZu105qQjpRFURIl6vMwIwyiZL0toUzK+UtU9f57G33iW2MR 7xQXnwFoLttpdB9tldQs+CqMOQwpIVmAuCkMqvmIKGa5JFY4fc6DybiDLkI1o4E4 05GqfX7sMx8dQszXs1D2RHc0E4+eOwgrIH95yWolLzzuprzBbBXyXzs1SfXzqJTJ VxU5HPxETeL+nwcGSoiqV06y0UtBw3GgMvpIe7q2gN53PMSd6ej+AUUo4X2b/mPG OZ8sjzuokr9kkDyuo2wai20TU6PFihHbGCoF3/BPCuAFFgU5HpQ8ycbFp0hrl6m2 o3OqBU54cIiFCQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvuddrieejgdehlecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofgjfhgggfestdekredtredttdenucfhrhhomhepofgrgihimhgv ucftihhprghrugcuoehmrgigihhmvgestggvrhhnohdrthgvtghhqeenucggtffrrghtth gvrhhnpedvkeelveefffekjefhffeuleetleefudeifeehuddugffghffhffehveevheeh vdenucevlhhushhtvghrufhiiigvpedunecurfgrrhgrmhepmhgrihhlfhhrohhmpehmrg igihhmvgestggvrhhnohdrthgvtghh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 3 Dec 2021 08:51:36 -0500 (EST) From: Maxime Ripard To: Ray Jui , Scott Branden , Maarten Lankhorst , Thomas Zimmermann , Maxime Ripard , Rob Herring , Frank Rowand , Florian Fainelli , Nicolas Saenz Julienne , Daniel Vetter , David Airlie Cc: Dave Stevenson , Phil Elwell , Tim Gover , Dom Cobley , linux-rpi-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, dri-devel@lists.freedesktop.org, bcm-kernel-feedback-list@broadcom.com Subject: [PATCH v2 3/3] drm/vc4: Notify the firmware when DRM is in charge Date: Fri, 3 Dec 2021 14:51:26 +0100 Message-Id: <20211203135126.700165-4-maxime@cerno.tech> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211203135126.700165-1-maxime@cerno.tech> References: <20211203135126.700165-1-maxime@cerno.tech> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211203_055137_652711_D0BE145A X-CRM114-Status: GOOD ( 12.63 ) 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 | 19 +++++++++++++++++++ drivers/gpu/drm/vc4/vc4_drv.h | 2 ++ 2 files changed, 21 insertions(+) diff --git a/drivers/gpu/drm/vc4/vc4_drv.c b/drivers/gpu/drm/vc4/vc4_drv.c index 8ab89f805826..38d55a47c831 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" @@ -251,10 +253,27 @@ static int vc4_drm_bind(struct device *dev) if (ret) return ret; + node = of_find_compatible_node(NULL, NULL, "raspberrypi,bcm2835-firmware"); + if (node) { + vc4->firmware = devm_rpi_firmware_get(dev, node); + of_node_put(node); + + if (!vc4->firmware) + return -EPROBE_DEFER; + } + ret = drm_aperture_remove_framebuffers(false, &vc4_drm_driver); if (ret) return ret; + if (vc4->firmware) { + ret = rpi_firmware_property(vc4->firmware, + RPI_FIRMWARE_NOTIFY_DISPLAY_DONE, + NULL, 0); + if (ret) + drm_warn(drm, "Couldn't stop firmware display driver: %d\n", ret); + } + ret = component_bind_all(dev, drm); if (ret) return ret; diff --git a/drivers/gpu/drm/vc4/vc4_drv.h b/drivers/gpu/drm/vc4/vc4_drv.h index 4329e09d357c..b840654c53a9 100644 --- a/drivers/gpu/drm/vc4/vc4_drv.h +++ b/drivers/gpu/drm/vc4/vc4_drv.h @@ -76,6 +76,8 @@ struct vc4_dev { unsigned int irq; + struct rpi_firmware *firmware; + struct vc4_hvs *hvs; struct vc4_v3d *v3d; struct vc4_dpi *dpi;