Message ID | 20220815-rpi-fix-4k-60-v3-4-fc56729d11fe@cerno.tech (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org> 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 087D9C433FE for <linux-arm-kernel@archiver.kernel.org>; Thu, 13 Oct 2022 09:15:02 +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:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=uHhvkBSgna6uQxirSta2Bjk3pj/5zA1v88vWi0y/57Y=; b=pCKVM0Q6s8Pqpm qXrHLcn2z8y/GqAkAp4LrM6UmZytkobF783ITLNLrfrH4pSkaGuUSulXpKMeJn2aFzFFW7V8GVObt 0Z+84/hpT5b+W0w6qbpSsNIOAR9JXJT714v1YC1BDFi2yrcBBoRut0zeoRN5QCZU+q/lVnMxxofiz xDbIrRY0zEh+XZmbjrFHuDgsS35FOycctw+QgmWNWhCRX2PiVH6W/MQStbH+HkHw6IHC3CNGjIzeU y3BtlQViEsFYLdelpQWu3gtCLn6Ng2OpYnDfKLXRINLw03y2xdRvK31tf/cqMM0eAgEUCZTycZ1gO T4UieRVqndjPAuj5rVJQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oiuHu-00BEfD-Ee; Thu, 13 Oct 2022 09:13:58 +0000 Received: from out1-smtp.messagingengine.com ([66.111.4.25]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oiuHI-00BEPu-3b; Thu, 13 Oct 2022 09:13:21 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 7F4375C00EE; Thu, 13 Oct 2022 05:13:19 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Thu, 13 Oct 2022 05:13:19 -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:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm3; t=1665652399; x= 1665738799; bh=ZQjFpYF4e0Dy/cWO7rqPvZZq5y+2aveHJD01sKou3PU=; b=y cebru2AvS8YSPHdZivIu35r08q7j5b0spf7C2/oPrjCXnSPNwTe32zs7h8+CSW4N uC4pNldahFzjVWhzMkVvIOg0Zt9rxNMREr3pTZXS6o0X0IoCEOXhOdBQkY4MaVIv nERnRt16WNUhv2+k84DHjxJis9PTxACkchZfTD/ohIFT7uyY6JbR8GDMGA0ctluM jT7O5Jocer5xv1LHdk3qYvTt/KfkjjveiMgl7qAmqiCOkLjQHmHGLjJhL5nDzxwt 97a2SOoAArQplSz8sfdbmaQg7M8TpLZ58tXwCiqbOoZ/akdfwP4MXvOVHTiUiVbg xQ/LaeQKz4R0DcoWcEfHw== 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:in-reply-to:message-id:mime-version:references :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=1665652399; x= 1665738799; bh=ZQjFpYF4e0Dy/cWO7rqPvZZq5y+2aveHJD01sKou3PU=; b=e CFacKkbVJPckcAjNKWtetOmybTV+4rF97s1DA2qsNrPa4KK3Be7hFQf/qrWjgMoU 04VvoqoBG9hhUgCYjUvPqQj64YHWqfvHR+oUrZrWYRiij0OiEDp8UN58et6muUeu HZ0daqS/a2AFa6CqeLyxl2pr/zqBUt6zX5HV0lEZCOumoKIVVeVqh4kw90qOHF/k yjqUGyrYGsjGY1SJUKqPpXCbLdM5+ejBsYcCmtOvewyxp8FUgEyMBQ2Rt7m70MAt 0JKHp/3SPeByD3bOOB5WQvISdAX+AtcEP0UIeSfmE2kTls3nO94GUQKuh4G5/mIj 4y/1YwwCIc7SN6lO96Pmg== X-ME-Sender: <xms:r9ZHY_GdfQVLOeSjfglB0xcYKym97Le9pXvFT4W8bvltmCg_D1qVIg> <xme:r9ZHY8XhhBL6fzm5NKXbDcs0HXE84iSuGSJOxThimBPTXNEpeQ3Zh-eraoffjHXxS KbPO2d1wERiaUn9vJo> X-ME-Received: <xmr:r9ZHYxJ3ZzRUhva6njjqn2bdslbMIGrchMGOg-b1ZAnREj8WwTcdaT9U6YcAd5dlYHXrXSYS8upaE1MbbCOFfAytL1M-FKclptpH> X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrfeektddgudegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephfffufggtgfgkfhfjgfvvefosehtkeertdertdejnecuhfhrohhmpeforgig ihhmvgcutfhiphgrrhguuceomhgrgihimhgvsegtvghrnhhordhtvggthheqnecuggftrf grthhtvghrnhepudduudfhveejteefgedvffdvvedvjedugedukeejhedtlefhffevtefh jeeltdevnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomh epmhgrgihimhgvsegtvghrnhhordhtvggthh X-ME-Proxy: <xmx:r9ZHY9FKg-qB3tacvIdaShMlgcbAOQGBpanLi_HCtm2N_bYHAmRTAw> <xmx:r9ZHY1VlDkL4QTZYRvko5ph0Wc9hxup1iLnetMAl2uqJmwg5iyPcKA> <xmx:r9ZHY4MfbrDL0nNocNrzrBfAanjP_UxY2X0S5lvOndnUdLspXVoL8Q> <xmx:r9ZHY5nbg4AuF789wD4qgelnRDcWilivNPn9HVHS1Fevr3hksjuEng> Feedback-ID: i8771445c:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 13 Oct 2022 05:13:18 -0400 (EDT) From: Maxime Ripard <maxime@cerno.tech> Date: Thu, 13 Oct 2022 11:13:11 +0200 Subject: [PATCH v3 4/7] drm/vc4: hdmi: Fix hdmi_enable_4kp60 detection MIME-Version: 1.0 Message-Id: <20220815-rpi-fix-4k-60-v3-4-fc56729d11fe@cerno.tech> References: <20220815-rpi-fix-4k-60-v3-0-fc56729d11fe@cerno.tech> In-Reply-To: <20220815-rpi-fix-4k-60-v3-0-fc56729d11fe@cerno.tech> To: Florian Fainelli <f.fainelli@gmail.com>, Michael Turquette <mturquette@baylibre.com>, Emma Anholt <emma@anholt.net>, Stephen Boyd <sboyd@kernel.org>, Ray Jui <rjui@broadcom.com>, Scott Branden <sbranden@broadcom.com>, Broadcom internal kernel review list <bcm-kernel-feedback-list@broadcom.com>, Daniel Vetter <daniel@ffwll.ch>, David Airlie <airlied@linux.ie>, Maxime Ripard <mripard@kernel.org> Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Maxime Ripard <maxime@cerno.tech>, Stefan Wahren <stefan.wahren@i2se.com>, linux-clk@vger.kernel.org, linux-rpi-kernel@lists.infradead.org, Dom Cobley <popcornmix@gmail.com>, dri-devel@lists.freedesktop.org X-Mailer: b4 0.11.0-dev-7da52 X-Developer-Signature: v=1; a=openpgp-sha256; l=1913; i=maxime@cerno.tech; h=from:subject:message-id; bh=f1lo6Ai83eEY39RwlVf8bpafgmNreYn4rcZrYcxd9Lc=; b=owGbwMvMwCX2+D1vfrpE4FHG02pJDMnu15bYFYvKHn33JrTu102PFdfPm1y58np6WuKsB8lfp5Zs k59q1VHKwiDGxSArpsgSI2y+JO7UrNedbHzzYOawMoEMYeDiFICJmN5kZDg/c66DyqWv93i2ljpEBJ koGRybdOf53ffGiqeOaiwpzvjN8N+7rrvyffARowALc0e3+4uiJwpMuHpuKk+sGueEQBedCWwA 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-20221013_021320_271739_5257DE3E X-CRM114-Status: GOOD ( 13.82 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: <linux-arm-kernel.lists.infradead.org> List-Unsubscribe: <http://lists.infradead.org/mailman/options/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=unsubscribe> List-Archive: <http://lists.infradead.org/pipermail/linux-arm-kernel/> List-Post: <mailto:linux-arm-kernel@lists.infradead.org> List-Help: <mailto:linux-arm-kernel-request@lists.infradead.org?subject=help> List-Subscribe: <http://lists.infradead.org/mailman/listinfo/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=subscribe> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" <linux-arm-kernel-bounces@lists.infradead.org> Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org |
Series |
drm/vc4: Fix the core clock behaviour
|
expand
|
diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c index 1e5f68704d7d..3b75ac6fa0db 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c @@ -46,6 +46,7 @@ #include <linux/pm_runtime.h> #include <linux/rational.h> #include <linux/reset.h> +#include <soc/bcm2835/raspberrypi-clocks.h> #include <sound/dmaengine_pcm.h> #include <sound/hdmi-codec.h> #include <sound/pcm_drm_eld.h> @@ -2966,7 +2967,7 @@ static int vc4_hdmi_bind(struct device *dev, struct device *master, void *data) if (variant->max_pixel_clock == 600000000) { struct vc4_dev *vc4 = to_vc4_dev(drm); - long max_rate = clk_round_rate(vc4->hvs->core_clk, 550000000); + unsigned long max_rate = rpi_firmware_clk_get_max_rate(vc4->hvs->core_clk); if (max_rate < 550000000) vc4_hdmi->disable_4kp60 = true;
In order to support higher HDMI frequencies, users have to set the hdmi_enable_4kp60 parameter in their config.txt file. We were detecting this so far by calling clk_round_rate() on the core clock with the frequency we're supposed to run at when one of those modes is enabled. Whether or not the parameter was enabled could then be inferred by the returned rate since the maximum clock rate reported by the firmware was one of the side effect of setting that parameter. However, the recent clock rework we did changed what clk_round_rate() was returning to always return the minimum allowed, and thus this test wasn't reliable anymore. Let's use the new clk_get_max_rate() function to reliably determine the maximum rate allowed on that clock and fix the 4k@60Hz output. Fixes: e9d6cea2af1c ("clk: bcm: rpi: Run some clocks at the minimum rate allowed") Signed-off-by: Maxime Ripard <maxime@cerno.tech> --- drivers/gpu/drm/vc4/vc4_hdmi.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)