From patchwork Mon Dec 13 16:26:32 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 12674219 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 54FB8C433FE for ; Mon, 13 Dec 2021 16:26:42 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7F83D10E76F; Mon, 13 Dec 2021 16:26:41 +0000 (UTC) Received: from new4-smtp.messagingengine.com (new4-smtp.messagingengine.com [66.111.4.230]) by gabe.freedesktop.org (Postfix) with ESMTPS id 23B3A10E76F for ; Mon, 13 Dec 2021 16:26:40 +0000 (UTC) Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailnew.nyi.internal (Postfix) with ESMTP id 77FBD5801BE; Mon, 13 Dec 2021 11:26:39 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Mon, 13 Dec 2021 11:26:39 -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=EDxEzaEHmwx9UwdUgpHC9DNsv+Owa YA+KYjeJTDUUrJPZvomH42uFasBSax5L7Uk1dTtK2itAdQhg4b2JHUO7mflN1T0G xdv83SGDbi7EGCdh4/gTUL8AHG1LdLF4ZWlkamefRPwVE5+Q1bUhMtdmDTELlAkC ha2c0vDSeaCPVcQy/gkoABV/fLiLqCZXWiw9xpntotM3WVjSyukFlCbrvMOJvhF2 jeEEIxcWItNT0TZ1mk87Uidtd4cvwJfqG8J3HUVem1Z/JUJhg764uv8Opn4zfz0I Lupn+/rsp3qas/j7VLaXC6HCe64YMkWZE9hnyp/KHZ+ZazQ+NljSF8n9Q== 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=lxCoNTZ6 7tW5+DcRVb2RHgCN6Vo61BiATf2yhTzsPaO/uMx4xzSlJ1mTpdLjnUdUEwdERi1c nqT2Eic+5+0OnOWo3J6+F9zBKizAqCfdqPjTlN+8LcHup72lvKK4VGDoRG17OPHb pIqlFVAtWVtMqj3LcGcUYkUxlANJbsDrHpkRODkuFCPmvBIaNbxLSJLTCtaZfezj n3EiG2tY2dl+0OogYtKyJhZEJvivJw7LXtUoeAnJRI0HBmn1paQGunYSVHAlZ9gP kjp4suOn4Akuw+9xOzm7phR1uZ4SPyMtXKZ6jIxI3VGYYwhoZuFfLhKhd//Xt4Oq Yld+wSHFSifOPg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvuddrkeekgdeklecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofgjfhgggfestdekredtredttdenucfhrhhomhepofgrgihimhgv ucftihhprghrugcuoehmrgigihhmvgestggvrhhnohdrthgvtghhqeenucggtffrrghtth gvrhhnpedvkeelveefffekjefhffeuleetleefudeifeehuddugffghffhffehveevheeh vdenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehmrg igihhmvgestggvrhhnohdrthgvtghh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 13 Dec 2021 11:26:38 -0500 (EST) From: Maxime Ripard To: Maarten Lankhorst , Thomas Zimmermann , Maxime Ripard , Daniel Vetter , David Airlie , Florian Fainelli , Scott Branden , Nicolas Saenz Julienne , Rob Herring , Frank Rowand , Ray Jui Subject: [PATCH RESEND v4 v4 1/4] firmware: raspberrypi: Add RPI_FIRMWARE_NOTIFY_DISPLAY_DONE Date: Mon, 13 Dec 2021 17:26:32 +0100 Message-Id: <20211213162635.252582-2-maxime@cerno.tech> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211213162635.252582-1-maxime@cerno.tech> References: <20211213162635.252582-1-maxime@cerno.tech> MIME-Version: 1.0 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, 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 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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 16:26:33 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 12674221 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 6DE39C433F5 for ; Mon, 13 Dec 2021 16:26:44 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 63BE910E7C1; Mon, 13 Dec 2021 16:26:43 +0000 (UTC) Received: from new4-smtp.messagingengine.com (new4-smtp.messagingengine.com [66.111.4.230]) by gabe.freedesktop.org (Postfix) with ESMTPS id 1F8CF10E7B0 for ; Mon, 13 Dec 2021 16:26:42 +0000 (UTC) Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailnew.nyi.internal (Postfix) with ESMTP id 77CDC5801BD; Mon, 13 Dec 2021 11:26:41 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Mon, 13 Dec 2021 11:26:41 -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=NYzTodFUSDTQ1 k8uArv9hmdu5xxvwWvdj/NMSohJE10=; b=hdQMscQAE9/i1zRx1WJA9ZO44OXr9 r04PGf1xlnG3tky5p8+ITEBkUrRS+esDZUCWIylWLlRaRp/ocUW7UrBD+xzra8xh sLzYGzxXysPfeJssXkmKXvWtdLKTUBmalZcOiuMaJ/pz5XjbJLWqRDFmSj1jnzeW v+LZH19KUS8e9wQs9VOaV6NgnKnybXLS+w9biUdDpSSgarrHT2C2ErpVvBBJfXxV JAmh4mj8Ez9iSUpM3Cr3iidFG0QDjhUa4dtl0u3NN5M/4s7/TJwxfH63i7OWWszd Z7YwdS0KlU9PNvNeQRdqhuFT65chXx87zDiwOMXrfF5GMtB7onEeRQAlQ== 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=NYzTodFUSDTQ1k8uArv9hmdu5xxvwWvdj/NMSohJE10=; b=aKJTiMR1 YfhzpE4JjhbmGoGaZc1Xh9AUviTeEpQNaiVCZI1idKl/PmepANLNRlUaq6Qfiqb0 ZX3DPeT322BeGl4zG34IyzDBgYdMRSxQEBd+3VOKvKHrx5lcCAklnv4iflJnTSrz 80kYHRGkyWQY2Una+ZwTkZ8hvbkJpuCyRozYl+CBiZHw8xRApum9VdmPkcGfQ5iC iMU/kdpTqVlDq1njysLIEJnct6nBiM2xMqZzZQidhMCjfIiDIhpCLsTrI16goNVi laxs+wAKtHEi8FhOeerKtpNL/1LvtOq94JHwOwoYpUgsYZOXiiDQASbO+In9SujL 6coOZ+/9XZkNww== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvuddrkeekgdeklecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofgjfhgggfestdekredtredttdenucfhrhhomhepofgrgihimhgv ucftihhprghrugcuoehmrgigihhmvgestggvrhhnohdrthgvtghhqeenucggtffrrghtth gvrhhnpedvkeelveefffekjefhffeuleetleefudeifeehuddugffghffhffehveevheeh vdenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehmrg igihhmvgestggvrhhnohdrthgvtghh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 13 Dec 2021 11:26:40 -0500 (EST) From: Maxime Ripard To: Maarten Lankhorst , Thomas Zimmermann , Maxime Ripard , Daniel Vetter , David Airlie , Florian Fainelli , Scott Branden , Nicolas Saenz Julienne , Rob Herring , Frank Rowand , Ray Jui Subject: [PATCH RESEND v4 v4 2/4] drm/vc4: Support nomodeset Date: Mon, 13 Dec 2021 17:26:33 +0100 Message-Id: <20211213162635.252582-3-maxime@cerno.tech> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211213162635.252582-1-maxime@cerno.tech> References: <20211213162635.252582-1-maxime@cerno.tech> MIME-Version: 1.0 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, 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 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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: Javier Martinez Canillas --- drivers/gpu/drm/vc4/vc4_drv.c | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/vc4/vc4_drv.c b/drivers/gpu/drm/vc4/vc4_drv.c index 16abc3a3d601..12694e2201e7 100644 --- a/drivers/gpu/drm/vc4/vc4_drv.c +++ b/drivers/gpu/drm/vc4/vc4_drv.c @@ -357,12 +357,22 @@ static int __init vc4_drm_register(void) { int ret; - ret = platform_register_drivers(component_drivers, - ARRAY_SIZE(component_drivers)); - if (ret) - return ret; + if (!drm_firmware_drivers_only()) { + ret = platform_register_drivers(component_drivers, + ARRAY_SIZE(component_drivers)); + if (ret) + return ret; - return platform_driver_register(&vc4_platform_driver); + ret = platform_driver_register(&vc4_platform_driver); + if (ret) + return ret; + } else { + ret = platform_driver_register(&vc4_v3d_driver); + if (ret) + return ret; + } + + return 0; } static void __exit vc4_drm_unregister(void) From patchwork Mon Dec 13 16:26:34 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 12674223 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 DA596C433F5 for ; Mon, 13 Dec 2021 16:26:47 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id CECDD10E7D2; Mon, 13 Dec 2021 16:26:46 +0000 (UTC) Received: from new4-smtp.messagingengine.com (new4-smtp.messagingengine.com [66.111.4.230]) by gabe.freedesktop.org (Postfix) with ESMTPS id BBBED10E7D2 for ; Mon, 13 Dec 2021 16:26:44 +0000 (UTC) Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailnew.nyi.internal (Postfix) with ESMTP id 1FBE65801BD; Mon, 13 Dec 2021 11:26:44 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Mon, 13 Dec 2021 11:26:44 -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=5jXA/kJUnHNXe i3kWYCHbhB8LRX/fvUqDJgIAUMTB+s=; b=E9NpO9pMbcAk5CJRneUJd3Vq3yOTN O+3EzJRaWwkOslq8Z3Pvqa+f33eDh8g0kcJXCL8soucOF4tG/+vfptp+86IvJY24 dojIz01oWxUszjkeZhPRIAd1HxFAyjs4rggHG8CmjsX1dIsVMPqvefmH9MbpKXoF J7EiykSXaLE4iRdvLaXMWyVLOeMvSIX7o8Gs7rJsS3CugjbE/TWTAT3MjHDhix/3 wqF4dnRCsHUBWVLCmBn4O0xZI86WJsKhOgzUJ0JzkwZtEjMQXfDdT/PaIHhx+y14 22MiiNn89PhO96uFZke+jlu13QxV5IZctLR7RLVb+IaSB6aPrp2zdnTqA== 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=5jXA/kJUnHNXei3kWYCHbhB8LRX/fvUqDJgIAUMTB+s=; b=gbUsM7uW 70COHYLi08uXT33wlV0bDGx1ZER5tfJjYTUw/X/m43OZ29MBEHNP6fuKLpHOOr8S 2OX0aeDWOocffS2UjZ6CRRklA+67WuHs7ROMMSb+jXUWWsay1eZVJTQMarGUgkJe S0CNykh2M3RH1KR8J9z1toLsDkF14YOWfE499DujGnc3Em5gSi+65HrhVwnQxw83 ImEY8B68jsAWxpdRGB8x+M8FtZnj5rrkMmQGiOPp4hPHILRc2cpeA3hMvrk8fnZV WXT+CTo7j4u/uJs5a+tFXmCVx+LYBJbUyymMqB8w7ZUzQHHgaheiSwmsvdpw2+/G MuQoaPTXVezQZA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvuddrkeekgdeklecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofgjfhgggfestdekredtredttdenucfhrhhomhepofgrgihimhgv ucftihhprghrugcuoehmrgigihhmvgestggvrhhnohdrthgvtghhqeenucggtffrrghtth gvrhhnpedvkeelveefffekjefhffeuleetleefudeifeehuddugffghffhffehveevheeh vdenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehmrg igihhmvgestggvrhhnohdrthgvtghh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 13 Dec 2021 11:26:42 -0500 (EST) From: Maxime Ripard To: Maarten Lankhorst , Thomas Zimmermann , Maxime Ripard , Daniel Vetter , David Airlie , Florian Fainelli , Scott Branden , Nicolas Saenz Julienne , Rob Herring , Frank Rowand , Ray Jui Subject: [PATCH RESEND v4 v4 3/4] drm/vc4: Remove conflicting framebuffers before callind bind_all Date: Mon, 13 Dec 2021 17:26:34 +0100 Message-Id: <20211213162635.252582-4-maxime@cerno.tech> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211213162635.252582-1-maxime@cerno.tech> References: <20211213162635.252582-1-maxime@cerno.tech> MIME-Version: 1.0 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, 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 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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 12694e2201e7..c0d7e510694f 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 16:26:35 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 12674225 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 7C31BC433F5 for ; Mon, 13 Dec 2021 16:26:51 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 8224710E7B0; Mon, 13 Dec 2021 16:26:50 +0000 (UTC) Received: from new4-smtp.messagingengine.com (new4-smtp.messagingengine.com [66.111.4.230]) by gabe.freedesktop.org (Postfix) with ESMTPS id DF6EF10E7D4 for ; Mon, 13 Dec 2021 16:26:46 +0000 (UTC) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailnew.nyi.internal (Postfix) with ESMTP id 3A2335801BE; Mon, 13 Dec 2021 11:26:46 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Mon, 13 Dec 2021 11:26:46 -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=c7km/lvZ5a2iH qu7qa5YLTQv7U1pBCi32tVq4pp5uwo=; b=OX4pRvqbucgkVQApIEi5wHXzyDlde cf4IvAoI4QqNjyIBsRHf54fAPF4ydWX6zLwyfqHRl2SgoTPnFci7SnSJ2ttzHLkJ lIwyfCnQLfSX5atJITJZrBKa333bQwf//sFe4achkXhM3NSuBh6V+yK5yMAPiqZ+ 6BWaw7RpjgyRUJqm/JPbAJoS0zH4W8IeRjP0uOSyLV4JYRrwnX9omqNRXAJoJL1U 44aS2271zU7uAGhDxhkoCvWuV0U35x+33c1jj8pEAQWzGhN92tmX2Kh4bpbdbTt8 euRkM8KXpc/CqnVEeh45QPM9Ia+0qjvjwFHF4r8RzYdunGqtRHHxZBylA== 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=c7km/lvZ5a2iHqu7qa5YLTQv7U1pBCi32tVq4pp5uwo=; b=OdDaXrWg hZrh9I3zmJc2ieYE4JGU2+2c9OdaZ7NoPfd2UebbAJt02XpqMgnIbh/t5tHbWWC1 xFc3BrgZ3zOKn0lLWylWVWVsVxEmpAR1VVKgFe4lbAAFGpHsFm2ybGCj1OiYP9ZS 0pZoDfHG7h9NVeRmbeL+VTatVfcGyqjEUg7iwPYuXFzFyYJgnxHZ3U6W0w2dJeTC ZXfIGUHgkSmfaouavZ0E+Z6IBRhBJf4lbVkpXYmmDk1z9/x9T11hlr1iHQQYtbLP lv3RSeKiFLMaPMeackfUBm2h8AVtNRU1ITobvPYHg+FdTYmm/I+D+K2p9mm6i7aV h2lOTaOBarN6lw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvuddrkeekgdeklecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofgjfhgggfestdekredtredttdenucfhrhhomhepofgrgihimhgv ucftihhprghrugcuoehmrgigihhmvgestggvrhhnohdrthgvtghhqeenucggtffrrghtth gvrhhnpedvkeelveefffekjefhffeuleetleefudeifeehuddugffghffhffehveevheeh vdenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehmrg igihhmvgestggvrhhnohdrthgvtghh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 13 Dec 2021 11:26:45 -0500 (EST) From: Maxime Ripard To: Maarten Lankhorst , Thomas Zimmermann , Maxime Ripard , Daniel Vetter , David Airlie , Florian Fainelli , Scott Branden , Nicolas Saenz Julienne , Rob Herring , Frank Rowand , Ray Jui Subject: [PATCH RESEND v4 v4 4/4] drm/vc4: Notify the firmware when DRM is in charge Date: Mon, 13 Dec 2021 17:26:35 +0100 Message-Id: <20211213162635.252582-5-maxime@cerno.tech> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211213162635.252582-1-maxime@cerno.tech> References: <20211213162635.252582-1-maxime@cerno.tech> MIME-Version: 1.0 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, 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 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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 c0d7e510694f..e4bb37a191f6 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;