From patchwork Thu Oct 27 12:52:40 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 13022052 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 5BA82ECAAA1 for ; Thu, 27 Oct 2022 12:54:12 +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:Cc:To:Message-Id:Date:From:MIME-Version :Subject:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=tSgYnCIXU54en3xP3/dsNLVXIa1rzS7B0KYpCkXKgIc=; b=pZj1Mqbx7CSxMA zvMu2ttJDR1bq0JiTmsTkRz5Zd9n/g+UXmWNaQsxcqC7LovPHFexs1xG5nqG2LdQw7cwUN4VGlJaP AZVJG74vKcYa/I/PQzYSdGjYn8A+Hx1TVGT3pIKwsuXklmb9ZDjaI4oq3cyVYM2dmsF/gRerdGCMu azd3V75p+yxXPC5M8F52oerKULRSixB2wOoNa2zb7bgWsMBPGMBikzzN8p/wsgvVTO0rgM98NoQXY W5fomGcUqbWM3giObUzfSS5n6Dh5Mv32LDhMAB/o6SJK7Y4jU0fayhX9p+cSr8j4SVkFfU/16SkjD Ibr1cLSvmSQKQw7udCxA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oo2NX-00DF1O-SW; Thu, 27 Oct 2022 12:53:00 +0000 Received: from wout5-smtp.messagingengine.com ([64.147.123.21]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oo2NT-00DEx1-OB; Thu, 27 Oct 2022 12:52:57 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id 450EA3200319; Thu, 27 Oct 2022 08:52:48 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Thu, 27 Oct 2022 08:52:49 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cerno.tech; h=cc :cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:message-id:mime-version:reply-to:sender:subject :subject:to:to; s=fm3; t=1666875167; x=1666961567; bh=w4o6iJ7JBa uRcECwk6ayW6TZMn6N9eDIwjNyi4S//jM=; b=MXPNuijom34tZHHhczZJN9FsX+ RY1Gc9b5msDYB4o8xUH0ZNiceXpFJTPUu4cz38SibgDuKsA3hJLUILYbqHymnSo9 glxrM5VwDx6uxa8Us4i6D9Og7CyBNvhoEpKtfD2hiTj5DwgXTcGOWemi++/CuRm7 XCaCbb5iOS36GGMHfEY9UCcRRMOHDj+JSxJ3ukNMjtr19+4dxq3mF82b5T3ZYg0C 8+gjr8XZP5cT3R/hw7ldzfaE2aqXX9k7t5VkAIbdzgNNP25RmeYLd1lUJkzCD3XD /luzTcUhRKji/Wh6Tz3Hldl3RHCrC7GbkR7tssm36K21m2j67mGLHpqiEvsw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:message-id:mime-version:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; t=1666875167; x=1666961567; bh=w4o6iJ7JBauRc ECwk6ayW6TZMn6N9eDIwjNyi4S//jM=; b=NBiLE0bo4USWxeGoE3J2bg69LK0WX Sp8PxzJZC52gfbRiulzbehfoivLxB5mrLAKWTm1RbEs3o6F6B059pC5yKzytPvpQ SOmXWUqyA709nKlxQ85BgSmrkduzUyYva+FLwoQjdtbaTKRNgWfg3QtCpTMcZKxW Q1QCne6KBKoEGDoDn8eFsQhPPyHz1MkPyltqtW27X9aB8SdXeHxzl3RAuyjaoznO CVuaV6xzR1iSFU8OXVnKl2Aqo301GZuo1XCinthCBkY9go8tIjAd4bAuGNIqYOIV 1BnbKye+iTWD1kJPXxObpQLo2Sl2ohi8q9ELv4R7QajcaXaJT3vZBIvog== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvgedrtdeggdehhecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefugggtgffhfffkvfevofesthekredtredtjeenucfhrhhomhepofgrgihimhgv ucftihhprghrugcuoehmrgigihhmvgestggvrhhnohdrthgvtghhqeenucggtffrrghtth gvrhhnpeelueevteetffdvveelgfffleegudeufeelveefvddugeehkeefkeehjeeikeeg udenucffohhmrghinhepkhgvrhhnvghlrdhorhhgnecuvehluhhsthgvrhfuihiivgeptd enucfrrghrrghmpehmrghilhhfrhhomhepmhgrgihimhgvsegtvghrnhhordhtvggthh X-ME-Proxy: Feedback-ID: i8771445c:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 27 Oct 2022 08:52:46 -0400 (EDT) Subject: [PATCH v5 0/7] drm/vc4: Fix the core clock behaviour MIME-Version: 1.0 X-b4-tracking: H4sIABh/WmMC/33OTQrCMBAF4KtI1k5JJj9tXXkPcdGkiQ1CK0kJSundnboTsavhDXxvZmHZp+gzOx 0WlnyJOU4jBX08MDd0481D7Ckz5Ii8ERrSI0KIT1B3MBxEjbU0mitse0bGdtmDTd3ohk0VU/FtPcQ8 T+n1uVKQxuVfYUHg0DYSa2MbGQyenU/jVM2eGq9UVeQul8SD06amh4QI/oerXa6Id8IqrtH0QX7zdV 3fMcTxOTABAAA= From: Maxime Ripard Date: Thu, 27 Oct 2022 14:52:40 +0200 Message-Id: <20220815-rpi-fix-4k-60-v5-0-fe9e7ac8b111@cerno.tech> To: Stephen Boyd , Florian Fainelli , Maxime Ripard , Scott Branden , Broadcom internal kernel review list , Michael Turquette , Daniel Vetter , Emma Anholt , David Airlie , Ray Jui Cc: linux-rpi-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Dave Stevenson , Maxime Ripard , dri-devel@lists.freedesktop.org, Dom Cobley , linux-arm-kernel@lists.infradead.org, linux-clk@vger.kernel.org, Stefan Wahren X-Mailer: b4 0.11.0-dev-99e3a X-Developer-Signature: v=1; a=openpgp-sha256; l=3256; i=maxime@cerno.tech; h=from:subject:message-id; bh=D7FuhEopp2x9ehqwCkLl3TXHQsSl1JIzkh6YWIJGp30=; b=owGbwMvMwCX2+D1vfrpE4FHG02pJDMlR9TL/V8u61orwucrJzQ2+6yl7bo66mRHjGfNvgj+8Oudw fL/aUcrCIMbFICumyBIjbL4k7tSs151sfPNg5rAygQxh4OIUgIk8KWL4K/wnfP8hedcH8vHTK8+H7s 1YLfHKPNbzJP9aI47QA+W+dgz/jBrX2G3JvcBx4V/35V//C5Q2Xe2JP/tjxizNp80ZvpGPuQA= X-Developer-Key: i=maxime@cerno.tech; a=openpgp; fpr=BE5675C37E818C8B5764241C254BCFC56BF6CE8D X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221027_055255_859232_D14E0383 X-CRM114-Status: GOOD ( 10.71 ) 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 Hi, Those patches used to be part of a larger clock fixes series: https://lore.kernel.org/linux-clk/20220715160014.2623107-1-maxime@cerno.tech/ However, that series doesn't seem to be getting anywhere, so I've split out these patches that fix a regression that has been there since 5.18 and that prevents the 4k output from working on the RaspberryPi4. Hopefully, we will be able to merge those patches through the DRM tree to avoid any further disruption. Let me know what you think, Maxime To: Florian Fainelli To: Broadcom internal kernel review list To: Ray Jui To: Scott Branden To: Michael Turquette To: Stephen Boyd To: Emma Anholt To: Maxime Ripard To: David Airlie To: Daniel Vetter Cc: Stefan Wahren Cc: linux-rpi-kernel@lists.infradead.org Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org Cc: linux-clk@vger.kernel.org Cc: dri-devel@lists.freedesktop.org Cc: Dom Cobley Signed-off-by: Maxime Ripard --- Changes in v5: - Changed the bool name - Change type of variable storing the max rate to unsigned int - Link to v4: https://lore.kernel.org/r/20220815-rpi-fix-4k-60-v4-0-a1b40526df3e@cerno.tech Changes in v4: - Move the rpi_firmware_of_match to avoid confusion - Link to v3: https://lore.kernel.org/r/20220815-rpi-fix-4k-60-v3-0-fc56729d11fe@cerno.tech Changes in v3: - Return UINT_MAX when the firmware call fails in the _get_max_rate function - Link to v2: https://lore.kernel.org/r/20220815-rpi-fix-4k-60-v2-0-983276b83f62@cerno.tech Changes in v2: - Dropped the clock patches, made an ad-hoc function in the firmware driver - Link to v1: https://lore.kernel.org/r/20220815-rpi-fix-4k-60-v1-0-c52bd642f7c6@cerno.tech --- Dom Cobley (1): drm/vc4: hdmi: Add more checks for 4k resolutions Maxime Ripard (6): firmware: raspberrypi: Introduce rpi_firmware_find_node() firmware: raspberrypi: Move the clock IDs to the firmware header firmware: raspberrypi: Provide a helper to query a clock max rate drm/vc4: hdmi: Fix hdmi_enable_4kp60 detection drm/vc4: hdmi: Rework hdmi_enable_4kp60 detection code drm/vc4: Make sure we don't end up with a core clock too high drivers/clk/bcm/clk-raspberrypi.c | 19 ----------- drivers/firmware/raspberrypi.c | 38 ++++++++++++++++++---- drivers/gpu/drm/vc4/vc4_drv.h | 16 +++++++++ drivers/gpu/drm/vc4/vc4_hdmi.c | 25 +++++++------- drivers/gpu/drm/vc4/vc4_hdmi.h | 8 ----- drivers/gpu/drm/vc4/vc4_hvs.c | 26 +++++++++++++++ drivers/gpu/drm/vc4/vc4_kms.c | 13 +++++--- include/soc/bcm2835/raspberrypi-firmware.h | 52 ++++++++++++++++++++++++++++++ 8 files changed, 147 insertions(+), 50 deletions(-) --- base-commit: 9abf2313adc1ca1b6180c508c25f22f9395cc780 change-id: 20220815-rpi-fix-4k-60-17273650429d Best regards,