From patchwork Sat Jun 15 17:03:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonas Karlman X-Patchwork-Id: 13699319 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 BE504C27C4F for ; Sat, 15 Jun 2024 17:07:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=Z+F0UfaoXDdt1StVLr0ioIKGWYkN+1Ezu/cCRH69328=; b=HOZwcSkBPD0O28JCTdbDrl0ikO NMpVoRKw50Pv8w85v47tqzXsUobp8MUvwIVVYs19z6puPdNz9okicoFw5OhI5dRdFsWG679HFPjZt agzhBtP4/n8KWbzs+/qSPyzYAPmYAq1e5K2j5BQruXCUUwWZyZlahCvMxKXlXaWjLdNhD0MaWMg1z GcwlvmfqqWEbpgWBgPmF5AMMSf09eeMb9zjYoG8+kth2ywqWo0sFc58znVUP5tqh7Nmx8ay2wbvOE fruZ0IDo8nqbeiaSMRiZqhDqZ2kZefeVZ0esTTE1pD5gndfQmw3jq+UGRa+SlC53CKdFiaIAQ5MHO FCn6sPfA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sIWrm-00000005nS9-46QA; Sat, 15 Jun 2024 17:07:02 +0000 Received: from smtp.forwardemail.net ([167.172.40.54]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sIWpv-00000005m4I-1ahg for linux-arm-kernel@lists.infradead.org; Sat, 15 Jun 2024 17:05:09 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kwiboo.se; h=Content-Transfer-Encoding: MIME-Version: References: In-Reply-To: Message-ID: Date: Subject: Cc: To: From; q=dns/txt; s=fe-e1b5cab7be; t=1718471071; bh=Z+F0UfaoXDdt1StVLr0ioIKGWYkN+1Ezu/cCRH69328=; b=gl2OipOF7kftC5o30amFOfTBJ/fkhEX+26ZjhEcs4OmpBDB8MZSvOrkpFm1UVmNTpDPYKo6fl VoAFt4kA/sRfdG0huWAJ541GyjeAjvRsklqIRETfH0vGb/pg3NFz2AxlQrJpyZJEXZT4xFHFlRp EX2IHkZy2RM2WRmBPWJCVDP3+mxdC/LP/YrFnf4yFHVaH4yzV1NMb7SO3pe0+BtAyjtahGuIWzi TEj0AcY6b286ZQwiIOX2JN020rxFrvuV+ReUiIT82nDTmjcT7iXisZpWeTUq/gqhxusxa0U0s1w FtLchMGbsM24fpaCXLgg1XxlhUvDIrhFyKvzYrAPlK6w== From: Jonas Karlman To: dri-devel@lists.freedesktop.org, Rob Herring , Krzysztof Kozlowski , Conor Dooley , Heiko Stuebner , Liang Chen Cc: linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, Jonas Karlman , devicetree@vger.kernel.org Subject: [PATCH 01/13] arm64: dts: rockchip: Increase VOP clk rate on RK3328 Date: Sat, 15 Jun 2024 17:03:52 +0000 Message-ID: <20240615170417.3134517-2-jonas@kwiboo.se> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240615170417.3134517-1-jonas@kwiboo.se> References: <20240615170417.3134517-1-jonas@kwiboo.se> MIME-Version: 1.0 X-Report-Abuse-To: abuse@forwardemail.net X-Report-Abuse: abuse@forwardemail.net X-Complaints-To: abuse@forwardemail.net X-ForwardEmail-Version: 0.4.40 X-ForwardEmail-Sender: rfc822; jonas@kwiboo.se, smtp.forwardemail.net, 167.172.40.54 X-ForwardEmail-ID: 666dc99c24e0254b39803fe1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240615_100507_918876_3D3F45C9 X-CRM114-Status: UNSURE ( 9.73 ) 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 VOP on RK3328 needs to run at a higher rate in order to produce a proper 3840x2160 signal. Change to use 300MHz for VIO clk and 400MHz for VOP clk, same rates used by vendor 4.4 kernel. Fixes: 52e02d377a72 ("arm64: dts: rockchip: add core dtsi file for RK3328 SoCs") Signed-off-by: Jonas Karlman --- arch/arm64/boot/dts/rockchip/rk3328.dtsi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm64/boot/dts/rockchip/rk3328.dtsi b/arch/arm64/boot/dts/rockchip/rk3328.dtsi index 07dcc949b899..b01efd6d042c 100644 --- a/arch/arm64/boot/dts/rockchip/rk3328.dtsi +++ b/arch/arm64/boot/dts/rockchip/rk3328.dtsi @@ -850,8 +850,8 @@ cru: clock-controller@ff440000 { <0>, <24000000>, <24000000>, <24000000>, <15000000>, <15000000>, - <100000000>, <100000000>, - <100000000>, <100000000>, + <300000000>, <100000000>, + <400000000>, <100000000>, <50000000>, <100000000>, <100000000>, <100000000>, <50000000>, <50000000>, From patchwork Sat Jun 15 17:03:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonas Karlman X-Patchwork-Id: 13699307 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 169B8C27C4F for ; Sat, 15 Jun 2024 17:05:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=Bcu9b3VrUd6qIU98W1LB1PWRhdR9Skrn32v3O+4jLys=; b=ZQZVMpJzdY/ZToXCFG3iYftaY8 /j6B90RsyEgSaIMlMPdSWhsO3SPueN+OaORu3b8XuNe570t6SmBHack7aTOItTpWHqOdn//b7+BVs 1cK8dfrAh1PWTprd/P8Zz5mFK+oGLHhE4PlvOzngyxHBVeePw2feeSMI+XUlci79QdIFZm+QggIsG FxVlUIv/E/zWWNOSNKjlmLMTrQFkEjbthTdDQno0uzxG+0FosrEDR48riIphuB1HjPxO/rXEIKF1E IOaonOAs7gcORXIUpQEgxn1t5z0/KIfpMFNYzRUZ2UPuA21nx2a81fVQ5SSJtM4x7XHSywyfanISx DD+lEJxQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sIWqD-00000005mJk-2VvZ; Sat, 15 Jun 2024 17:05:25 +0000 Received: from smtp.forwardemail.net ([167.172.40.54]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sIWpt-00000005m24-3YtE for linux-arm-kernel@lists.infradead.org; Sat, 15 Jun 2024 17:05:08 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kwiboo.se; h=Content-Transfer-Encoding: MIME-Version: References: In-Reply-To: Message-ID: Date: Subject: Cc: To: From; q=dns/txt; s=fe-e1b5cab7be; t=1718471077; bh=Bcu9b3VrUd6qIU98W1LB1PWRhdR9Skrn32v3O+4jLys=; b=VsgaFdxQZVdNXIhi2U8zovuoyfyqq6MS8Pvmv8oeEMZteMpcVA0byLeJASQdB0fefyWcHfouS 8J0K1NeJi7BO9oPpRIAvtXWw/1lQ8k4UBpBk8IpaEs5m17UmQxhVLEcntfSscw5TsllSZ0QdL6Q 05rH8LmtsNXzy2K80jiMBpelMTwo1Yc0GwyNIpdghb36GKGWcV1sFYDg/XRhnr5FCykL4moQqI8 ra+OVnxmOvKsgydSgHmx6kFiV5fX8jPaoHEHlPXGJB14e6aNNH5GW3kVNApEkLXvn30m1Mmu4gX F5IsXxVrA5xqwgNVTQGlyXbGhLCRhkOKk50YmFvd6Gow== From: Jonas Karlman To: dri-devel@lists.freedesktop.org, Michael Turquette , Stephen Boyd , Heiko Stuebner , Yakir Yang , Jeffy Chen Cc: linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, Jonas Karlman , linux-clk@vger.kernel.org Subject: [PATCH 02/13] clk: rockchip: Set parent rate for DCLK_VOP clock on RK3228 Date: Sat, 15 Jun 2024 17:03:53 +0000 Message-ID: <20240615170417.3134517-3-jonas@kwiboo.se> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240615170417.3134517-1-jonas@kwiboo.se> References: <20240615170417.3134517-1-jonas@kwiboo.se> MIME-Version: 1.0 X-Report-Abuse-To: abuse@forwardemail.net X-Report-Abuse: abuse@forwardemail.net X-Complaints-To: abuse@forwardemail.net X-ForwardEmail-Version: 0.4.40 X-ForwardEmail-Sender: rfc822; jonas@kwiboo.se, smtp.forwardemail.net, 167.172.40.54 X-ForwardEmail-ID: 666dc9a024e0254b39803ff3 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240615_100506_258298_D522A604 X-CRM114-Status: GOOD ( 11.82 ) 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 Similar to DCLK_LCDC on RK3328, the DCLK_VOP on RK3228 is typically parented by the hdmiphy clk and it is expected that the DCLK_VOP and hdmiphy clk rate are kept in sync. Use CLK_SET_RATE_PARENT and CLK_SET_RATE_NO_REPARENT flags, same as used on RK3328, to make full use of all possible supported display modes. Fixes: 0a9d4ac08ebc ("clk: rockchip: set the clock ids for RK3228 VOP") Fixes: 307a2e9ac524 ("clk: rockchip: add clock controller for rk3228") Signed-off-by: Jonas Karlman --- drivers/clk/rockchip/clk-rk3228.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/clk/rockchip/clk-rk3228.c b/drivers/clk/rockchip/clk-rk3228.c index a24a35553e13..7343d2d7676b 100644 --- a/drivers/clk/rockchip/clk-rk3228.c +++ b/drivers/clk/rockchip/clk-rk3228.c @@ -409,7 +409,7 @@ static struct rockchip_clk_branch rk3228_clk_branches[] __initdata = { RK2928_CLKSEL_CON(29), 0, 3, DFLAGS), DIV(0, "sclk_vop_pre", "sclk_vop_src", 0, RK2928_CLKSEL_CON(27), 8, 8, DFLAGS), - MUX(DCLK_VOP, "dclk_vop", mux_dclk_vop_p, 0, + MUX(DCLK_VOP, "dclk_vop", mux_dclk_vop_p, CLK_SET_RATE_PARENT | CLK_SET_RATE_NO_REPARENT, RK2928_CLKSEL_CON(27), 1, 1, MFLAGS), FACTOR(0, "xin12m", "xin24m", 0, 1, 2), From patchwork Sat Jun 15 17:03:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonas Karlman X-Patchwork-Id: 13699308 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 D3B1CC2BA16 for ; Sat, 15 Jun 2024 17:05:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=HhA0TE6TtiMIUmeRX5oAVj2VQq5qfAon5bzRoNsK6Uc=; b=1vLXaK19XGFKNTEOZnfPa3v7So j57MIpCPSYeT4BVCBDmaQquxa1fRJ1cz/WV0GcVU+s+7goUhQk4a6cv0mx+uQzV3F6naPKlapH4rK 9xFpz+MtxrOH1srGR5cIMOFl9tV+/qcgo01SBBnjqfCoxk64WWzdxXgVv2t4+/YSy9vFemlzHTTpc GvwfbacFApl4OQ3d2OJ5ZnwD8m4GaefpiZmVIdprVOmlEVYazEW44JRzdwnseSM3awBw811On2akB 6/61Ox4nEbz2dULQ0zNH3lCFRKIzhR2q02NWUKlpxymbKC+DAtwiT9YLs/boFLGAAwUmTSPMyYhy1 KPBfSB+g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sIWqZ-00000005maH-1HRC; Sat, 15 Jun 2024 17:05:47 +0000 Received: from smtp.forwardemail.net ([167.172.40.54]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sIWpz-00000005m74-0Tsv for linux-arm-kernel@lists.infradead.org; Sat, 15 Jun 2024 17:05:12 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kwiboo.se; h=Content-Transfer-Encoding: MIME-Version: References: In-Reply-To: Message-ID: Date: Subject: Cc: To: From; q=dns/txt; s=fe-e1b5cab7be; t=1718471083; bh=HhA0TE6TtiMIUmeRX5oAVj2VQq5qfAon5bzRoNsK6Uc=; b=wdYarLR/xIMt+/TaQZFCWEdXALELm6MV2s2u+EWpEMMYvDj2VK2kd1QKKGTgOfRiQT92XLsDW oylGQlRaANeRA8uBiltNN0CRgVFK+wYlv+ulZTFnWmzV5r71bUa8aAshX+ojkicqonSDLe1wQgL +i/JsLSFnYKPnJ02B5FBApjKRsbQNQqrwxSAQOWHQ5yjWWn1zlJauJqUZY9pJzlDYBQ/9rHljAO Km/cIijyfgu/RwrZEJCIYoUBWCQ7iv3uZF+daT2CMwdfdE2OqYWCTEA6BXtpa4Wc3sWc+Pa225q AtwzvKflKMg1enlR/haeY1/HWXlmQMQZjV6hY2/qhnBg== From: Jonas Karlman To: dri-devel@lists.freedesktop.org, Sandy Huang , " =?utf-8?q?Heiko_St=C3=BCbner?= " , Andy Yan , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , Mark Yao Cc: linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, Jonas Karlman , Alex Bee Subject: [PATCH 03/13] drm/rockchip: vop: Allow 4096px width scaling Date: Sat, 15 Jun 2024 17:03:54 +0000 Message-ID: <20240615170417.3134517-4-jonas@kwiboo.se> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240615170417.3134517-1-jonas@kwiboo.se> References: <20240615170417.3134517-1-jonas@kwiboo.se> MIME-Version: 1.0 X-Report-Abuse-To: abuse@forwardemail.net X-Report-Abuse: abuse@forwardemail.net X-Complaints-To: abuse@forwardemail.net X-ForwardEmail-Version: 0.4.40 X-ForwardEmail-Sender: rfc822; jonas@kwiboo.se, smtp.forwardemail.net, 167.172.40.54 X-ForwardEmail-ID: 666dc9a524e0254b39804005 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240615_100511_472177_129DBBF5 X-CRM114-Status: GOOD ( 10.95 ) 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 From: Alex Bee There is no reason to limit VOP scaling to 3840px width, the limit of RK3288, when there are newer VOP versions that support 4096px width. Change to enforce a maximum of 4096px width plane scaling, the maximum supported output width of the VOP versions supported by this driver. Fixes: 4c156c21c794 ("drm/rockchip: vop: support plane scale") Signed-off-by: Alex Bee Signed-off-by: Jonas Karlman --- drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c index a13473b2d54c..4a9c6ea7f15d 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c +++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c @@ -396,8 +396,8 @@ static void scl_vop_cal_scl_fac(struct vop *vop, const struct vop_win_data *win, if (info->is_yuv) is_yuv = true; - if (dst_w > 3840) { - DRM_DEV_ERROR(vop->dev, "Maximum dst width (3840) exceeded\n"); + if (dst_w > 4096) { + DRM_DEV_ERROR(vop->dev, "Maximum dst width (4096) exceeded\n"); return; } From patchwork Sat Jun 15 17:03:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonas Karlman X-Patchwork-Id: 13699304 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 EE4DFC2BA12 for ; Sat, 15 Jun 2024 17:05:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=ScLXL7bFS6O80CUAw7XPEvNboE3+OLzOZeGQt7f1YM8=; b=Qutu9P/hTjV3X5KsSKQR8LkoAp uNR6Jd0/Axctxq9rYlOgpKmdd871sNFCbiid03Mc+bBQdV1Wx/oyNpHsG0hJzRtQp0wO5NKAzWhq5 BHfEJLPQqpX8qwPuf4eAv5N7T1p+pUif0mL+b1CRX6Y3mMHg2U/xTQsiezQHhi7uPlW045E3BuPZ0 aHC7/b5RmHUXMxRaJ4udXAqZCc9EzXk6QDbIpRxenqCM5pLW8JsT4mxHdXmqgjnZAf9gPh64uLw3Y LtM0oZ0Rf/5iQmNffntdzvCaf8L4ZRZhHtnFdeSnjtHOKxuLLOI6jMIAAoQoMVXVKPlOhW7P9rHjV iIH3jswA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sIWps-00000005m3I-2T7l; Sat, 15 Jun 2024 17:05:04 +0000 Received: from smtp.forwardemail.net ([149.28.215.223]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sIWpo-00000005m1q-2P9O for linux-arm-kernel@lists.infradead.org; Sat, 15 Jun 2024 17:05:02 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kwiboo.se; h=Content-Transfer-Encoding: MIME-Version: References: In-Reply-To: Message-ID: Date: Subject: Cc: To: From; q=dns/txt; s=fe-e1b5cab7be; t=1718471088; bh=ScLXL7bFS6O80CUAw7XPEvNboE3+OLzOZeGQt7f1YM8=; b=ZfBioXxC9wdsuv/hmnLGAyHS8SG5v8V3O90I14kxOVFdM9JNS3sWhXnQa69lmTpsh7uxLE06Y pUDefr+5stvFp0SzZOTVnmsF+exPTBti6EZkPTT1BGZk8/rRCBOTatX+vqcGsu2g8Zdlape3DBs YVVTNxUgJMyKJw2XvyQnybRE/NgQ1IXUeZj6+q49OuqugdPvDrCmmZKsWzxnm7ogB41EFF+imIk xkFOjfgLDSrDwJWRpcQg46DxkMBHfIqjd9mFVWuNJcSFZRKQIg4aT1bxbUUwONkUcvzrYh9YtiB 0UqnVpCnxmtZ9owhF2Y6oSEei5zC1kUDe50iziSHUV2Q== From: Jonas Karlman To: dri-devel@lists.freedesktop.org, Sandy Huang , " =?utf-8?q?Heiko_St=C3=BCbner?= " , Andy Yan , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , Rob Herring , Zheng Yang Cc: linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, Jonas Karlman Subject: [PATCH 04/13] drm/rockchip: dw_hdmi: Fix reading EDID when using a forced mode Date: Sat, 15 Jun 2024 17:03:55 +0000 Message-ID: <20240615170417.3134517-5-jonas@kwiboo.se> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240615170417.3134517-1-jonas@kwiboo.se> References: <20240615170417.3134517-1-jonas@kwiboo.se> MIME-Version: 1.0 X-Report-Abuse-To: abuse@forwardemail.net X-Report-Abuse: abuse@forwardemail.net X-Complaints-To: abuse@forwardemail.net X-ForwardEmail-Version: 0.4.40 X-ForwardEmail-Sender: rfc822; jonas@kwiboo.se, smtp.forwardemail.net, 149.28.215.223 X-ForwardEmail-ID: 666dc9aa24e0254b3980401b X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240615_100501_798463_2DEE3CF3 X-CRM114-Status: GOOD ( 10.31 ) 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 EDID cannot be read on RK3328 until after read_hpd has been called and correct io voltage has been configured based on connection status. When a forced mode is used, e.g. video=1920x1080@60e, the connector detect ops, that in turn normally calls the read_hpd, never gets called. This result in reading EDID to fail in connector get_modes ops. Call dw_hdmi_rk3328_read_hpd at end of dw_hdmi_rk3328_setup_hpd to correct io voltage and allow reading EDID after setup_hpd. Fixes: 1c53ba8f22a1 ("drm/rockchip: dw_hdmi: add dw-hdmi support for the rk3328") Signed-off-by: Jonas Karlman --- drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c b/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c index fe33092abbe7..aae48e906af1 100644 --- a/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c +++ b/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c @@ -434,6 +434,8 @@ static void dw_hdmi_rk3328_setup_hpd(struct dw_hdmi *dw_hdmi, void *data) HIWORD_UPDATE(RK3328_HDMI_SDAIN_MSK | RK3328_HDMI_SCLIN_MSK, RK3328_HDMI_SDAIN_MSK | RK3328_HDMI_SCLIN_MSK | RK3328_HDMI_HPD_IOE)); + + dw_hdmi_rk3328_read_hpd(dw_hdmi, data); } static const struct dw_hdmi_phy_ops rk3228_hdmi_phy_ops = { From patchwork Sat Jun 15 17:03:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonas Karlman X-Patchwork-Id: 13699305 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 2F5ECC27C4F for ; Sat, 15 Jun 2024 17:05: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:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=rE9asUiY4ZOTyebep+Vmd5NsRtFQtl4VkUu5CnexPvE=; b=hQTUGMEg7AVZ+SxAbsxokNQtYy Kxehfbpr0ok3cd2SUoEc7EhShQPsG9iirVDYuxdYwWgq8CQxvEQkcXRdzTwylybNpSlC707HVD4kf 6QZfxc9TvDtOrfi1zzJKvbFSpFQTRHHLHHqqNGbmVy7LUgTCo9BHQZql7OLjKBuTkCB/so9QuR4Om IdGZAL/XN4wtTqM5UQ1BosSct+aB9QqbKRxUFgc67+EzsrsuZ+iKib6odiDULX8TUxNQ0B2zCt4H3 L+K2RK02YeBY8+wHvYdprm1wKnO8TpCspq3LNg9MFr3QQJ+fIAU4kpfzoKwuN+Z8e4m29Ig9fC/ev 9hX+LTUw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sIWq1-00000005m9l-0CAp; Sat, 15 Jun 2024 17:05:13 +0000 Received: from smtp.forwardemail.net ([149.28.215.223]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sIWps-00000005m2k-1kqr for linux-arm-kernel@lists.infradead.org; Sat, 15 Jun 2024 17:05:06 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kwiboo.se; h=Content-Transfer-Encoding: MIME-Version: References: In-Reply-To: Message-ID: Date: Subject: Cc: To: From; q=dns/txt; s=fe-e1b5cab7be; t=1718471093; bh=rE9asUiY4ZOTyebep+Vmd5NsRtFQtl4VkUu5CnexPvE=; b=FWXFcMP47lR8H8YxHNYa/fV6AxS1uFcmdCAZimBCRF0xVz31IkkUJckVerEyecHBog7vL1+NV ZiG3dqOJtrA/CGmGMtW8tlF3z9KiSOY/E1UvDY1kZmNPhdBWANgUzrwJKIzAwiN1Kqu7axM4DFS EZ04XIyEwgcYS62O+D7+1Cg69SrZ2JBnht/jp/MV7I0X67L7NN79ZNbJRNChzd5BjJpEtFhbT/N 3Bhdp53pPmL7Nb5plZiF6FcxN1nIbS/Sj0H5IYsdHB5G+eGDx+4aDYqltHoQUAe89jcJ94devY0 kX7tnZpOn0ZMaYisgs0zO+ZLwRBy1JjN/oGcIM71wmUw== From: Jonas Karlman To: dri-devel@lists.freedesktop.org, Sandy Huang , " =?utf-8?q?Heiko_St=C3=BCbner?= " , Andy Yan , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter Cc: linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, Jonas Karlman Subject: [PATCH 05/13] drm/rockchip: dw_hdmi: Allow High TMDS Bit Rates Date: Sat, 15 Jun 2024 17:03:56 +0000 Message-ID: <20240615170417.3134517-6-jonas@kwiboo.se> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240615170417.3134517-1-jonas@kwiboo.se> References: <20240615170417.3134517-1-jonas@kwiboo.se> MIME-Version: 1.0 X-Report-Abuse-To: abuse@forwardemail.net X-Report-Abuse: abuse@forwardemail.net X-Complaints-To: abuse@forwardemail.net X-ForwardEmail-Version: 0.4.40 X-ForwardEmail-Sender: rfc822; jonas@kwiboo.se, smtp.forwardemail.net, 149.28.215.223 X-ForwardEmail-ID: 666dc9af24e0254b3980402d X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240615_100504_524884_E94AA2EE X-CRM114-Status: UNSURE ( 8.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 Call dw_hdmi_set_high_tmds_clock_ratio in phy init ops to allow support of High TMDS Bit Rates used by HDMI2.0 display modes. Signed-off-by: Jonas Karlman --- drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c b/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c index aae48e906af1..5df9c9a0d369 100644 --- a/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c +++ b/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c @@ -362,6 +362,8 @@ static int dw_hdmi_rockchip_genphy_init(struct dw_hdmi *dw_hdmi, void *data, { struct rockchip_hdmi *hdmi = (struct rockchip_hdmi *)data; + dw_hdmi_set_high_tmds_clock_ratio(dw_hdmi, display); + return phy_power_on(hdmi->phy); } From patchwork Sat Jun 15 17:03:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonas Karlman X-Patchwork-Id: 13699306 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 0736EC27C4F for ; Sat, 15 Jun 2024 17:05:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=BeNUhMeywog7bd6GhDGutHucpUbeatl4//PsQAMTER0=; b=uJGu7ilZTvgOncFNMt1aSbRo1e aO+6sRF7/FSCHtWrYn4nEpGlZBd0k2wtFJbHe5uAiLUxj09zUsJbcNhD06CrBicmoyBxUoiOiFBkM hiBlvl2Ez9B+NRejbv7ReOD4FqoHY+GBpmLFagwb1NuoNNk8wPGPkMjU7p2aRgq28kl+uiQZyWWtd a8k3oey6RukfcYcrX5x5ftbXEOfNFTqvCpXBN44dcbaacfGprNyBFftMuWIMPH8QW60+k7VfEXIcj rQPJclxJxKzdERj8Rgzx6de4TN2lsj1MevAG6E4bUG60f0s4WLpaijcGvKZ4S/fztDyiJBZcYkdGU gOUyIHgw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sIWqA-00000005mGs-00xm; Sat, 15 Jun 2024 17:05:22 +0000 Received: from smtp.forwardemail.net ([149.28.215.223]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sIWpt-00000005m3K-2sFy for linux-arm-kernel@lists.infradead.org; Sat, 15 Jun 2024 17:05:08 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kwiboo.se; h=Content-Transfer-Encoding: MIME-Version: References: In-Reply-To: Message-ID: Date: Subject: Cc: To: From; q=dns/txt; s=fe-e1b5cab7be; t=1718471093; bh=BeNUhMeywog7bd6GhDGutHucpUbeatl4//PsQAMTER0=; b=b2iV5b79YLwntOIIK9dwVOGQX4dlmrqiQjTDw/2pvxEPm/2Mmb19Tb1mrjMXD5RdKrB6JNpB/ 0G/+edN4yucHSvXyVvLxqlg5NuNhANTil12MwFco0xgZJG4HGxDBWDQl5Zzz4tsZw/fZJ7Y3GF3 00eb3bhkSNC5+nxUKJizpKPGEHpZ6Hs7uq157jtLGughoEyCP2vvKLkTWJ7xKA7QG0/9jD32CCt 4XlAAv4G/mh95xpwaZLFUNA5Ets5GcMS5IzdV0oLQsZyUW4yYYrTFcGQc0eNBPZxIESncktva+8 KE949JhftNNmU+601kcJ73MO09rsRDk/AehrOmxYpT9A== From: Jonas Karlman To: dri-devel@lists.freedesktop.org, Sandy Huang , " =?utf-8?q?Heiko_St=C3=BCbner?= " , Andy Yan , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter Cc: linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, Jonas Karlman Subject: [PATCH 06/13] drm/rockchip: dw_hdmi: Add max_tmds_clock validation Date: Sat, 15 Jun 2024 17:03:57 +0000 Message-ID: <20240615170417.3134517-7-jonas@kwiboo.se> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240615170417.3134517-1-jonas@kwiboo.se> References: <20240615170417.3134517-1-jonas@kwiboo.se> MIME-Version: 1.0 X-Report-Abuse-To: abuse@forwardemail.net X-Report-Abuse: abuse@forwardemail.net X-Complaints-To: abuse@forwardemail.net X-ForwardEmail-Version: 0.4.40 X-ForwardEmail-Sender: rfc822; jonas@kwiboo.se, smtp.forwardemail.net, 149.28.215.223 X-ForwardEmail-ID: 666dc9b324e0254b3980403f X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240615_100506_782045_2FCF78CD X-CRM114-Status: GOOD ( 11.88 ) 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 Add max_tmds_clock validation to prepare for additions and changes to the MPLL config table. Use the same rate restrictions that is currently applied. The rate limit for RK3288, RK3399 and RK3568 is based on current mpll table. The rate limit for RK3228 and RK3228 is based on the inno-hdmi-phy pre-pll table. Signed-off-by: Jonas Karlman --- drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c b/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c index 5df9c9a0d369..75b5d63ec570 100644 --- a/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c +++ b/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c @@ -61,11 +61,13 @@ * @lcdsel_grf_reg: grf register offset of lcdc select * @lcdsel_big: reg value of selecting vop big for HDMI * @lcdsel_lit: reg value of selecting vop little for HDMI + * @max_tmds_clock: maximum TMDS clock rate supported */ struct rockchip_hdmi_chip_data { int lcdsel_grf_reg; u32 lcdsel_big; u32 lcdsel_lit; + int max_tmds_clock; }; struct rockchip_hdmi { @@ -259,6 +261,10 @@ dw_hdmi_rockchip_mode_valid(struct dw_hdmi *dw_hdmi, void *data, bool exact_match = hdmi->plat_data->phy_force_vendor; int i; + if (hdmi->chip_data->max_tmds_clock && + mode->clock > hdmi->chip_data->max_tmds_clock) + return MODE_CLOCK_HIGH; + if (hdmi->ref_clk) { int rpclk = clk_round_rate(hdmi->ref_clk, pclk); @@ -450,6 +456,7 @@ static const struct dw_hdmi_phy_ops rk3228_hdmi_phy_ops = { static struct rockchip_hdmi_chip_data rk3228_chip_data = { .lcdsel_grf_reg = -1, + .max_tmds_clock = 594000, }; static const struct dw_hdmi_plat_data rk3228_hdmi_drv_data = { @@ -467,6 +474,7 @@ static struct rockchip_hdmi_chip_data rk3288_chip_data = { .lcdsel_grf_reg = RK3288_GRF_SOC_CON6, .lcdsel_big = HIWORD_UPDATE(0, RK3288_HDMI_LCDC_SEL), .lcdsel_lit = HIWORD_UPDATE(RK3288_HDMI_LCDC_SEL, RK3288_HDMI_LCDC_SEL), + .max_tmds_clock = 340000, }; static const struct dw_hdmi_plat_data rk3288_hdmi_drv_data = { @@ -487,6 +495,7 @@ static const struct dw_hdmi_phy_ops rk3328_hdmi_phy_ops = { static struct rockchip_hdmi_chip_data rk3328_chip_data = { .lcdsel_grf_reg = -1, + .max_tmds_clock = 594000, }; static const struct dw_hdmi_plat_data rk3328_hdmi_drv_data = { @@ -505,6 +514,7 @@ static struct rockchip_hdmi_chip_data rk3399_chip_data = { .lcdsel_grf_reg = RK3399_GRF_SOC_CON20, .lcdsel_big = HIWORD_UPDATE(0, RK3399_HDMI_LCDC_SEL), .lcdsel_lit = HIWORD_UPDATE(RK3399_HDMI_LCDC_SEL, RK3399_HDMI_LCDC_SEL), + .max_tmds_clock = 340000, }; static const struct dw_hdmi_plat_data rk3399_hdmi_drv_data = { @@ -518,6 +528,7 @@ static const struct dw_hdmi_plat_data rk3399_hdmi_drv_data = { static struct rockchip_hdmi_chip_data rk3568_chip_data = { .lcdsel_grf_reg = -1, + .max_tmds_clock = 340000, }; static const struct dw_hdmi_plat_data rk3568_hdmi_drv_data = { From patchwork Sat Jun 15 17:03:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonas Karlman X-Patchwork-Id: 13699309 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 3C930C27C4F for ; Sat, 15 Jun 2024 17:06:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=GI0v1s8ba9SK2ZoNJqavRuohwLSEeWbP8DGokxC9tW4=; b=oUUgBie9sOKSCe0hbPKFKzLg3S d9oNy55rKZ18pgy0WRbtnXBFjmuulPSvtkzUnSneJc2c69U0xphJLAdzcHP/2WuJv9sDfkgGDxdxV vC/mQ9skVjqi5++hh2oG0wJNFKHJm1+MMRX7mFLIRQyYOuv3zoK3Rj9pQjij8RkreIaOjNHjqLUmX GV7Mp4oVFubMN+PVjppC/29GbuT9Pm3UGyxTVZoycgceLyyT8JbDjezdmSbWG7gHgZIHr884MzsDo AeEqqjt0M6zxZxmdCnMDmMSg1xKmI6rVb1/jsfXJ+QqEl2ELZ/jqyjjQaPNx06TvwfiyZzRKlkcya E5wUuP5Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sIWqc-00000005mce-1OKa; Sat, 15 Jun 2024 17:05:50 +0000 Received: from smtp.forwardemail.net ([149.28.215.223]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sIWq3-00000005m9V-036a for linux-arm-kernel@lists.infradead.org; Sat, 15 Jun 2024 17:05:16 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kwiboo.se; h=Content-Transfer-Encoding: MIME-Version: References: In-Reply-To: Message-ID: Date: Subject: Cc: To: From; q=dns/txt; s=fe-e1b5cab7be; t=1718471099; bh=GI0v1s8ba9SK2ZoNJqavRuohwLSEeWbP8DGokxC9tW4=; b=RYMWVOAZ5kB+dNdeVN9+EVw4xWPsjtu8LvSzkDFR4POoYVfeoqNw2mgQKa7Ywefjcib06gxbv zs/VpXvp7qYu1XiOPwfcYLm+KH6cC0qJ+z93m+g7EvPW5LG/VBoVr8J+7O+sM6iryN0rgvwvxxt PyU5etW9Pb+Fbs48XXrKflpRmcL9WW5BxnYrISEHhuZTCXfDiMqxKzPQ4T3pcAMMSqx0F31shJ0 v8eEQfKN24WkalSiJQiui3G0F5PL1n+wJrJXQOphHRvxUx+ohxcDGOdEdG3AzkOMIrY1wQyJdCP nnM/rLk3oCdOD9s1bD/OP3ncsKcI3/LUFSmtoUWfaccg== From: Jonas Karlman To: dri-devel@lists.freedesktop.org, Sandy Huang , " =?utf-8?q?Heiko_St=C3=BCbner?= " , Andy Yan , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter Cc: linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, Jonas Karlman Subject: [PATCH 07/13] drm/rockchip: dw_hdmi: Filter modes based on hdmiphy_clk Date: Sat, 15 Jun 2024 17:03:58 +0000 Message-ID: <20240615170417.3134517-8-jonas@kwiboo.se> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240615170417.3134517-1-jonas@kwiboo.se> References: <20240615170417.3134517-1-jonas@kwiboo.se> MIME-Version: 1.0 X-Report-Abuse-To: abuse@forwardemail.net X-Report-Abuse: abuse@forwardemail.net X-Complaints-To: abuse@forwardemail.net X-ForwardEmail-Version: 0.4.40 X-ForwardEmail-Sender: rfc822; jonas@kwiboo.se, smtp.forwardemail.net, 149.28.215.223 X-ForwardEmail-ID: 666dc9b824e0254b39804051 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240615_100515_167343_42BD45E5 X-CRM114-Status: GOOD ( 17.33 ) 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 RK3228 and RK3328 clock rate is being validated against a mpll config table intended for Synopsys phy, and not the inno-hdmi-phy used. Instead get a reference to the hdmiphy clk and validate rates against it to enable use of HDMI2.0 modes, e.g. 4K@60Hz, on RK3228 and RK3328. For Synopsis phy the max_tmds_clock validation is sufficient. Signed-off-by: Jonas Karlman --- drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c | 35 ++++++++++----------- 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c b/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c index 75b5d63ec570..4acf73b5692a 100644 --- a/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c +++ b/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c @@ -76,6 +76,7 @@ struct rockchip_hdmi { struct rockchip_encoder encoder; const struct rockchip_hdmi_chip_data *chip_data; const struct dw_hdmi_plat_data *plat_data; + struct clk *hdmiphy_clk; struct clk *ref_clk; struct clk *grf_clk; struct dw_hdmi *hdmi; @@ -256,10 +257,7 @@ dw_hdmi_rockchip_mode_valid(struct dw_hdmi *dw_hdmi, void *data, const struct drm_display_mode *mode) { struct rockchip_hdmi *hdmi = data; - const struct dw_hdmi_mpll_config *mpll_cfg = rockchip_mpll_cfg; int pclk = mode->clock * 1000; - bool exact_match = hdmi->plat_data->phy_force_vendor; - int i; if (hdmi->chip_data->max_tmds_clock && mode->clock > hdmi->chip_data->max_tmds_clock) @@ -268,26 +266,18 @@ dw_hdmi_rockchip_mode_valid(struct dw_hdmi *dw_hdmi, void *data, if (hdmi->ref_clk) { int rpclk = clk_round_rate(hdmi->ref_clk, pclk); - if (abs(rpclk - pclk) > pclk / 1000) + if (rpclk < 0 || abs(rpclk - pclk) > pclk / 1000) return MODE_NOCLOCK; } - for (i = 0; mpll_cfg[i].mpixelclock != (~0UL); i++) { - /* - * For vendor specific phys force an exact match of the pixelclock - * to preserve the original behaviour of the driver. - */ - if (exact_match && pclk == mpll_cfg[i].mpixelclock) - return MODE_OK; - /* - * The Synopsys phy can work with pixelclocks up to the value given - * in the corresponding mpll_cfg entry. - */ - if (!exact_match && pclk <= mpll_cfg[i].mpixelclock) - return MODE_OK; + if (hdmi->hdmiphy_clk) { + int rpclk = clk_round_rate(hdmi->hdmiphy_clk, pclk); + + if (rpclk < 0 || abs(rpclk - pclk) > pclk / 1000) + return MODE_NOCLOCK; } - return MODE_BAD; + return MODE_OK; } static void dw_hdmi_rockchip_encoder_disable(struct drm_encoder *encoder) @@ -638,6 +628,15 @@ static int dw_hdmi_rockchip_bind(struct device *dev, struct device *master, goto err_clk; } + if (hdmi->phy) { + struct of_phandle_args clkspec; + + clkspec.np = hdmi->phy->dev.of_node; + hdmi->hdmiphy_clk = of_clk_get_from_provider(&clkspec); + if (IS_ERR(hdmi->hdmiphy_clk)) + hdmi->hdmiphy_clk = NULL; + } + if (hdmi->chip_data == &rk3568_chip_data) { regmap_write(hdmi->regmap, RK3568_GRF_VO_CON1, HIWORD_UPDATE(RK3568_HDMI_SDAIN_MSK | From patchwork Sat Jun 15 17:03:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonas Karlman X-Patchwork-Id: 13699316 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 BE964C27C4F for ; Sat, 15 Jun 2024 17:06:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=edw+pFynRH27QoyX9zOhxiRHTMZh2GXeD3zDbH9aM0s=; b=IJUBVXk62ALIVafPENSIeZGieo U4y+rqCF0+TwYLhYyOFC/R6DDNjgTjUD1t88Yq4g+UfhXWLfC/cTAxFlK6Dk7Bz+h09b7XbbsPf6d +2HNvuhXY6DmrX16wzSmI1CC1n2pIDdnPLDNFvKbQj6jpBW6q5JnwHKz7zRvVNXYdaX7JZ6rweWc4 YHn9dvnIUT8/vSkeTBMlaPWkWa+CvGrcgDwqYduojp2vf3DI//zR9KNvg3yekolYQb/9L+fb6PH7b 34Uh+bs8X2htyEBnB1pNtNcvERBGaoDflPkkvcqjzrUR36R3ej9Ao11CLlVn70iUXeXcE7tEBySFS 5ULs/teA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sIWrF-00000005n4q-0bAA; Sat, 15 Jun 2024 17:06:29 +0000 Received: from smtp.forwardemail.net ([149.28.215.223]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sIWq8-00000005mE9-2lkh for linux-arm-kernel@lists.infradead.org; Sat, 15 Jun 2024 17:05:23 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kwiboo.se; h=Content-Transfer-Encoding: MIME-Version: References: In-Reply-To: Message-ID: Date: Subject: Cc: To: From; q=dns/txt; s=fe-e1b5cab7be; t=1718471104; bh=edw+pFynRH27QoyX9zOhxiRHTMZh2GXeD3zDbH9aM0s=; b=kgwOB6T9ULzOyWUr9ARhoa84VHR8MpP83DdZtBKx7BfN70hCPCQoh6eKUUhtLaDgxmSiWxrNS mYMQeiPPyuYUlA9Gx9Bu+TYqJCNO60ThAs6sSNkbp/bL3/c3VQm6QCnNmcWHYGc0LKxzVDesT+l jaekM0HuQ0zlKSmOqsDobkxiUkz2GkIlRngHoQy7HNmUdMt69Mgc9lMLRinQwbaIZS4ecpnTfTO e+H4/8XTXH6R6BF3jAqaWsH99x1/DfxzZALnFqL07VOtZepSfkp27prRW6EnnWtgMj4h00yr1/k Q6xtONoLwuF3fVdChuopAvi+jGBGkM5ekYoE2ZNwTu+w== From: Jonas Karlman To: dri-devel@lists.freedesktop.org, Sandy Huang , " =?utf-8?q?Heiko_St=C3=BCbner?= " , Andy Yan , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter Cc: linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, Jonas Karlman , Yakir Yang Subject: [PATCH 08/13] drm/rockchip: dw_hdmi: Adjust cklvl & txlvl for RF/EMI Date: Sat, 15 Jun 2024 17:03:59 +0000 Message-ID: <20240615170417.3134517-9-jonas@kwiboo.se> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240615170417.3134517-1-jonas@kwiboo.se> References: <20240615170417.3134517-1-jonas@kwiboo.se> MIME-Version: 1.0 X-Report-Abuse-To: abuse@forwardemail.net X-Report-Abuse: abuse@forwardemail.net X-Complaints-To: abuse@forwardemail.net X-ForwardEmail-Version: 0.4.40 X-ForwardEmail-Sender: rfc822; jonas@kwiboo.se, smtp.forwardemail.net, 149.28.215.223 X-ForwardEmail-ID: 666dc9bc24e0254b39804063 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240615_100520_886178_A82BFC8E X-CRM114-Status: GOOD ( 13.57 ) 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 From: Yakir Yang Dut to the high HDMI signal voltage driver, Mickey have meet a serious RF/EMI problem, so we decided to reduce HDMI signal voltage to a proper value. The default params for phy is cklvl = 20 & txlvl = 13 (RF/EMI failed) ck: lvl = 13, term=100, vlo = 2.71, vhi=3.14, vswing = 0.43 tx: lvl = 20, term=100, vlo = 2.81, vhi=3.16, vswing = 0.35 1. We decided to reduce voltage value to lower, but VSwing still keep high, RF/EMI have been improved but still failed. ck: lvl = 6, term=100, vlo = 2.61, vhi=3.11, vswing = 0.50 tx: lvl = 6, term=100, vlo = 2.61, vhi=3.11, vswing = 0.50 2. We try to keep voltage value and vswing both lower, then RF/EMI test all passed ;) ck: lvl = 11, term= 66, vlo = 2.68, vhi=3.09, vswing = 0.40 tx: lvl = 11, term= 66, vlo = 2.68, vhi=3.09, vswing = 0.40 When we back to run HDMI different test and single-end test, we see different test passed, but signle-end test failed. The oscilloscope show that simgle-end clock's VL value is 1.78v (which remind LowLimit should not lower then 2.6v). 3. That's to say there are some different between PHY document and measure value. And according to experiment 2 results, we need to higher clock voltage and lower data voltage, then we can keep RF/EMI satisfied and single-end & differen test passed. ck: lvl = 9, term=100, vlo = 2.65, vhi=3.12, vswing = 0.47 tx: lvl = 16, term=100, vlo = 2.75, vhi=3.15, vswing = 0.39 Signed-off-by: Yakir Yang Signed-off-by: Jonas Karlman --- drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c b/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c index 4acf73b5692a..205cfe02079f 100644 --- a/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c +++ b/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c @@ -204,7 +204,7 @@ static const struct dw_hdmi_curr_ctrl rockchip_cur_ctr[] = { static const struct dw_hdmi_phy_config rockchip_phy_config[] = { /*pixelclk symbol term vlev*/ { 74250000, 0x8009, 0x0004, 0x0272}, - { 148500000, 0x802b, 0x0004, 0x028d}, + { 165000000, 0x802b, 0x0004, 0x0209}, { 297000000, 0x8039, 0x0005, 0x028d}, { ~0UL, 0x0000, 0x0000, 0x0000} }; From patchwork Sat Jun 15 17:04:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonas Karlman X-Patchwork-Id: 13699310 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 BBE48C27C7B for ; Sat, 15 Jun 2024 17:06:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=tr1oTKBW1hAs0ekTXTS14VMXssfmixvxHWASJNa7PTY=; b=oNIi9b961bxGmfJAIlEvVxpKnG ZpPP0Ca2YWYvAmLEbzzacA5/+eDVQT7ZnS4B/xX/Gxsfk2VzG8S8CBoHns1fjsD4TYUqDpl02bVrO RvBIYKF4yWvvjlEfZ3vScPrwohbkpSYH7mAyMCkpz/PMXVxKDJPxOP4U4v5VGTvoAzzDPtqzG8zSv U3iaKchM1RZiSZb/ZGrmZbbqJjbQ8HlmKJHjQ3d7fIrgzwWJ9/cecHWnz7LjWDEc/iQVhptR/tFt2 fsuHF3kEyG73wOkLpxLYY31GiHQp7JSLRo5oeFsEMnYvj+yUNjYs7hvYaHgpRpUYkOgB5AtuMGZJq jEa0OAHQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sIWqx-00000005mt9-3lzu; Sat, 15 Jun 2024 17:06:11 +0000 Received: from smtp.forwardemail.net ([149.28.215.223]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sIWqB-00000005mHE-18DK for linux-arm-kernel@lists.infradead.org; Sat, 15 Jun 2024 17:05:25 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kwiboo.se; h=Content-Transfer-Encoding: MIME-Version: References: In-Reply-To: Message-ID: Date: Subject: Cc: To: From; q=dns/txt; s=fe-e1b5cab7be; t=1718471109; bh=tr1oTKBW1hAs0ekTXTS14VMXssfmixvxHWASJNa7PTY=; b=f5N9xyOmyuhOFqSyEfVYr4k56ZXwDSRcyl9WJLspyEJtEJD6g80cFk6C3oNHLy6i2E7PLrIwX RvXlvhEkHeGYWN1iNkh8VQzHqbirIaVbYEkKaoPrYTYMD0iEmS/OyWkSem+rjOjHcYl/0p/0BDK SO5o2FqKI8o5wRNzXaaI58sUVuWC4oSaOgqb6Ge3QLkgo/l1Py1tYAGr6jZ3yLNxmGakqYkFQTE LZM7aqy6CZTl9tLem3n/vwpn8ex52yQWDcoKhkZa2X9yKtHI76ezv5GcDSO+4LvmVgMczKFB5tS I2lnYCcWR87hFLcZ52/Ygpxll78lp6XE1cjWnEIa7kSg== From: Jonas Karlman To: dri-devel@lists.freedesktop.org, Sandy Huang , " =?utf-8?q?Heiko_St=C3=BCbner?= " , Andy Yan , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter Cc: linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, Jonas Karlman , Nickey Yang Subject: [PATCH 09/13] drm/rockchip: dw_hdmi: Add phy_config for 594Mhz pixel clock Date: Sat, 15 Jun 2024 17:04:00 +0000 Message-ID: <20240615170417.3134517-10-jonas@kwiboo.se> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240615170417.3134517-1-jonas@kwiboo.se> References: <20240615170417.3134517-1-jonas@kwiboo.se> MIME-Version: 1.0 X-Report-Abuse-To: abuse@forwardemail.net X-Report-Abuse: abuse@forwardemail.net X-Complaints-To: abuse@forwardemail.net X-ForwardEmail-Version: 0.4.40 X-ForwardEmail-Sender: rfc822; jonas@kwiboo.se, smtp.forwardemail.net, 149.28.215.223 X-ForwardEmail-ID: 666dc9c124e0254b39804075 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240615_100523_828030_67733342 X-CRM114-Status: UNSURE ( 8.33 ) 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 From: Nickey Yang Add phy_config for 594Mhz pixel clock used for HDMI2.0 display modes. Signed-off-by: Nickey Yang Signed-off-by: Jonas Karlman --- drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c b/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c index 205cfe02079f..9d5bd7455180 100644 --- a/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c +++ b/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c @@ -206,6 +206,7 @@ static const struct dw_hdmi_phy_config rockchip_phy_config[] = { { 74250000, 0x8009, 0x0004, 0x0272}, { 165000000, 0x802b, 0x0004, 0x0209}, { 297000000, 0x8039, 0x0005, 0x028d}, + { 594000000, 0x8039, 0x0000, 0x019d}, { ~0UL, 0x0000, 0x0000, 0x0000} }; From patchwork Sat Jun 15 17:04:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonas Karlman X-Patchwork-Id: 13699317 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 3E77EC27C4F for ; Sat, 15 Jun 2024 17:06:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=t8rcPDPG/alK7F2ckRMvaDdLQI5mciZmFUWfAp+FcPg=; b=NjkoVjQHR5Zv2bk9lCnNNT52MH /YslgUYcgdb4RIHk6uvIHyuESTDoh1R8UxG+0CbHgeWzqUPkDXqr0aOaXis5OlUEAkM2KWU5c4hKl IJT0Jy1lihPX/OZ7CqypHf1pEk3hUur3rDU1uNfpNHHKJHl+GvNTHPAGpkYJu2TpHr7EfytiPd3Aa l5lAc8Kv3XEYYsKz+tJg3JiexRvH1b83XW5gzMDC1G/+UaQhiSwllG+HsyLQ7oEQ3Z/bWrisgYJ2x 6lp9xFT3PDc8lQWQCHb761HZcn9oz73FgMz4YSI/scYblbSgJ+4vFEyau4b1O9CgXEYPCVY97xjzU bGyoz+NQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sIWrG-00000005n69-3Gab; Sat, 15 Jun 2024 17:06:30 +0000 Received: from smtp.forwardemail.net ([167.172.40.54]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sIWqe-00000005mZs-2sZG for linux-arm-kernel@lists.infradead.org; Sat, 15 Jun 2024 17:05:56 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kwiboo.se; h=Content-Transfer-Encoding: MIME-Version: References: In-Reply-To: Message-ID: Date: Subject: Cc: To: From; q=dns/txt; s=fe-e1b5cab7be; t=1718471114; bh=t8rcPDPG/alK7F2ckRMvaDdLQI5mciZmFUWfAp+FcPg=; b=fpxvUNDuuEp84NC90qwfRnnAR6A/t/A6V0Lgx9cgzCpw0UU/gsO5wYM6lxujHQzM17PZ5Xy5g MuY2HKuM4DnTfISREX76uzSbB2uK4a7B7bxO8VyQndMuIumxLk2z4v23P2BfGHQKthZ29V7w8Dx plR0k8WGuMMTlWnm6uphUjTS+PExXMpkDPcVjTM/PSfHB+FO6hYdLyAS8AkOb57aH7KHn7Xcc12 02Xm+URxJznZS3mHvBGD8SDbYGMZTQdPaoBPNq2bdYDCoa5ORvr4LQfcIiUVgbvZaFuSFyt/E6y ZuMPxU3z7GpXNpqYlk3o/SuxN6gA6GO1p7pOspvgGoTQ== From: Jonas Karlman To: dri-devel@lists.freedesktop.org, Sandy Huang , " =?utf-8?q?Heiko_St=C3=BCbner?= " , Andy Yan , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter Cc: linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, Jonas Karlman , Douglas Anderson , Yakir Yang Subject: [PATCH 10/13] drm/rockchip: dw_hdmi: Set cur_ctr to 0 always Date: Sat, 15 Jun 2024 17:04:01 +0000 Message-ID: <20240615170417.3134517-11-jonas@kwiboo.se> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240615170417.3134517-1-jonas@kwiboo.se> References: <20240615170417.3134517-1-jonas@kwiboo.se> MIME-Version: 1.0 X-Report-Abuse-To: abuse@forwardemail.net X-Report-Abuse: abuse@forwardemail.net X-Complaints-To: abuse@forwardemail.net X-ForwardEmail-Version: 0.4.40 X-ForwardEmail-Sender: rfc822; jonas@kwiboo.se, smtp.forwardemail.net, 167.172.40.54 X-ForwardEmail-ID: 666dc9c524e0254b39804087 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240615_100554_401668_EA502F8E X-CRM114-Status: UNSURE ( 9.28 ) 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 From: Douglas Anderson Jitter was improved by lowering the MPLL bandwidth to account for high frequency noise in the rk3288 PLL. In each case MPLL bandwidth was lowered only enough to get us a comfortable margin. We believe that lowering the bandwidth like this is safe given sufficient testing. Signed-off-by: Douglas Anderson Signed-off-by: Yakir Yang Signed-off-by: Jonas Karlman --- drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c b/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c index 9d5bd7455180..e532c6d294dc 100644 --- a/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c +++ b/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c @@ -181,23 +181,9 @@ static const struct dw_hdmi_mpll_config rockchip_mpll_cfg[] = { static const struct dw_hdmi_curr_ctrl rockchip_cur_ctr[] = { /* pixelclk bpp8 bpp10 bpp12 */ { - 40000000, { 0x0018, 0x0018, 0x0018 }, - }, { - 65000000, { 0x0028, 0x0028, 0x0028 }, - }, { - 66000000, { 0x0038, 0x0038, 0x0038 }, - }, { - 74250000, { 0x0028, 0x0038, 0x0038 }, - }, { - 83500000, { 0x0028, 0x0038, 0x0038 }, - }, { - 146250000, { 0x0038, 0x0038, 0x0038 }, - }, { - 148500000, { 0x0000, 0x0038, 0x0038 }, - }, { 600000000, { 0x0000, 0x0000, 0x0000 }, }, { - ~0UL, { 0x0000, 0x0000, 0x0000}, + ~0UL, { 0x0000, 0x0000, 0x0000 }, } }; From patchwork Sat Jun 15 17:04:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonas Karlman X-Patchwork-Id: 13699321 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 ACCF0C2BA12 for ; Sat, 15 Jun 2024 17:07:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=Z5bcZuna/6T6AIQbROeIpQ8rnzmEdCJTM7frZTMAnTU=; b=V/y1Fs6sF1M7oYYJQ7iTKN62gE zxhbVflrfDvRB99IsTNwTtSZ1ktBkKK5iYsfT9tOipNTmaVrgN4TyUw+2d1YSZK0OCya+zFBrf8lb hilnvEAUjt1X/0vyBFTMdyfmsyaTV+jbT6FaWBpDyRWRr6mQobZ95YXxue00fCz1+UCT+woxQ+mCT QzaU3MpYrs3tai+eJFfDnAkuat5naWgplKqbljch3HivHnvG3Aa0mo0i8KQhvZuQF9IkK4Cdns8RB b5tpFcW5su4RIF1ZrI4DSEHX8MxX2r2y600Tx9M3dE27aaZ9BU+uBlUEDTiA9pLPnZ9G1zUtCFeP0 /F1acwag==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sIWrp-00000005nUh-39ae; Sat, 15 Jun 2024 17:07:05 +0000 Received: from smtp.forwardemail.net ([167.172.40.54]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sIWqn-00000005mi0-3yvs for linux-arm-kernel@lists.infradead.org; Sat, 15 Jun 2024 17:06:06 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kwiboo.se; h=Content-Transfer-Encoding: MIME-Version: References: In-Reply-To: Message-ID: Date: Subject: Cc: To: From; q=dns/txt; s=fe-e1b5cab7be; t=1718471120; bh=Z5bcZuna/6T6AIQbROeIpQ8rnzmEdCJTM7frZTMAnTU=; b=xS0K+bSo9Vgh7Xeg3iAd/D84EhJtdOG1+/nOBTj8QqXl6V3jsPkUtCZIU3hO9EcR2eHQlPv6E wkj2U3I1nCw+tWCgAdqkBI558KFvEpotEKDst+GMvauhRzZXVYuUq88G2MFvFDTTMjzoLc9YGYV oPJ4WNcVBtIqKUp/DGwDxqGTjD9mjSMq8urJUDVGgtc3xcgfp/egnee9N91wCGZu+z1s1ANCtqf f8JTsM6UQt63RrbUz4f5ul57dN6e5kBCPm244MJ2baeyUfX1qnylCgduXXukH3y4EDOa19d5mWB WFTM1lpahoiW3zVaXLvixWE94O5bWBWgC0UPq06y5lWw== From: Jonas Karlman To: dri-devel@lists.freedesktop.org, Sandy Huang , " =?utf-8?q?Heiko_St=C3=BCbner?= " , Andy Yan , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter Cc: linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, Jonas Karlman , Douglas Anderson , Yakir Yang Subject: [PATCH 11/13] drm/rockchip: dw_hdmi: Use auto-generated tables Date: Sat, 15 Jun 2024 17:04:02 +0000 Message-ID: <20240615170417.3134517-12-jonas@kwiboo.se> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240615170417.3134517-1-jonas@kwiboo.se> References: <20240615170417.3134517-1-jonas@kwiboo.se> MIME-Version: 1.0 X-Report-Abuse-To: abuse@forwardemail.net X-Report-Abuse: abuse@forwardemail.net X-Complaints-To: abuse@forwardemail.net X-ForwardEmail-Version: 0.4.40 X-ForwardEmail-Sender: rfc822; jonas@kwiboo.se, smtp.forwardemail.net, 167.172.40.54 X-ForwardEmail-ID: 666dc9ca24e0254b39804099 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240615_100602_401062_A30DE630 X-CRM114-Status: GOOD ( 13.62 ) 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 From: Douglas Anderson The previous tables for mpll_cfg and curr_ctrl were created using the 20-pages of example settings provided by the PHY vendor. Those example settings weren't particularly dense, so there were places where we were guessing what the settings would be for 10-bit and 12-bit (not that we use those anyway). It was also always a lot of extra work every time we wanted to add a new clock rate since we had to cross-reference several tables. In I've gone through the work to figure out how to generate this table automatically. Let's now use the automatically generated table and then we'll never need to look at it again. We only support 8-bit mode right now and only support a small number of clock rates and I've verified that the only 8-bit rate that was affected was 148.5. That mode appears to have been wrong in the old table. Signed-off-by: Douglas Anderson Signed-off-by: Yakir Yang Signed-off-by: Jonas Karlman --- drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c | 104 ++++++++++---------- 1 file changed, 53 insertions(+), 51 deletions(-) diff --git a/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c b/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c index e532c6d294dc..d9886b1c299c 100644 --- a/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c +++ b/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c @@ -94,74 +94,70 @@ static struct rockchip_hdmi *to_rockchip_hdmi(struct drm_encoder *encoder) static const struct dw_hdmi_mpll_config rockchip_mpll_cfg[] = { { - 27000000, { - { 0x00b3, 0x0000}, - { 0x2153, 0x0000}, - { 0x40f3, 0x0000} + 30666000, { + { 0x00b3, 0x0000 }, + { 0x2153, 0x0000 }, + { 0x40f3, 0x0000 }, }, }, { - 36000000, { - { 0x00b3, 0x0000}, - { 0x2153, 0x0000}, - { 0x40f3, 0x0000} + 36800000, { + { 0x00b3, 0x0000 }, + { 0x2153, 0x0000 }, + { 0x40a2, 0x0001 }, }, }, { - 40000000, { - { 0x00b3, 0x0000}, - { 0x2153, 0x0000}, - { 0x40f3, 0x0000} + 46000000, { + { 0x00b3, 0x0000 }, + { 0x2142, 0x0001 }, + { 0x40a2, 0x0001 }, }, }, { - 54000000, { - { 0x0072, 0x0001}, - { 0x2142, 0x0001}, - { 0x40a2, 0x0001}, + 61333000, { + { 0x0072, 0x0001 }, + { 0x2142, 0x0001 }, + { 0x40a2, 0x0001 }, }, }, { - 65000000, { - { 0x0072, 0x0001}, - { 0x2142, 0x0001}, - { 0x40a2, 0x0001}, + 73600000, { + { 0x0072, 0x0001 }, + { 0x2142, 0x0001 }, + { 0x4061, 0x0002 }, }, }, { - 66000000, { - { 0x013e, 0x0003}, - { 0x217e, 0x0002}, - { 0x4061, 0x0002} + 92000000, { + { 0x0072, 0x0001 }, + { 0x2145, 0x0002 }, + { 0x4061, 0x0002 }, }, }, { - 74250000, { - { 0x0072, 0x0001}, - { 0x2145, 0x0002}, - { 0x4061, 0x0002} + 122666000, { + { 0x0051, 0x0002 }, + { 0x2145, 0x0002 }, + { 0x4061, 0x0002 }, }, }, { - 83500000, { - { 0x0072, 0x0001}, + 147200000, { + { 0x0051, 0x0002 }, + { 0x2145, 0x0002 }, + { 0x4064, 0x0003 }, }, }, { - 108000000, { - { 0x0051, 0x0002}, - { 0x2145, 0x0002}, - { 0x4061, 0x0002} + 184000000, { + { 0x0051, 0x0002 }, + { 0x214c, 0x0003 }, + { 0x4064, 0x0003 }, }, }, { - 106500000, { - { 0x0051, 0x0002}, - { 0x2145, 0x0002}, - { 0x4061, 0x0002} - }, - }, { - 146250000, { - { 0x0051, 0x0002}, - { 0x2145, 0x0002}, - { 0x4061, 0x0002} + 226666000, { + { 0x0040, 0x0003 }, + { 0x214c, 0x0003 }, + { 0x4064, 0x0003 }, }, }, { - 148500000, { - { 0x0051, 0x0003}, - { 0x214c, 0x0003}, - { 0x4064, 0x0003} + 272000000, { + { 0x0040, 0x0003 }, + { 0x214c, 0x0003 }, + { 0x5a64, 0x0003 }, }, }, { 340000000, { @@ -169,11 +165,17 @@ static const struct dw_hdmi_mpll_config rockchip_mpll_cfg[] = { { 0x3b4c, 0x0003 }, { 0x5a64, 0x0003 }, }, + }, { + 600000000, { + { 0x1a40, 0x0003 }, + { 0x3b4c, 0x0003 }, + { 0x5a64, 0x0003 }, + }, }, { ~0UL, { - { 0x00a0, 0x000a }, - { 0x2001, 0x000f }, - { 0x4002, 0x000f }, + { 0x0000, 0x0000 }, + { 0x0000, 0x0000 }, + { 0x0000, 0x0000 }, }, } }; From patchwork Sat Jun 15 17:04:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonas Karlman X-Patchwork-Id: 13699320 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 1D651C27C4F for ; Sat, 15 Jun 2024 17:07:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=oBgtjth5/yflr6ntPsYuZ+MVQpYpZchrByL3dEYZAxA=; b=bh749y/CEFWs4TehuK7thvY2Nz KJaaKjM/FEC24C5+M5g3WrsjKh6BKBmuU8vAmodfPi1Oy85F3P/rDB6wkJqPnHKPp27UzpzN2L2wE 2SFRxP/5MFj6iSgHFZjwJ378cBURRA60xGCW+rjMu4EqAWrKuicEdQTWIGDwD3dbuAKaqn1gDKjpY rqAzv74JvfEyB+QsgWoAw5h2cIg/iPbML7Zpbynxc8V/pMXvC7YkRyR+JRH4lneTHVfJ66ilp+Kq5 +aCXx4QXYLdFtWlEgGAWSfh06j+tZvdUEWUhTtkqhV6B6/My5WrO9aiy8YXwtrM4o7FL8LeoJd1/q Tss8m3+Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sIWro-00000005nSl-0yva; Sat, 15 Jun 2024 17:07:04 +0000 Received: from smtp.forwardemail.net ([167.172.40.54]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sIWqk-00000005mhE-22UX for linux-arm-kernel@lists.infradead.org; Sat, 15 Jun 2024 17:06:00 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kwiboo.se; h=Content-Transfer-Encoding: MIME-Version: References: In-Reply-To: Message-ID: Date: Subject: Cc: To: From; q=dns/txt; s=fe-e1b5cab7be; t=1718471125; bh=oBgtjth5/yflr6ntPsYuZ+MVQpYpZchrByL3dEYZAxA=; b=KSzzbqLZDYXyMEIMCHItVvD8iJWM/iEpDjZdWDhMvr4saTi0blstbTcM8liBum4xVw5aQyxWB hiAfooaqmiOBMjewaaKfz5ehZGBkFeZTMXYsv4jIIs5ymW55CT8XS/no7CfgxdRzUTg3KJ49RaE dbVYnBQq6ZQBDR83iTgHRu9slIEWu1RpvbXzyEh26Ep4ArEUfibDZzJLbDY0m8mJOmiZcqMG+XB bH/NuXxAfGlHyNCRbUJM2b7n+kW8LayieeUoKjb0RCNBwgRyVUbuMYl6Y1mplLIfjda9JmpBcpN /xehR3UYnY1z4Ig0MneUK3y7CNAHmAAwcjpvCh8lj85w== From: Jonas Karlman To: dri-devel@lists.freedesktop.org, Sandy Huang , " =?utf-8?q?Heiko_St=C3=BCbner?= " , Andy Yan , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter Cc: linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, Jonas Karlman Subject: [PATCH 12/13] drm/rockchip: dw_hdmi: Enable 4K@60Hz mode on RK3399 and RK356x Date: Sat, 15 Jun 2024 17:04:03 +0000 Message-ID: <20240615170417.3134517-13-jonas@kwiboo.se> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240615170417.3134517-1-jonas@kwiboo.se> References: <20240615170417.3134517-1-jonas@kwiboo.se> MIME-Version: 1.0 X-Report-Abuse-To: abuse@forwardemail.net X-Report-Abuse: abuse@forwardemail.net X-Complaints-To: abuse@forwardemail.net X-ForwardEmail-Version: 0.4.40 X-ForwardEmail-Sender: rfc822; jonas@kwiboo.se, smtp.forwardemail.net, 167.172.40.54 X-ForwardEmail-ID: 666dc9cf24e0254b398040ab X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240615_100558_915333_BBFC1846 X-CRM114-Status: GOOD ( 10.86 ) 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 Use a maximum TMDS clock rate limit of 594MHz to enable use of HDMI2.0 modes, e.g. 4K@60Hz, on RK3399 and RK3568. Signed-off-by: Jonas Karlman --- drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c b/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c index d9886b1c299c..b255b8ceedb7 100644 --- a/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c +++ b/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c @@ -493,7 +493,7 @@ static struct rockchip_hdmi_chip_data rk3399_chip_data = { .lcdsel_grf_reg = RK3399_GRF_SOC_CON20, .lcdsel_big = HIWORD_UPDATE(0, RK3399_HDMI_LCDC_SEL), .lcdsel_lit = HIWORD_UPDATE(RK3399_HDMI_LCDC_SEL, RK3399_HDMI_LCDC_SEL), - .max_tmds_clock = 340000, + .max_tmds_clock = 594000, }; static const struct dw_hdmi_plat_data rk3399_hdmi_drv_data = { @@ -507,7 +507,7 @@ static const struct dw_hdmi_plat_data rk3399_hdmi_drv_data = { static struct rockchip_hdmi_chip_data rk3568_chip_data = { .lcdsel_grf_reg = -1, - .max_tmds_clock = 340000, + .max_tmds_clock = 594000, }; static const struct dw_hdmi_plat_data rk3568_hdmi_drv_data = { From patchwork Sat Jun 15 17:04:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonas Karlman X-Patchwork-Id: 13699318 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 45A3FC27C4F for ; Sat, 15 Jun 2024 17:07:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=FiHAdD/4nULeLzfayWHOZuJzCk9s4sL6Pdbfulf5fI0=; b=CMQwy8t4ixZJXXbai0ILPaMQo4 /RzfIgRAGe7CjpX0ZULTMt5QmUIv5ElcIk4xSggjac2FWfTxNFGvBEqRqZRpT305stmDWIO4ohLex aew2xRAYZZ06gUb14EFpy3yLCyPKbpApT+ZadNb+8JQyQVRzmpoJPOTdNStoj0sBoHFNa6m8FJ3+N mwGjF+GmSYCghgVJ6KYcI9lTc0WW6n0CUxvbtRF0xsZW4urjA2RxnHK9u3mUq9ut/rl4b9Fx12Yzz JEMfpxjdEbtzraLABwRTpe+i4jQcWDurNnxHPoLRwTYfbeD/eK35ucJ0AQIcuxygFca2fwwXT81/F c7vWwqFA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sIWrc-00000005nLh-3KQp; Sat, 15 Jun 2024 17:06:53 +0000 Received: from smtp.forwardemail.net ([167.172.40.54]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sIWqv-00000005mow-46Z4 for linux-arm-kernel@lists.infradead.org; Sat, 15 Jun 2024 17:06:12 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kwiboo.se; h=Content-Transfer-Encoding: MIME-Version: References: In-Reply-To: Message-ID: Date: Subject: Cc: To: From; q=dns/txt; s=fe-e1b5cab7be; t=1718471132; bh=FiHAdD/4nULeLzfayWHOZuJzCk9s4sL6Pdbfulf5fI0=; b=NjhRFKrEMl9zC2rzupvfY6t99XoPXqQ1GD6FVUWVCd+5VSANEHJ8WBJYFeBMbeanIuJtm7jx+ ayai/hvSnJRVDBgWyOhKArTaZTmaKSxBXqHM+XjkyOT46xFLFVdcH7URFo0VIb4M9YDBh3DNwO9 AsWS9YDYj3nglZ/7VHrizinPa1XO+QevQAd6W3Pde5ykY5G3b81SwDSz1DhJPwgb8yeXU4a16pt PxPltbVjJqc+6a1jRsQXLtIrwIokxoFMqYISn41JU03bfc+9QVTfMk6iqbRuTiz7xseSliAEZgB nTIiayMpsvPztzb4ccd/TYRRmoVgt+XyYA+87mXnD8nQ== From: Jonas Karlman To: dri-devel@lists.freedesktop.org, Sandy Huang , " =?utf-8?q?Heiko_St=C3=BCbner?= " , Andy Yan , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter Cc: linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, Jonas Karlman Subject: [PATCH 13/13] drm/rockchip: Load crtc devices in preferred order Date: Sat, 15 Jun 2024 17:04:04 +0000 Message-ID: <20240615170417.3134517-14-jonas@kwiboo.se> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240615170417.3134517-1-jonas@kwiboo.se> References: <20240615170417.3134517-1-jonas@kwiboo.se> MIME-Version: 1.0 X-Report-Abuse-To: abuse@forwardemail.net X-Report-Abuse: abuse@forwardemail.net X-Complaints-To: abuse@forwardemail.net X-ForwardEmail-Version: 0.4.40 X-ForwardEmail-Sender: rfc822; jonas@kwiboo.se, smtp.forwardemail.net, 167.172.40.54 X-ForwardEmail-ID: 666dc9d424e0254b398040bd X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240615_100610_767145_C00623EC X-CRM114-Status: GOOD ( 13.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 On RK3399 the VOPL loaded before VOPB and gets registered as crtc-0. However, on RK3288 and PX30 VOPB is gets registered as crtc-0 instead of VOPL. With VOPL registered as crtc-0 the kernel kms client is not able to enable 4K display modes for console use on RK3399. Load VOPB before VOPL to help kernel kms client make use of 4K display modes for console use on RK3399. Signed-off-by: Jonas Karlman --- drivers/gpu/drm/rockchip/rockchip_drm_drv.c | 23 +++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_drv.c b/drivers/gpu/drm/rockchip/rockchip_drm_drv.c index ab55d7132550..6492f3caf017 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_drv.c +++ b/drivers/gpu/drm/rockchip/rockchip_drm_drv.c @@ -354,11 +354,34 @@ static void rockchip_drm_match_remove(struct device *dev) device_link_del(link); } +/* list of preferred vop devices */ +static const char *const rockchip_drm_match_preferred[] = { + "rockchip,rk3399-vop-big", + NULL, +}; + static struct component_match *rockchip_drm_match_add(struct device *dev) { struct component_match *match = NULL; + struct device_node *port; int i; + /* add preferred vop device match before adding driver device matches */ + for (i = 0; ; i++) { + port = of_parse_phandle(dev->of_node, "ports", i); + if (!port) + break; + + if (of_device_is_available(port->parent) && + of_device_compatible_match(port->parent, + rockchip_drm_match_preferred)) + drm_of_component_match_add(dev, &match, + component_compare_of, + port->parent); + + of_node_put(port); + } + for (i = 0; i < num_rockchip_sub_drivers; i++) { struct platform_driver *drv = rockchip_sub_drivers[i]; struct device *p = NULL, *d;