From nobody Sat Nov 30 16:25:53 2024 Received: from smtp.forwardemail.net (smtp.forwardemail.net [207.246.76.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DCB0217279C for ; Sun, 8 Sep 2024 14:55:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=207.246.76.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725807344; cv=none; b=SJAkU/tj43Mg3S6wQO0X+rr8AgMEl8L0J/aDpSSk4toR9cI/fdhwJEw6sBM9m+OI1UsozsNwGcJk4x3yFJwwKaJyY3tI4vypW+CwAfiYhAnlmSxCBFxNPN71dqEj01Fs/4M0JWtQDdYfEB0l+dKPzTyJ1QSeNYfoTd368UtSBRI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725807344; c=relaxed/simple; bh=trEG3kdvJwkXD+tVfXvh2GrCYgOUnKsz+e7BeCR8dzY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=WW5moyRTBaOCt4EcQ/eDE8hiDsv2NJXwH9PIc6IEzz+kgP5rMmzDCej3iCcv6eRLcYDtOAXNlYtOEay4qrCgKPhRrN3hVq2nuXtt2vcQYik2d5K7mXqwVT/iJdUGIFffpw54JOu8t/UyJX/J7nelCOTLS+kffV0BstrAp7u9J/w= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=kwiboo.se; spf=pass smtp.mailfrom=fe-bounces.kwiboo.se; dkim=pass (2048-bit key) header.d=kwiboo.se header.i=@kwiboo.se header.b=Xcwgz2+y; arc=none smtp.client-ip=207.246.76.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=kwiboo.se Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=fe-bounces.kwiboo.se Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kwiboo.se header.i=@kwiboo.se header.b="Xcwgz2+y" 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=1725807327; bh=V2dGVPkW7unWHK16HPMh1/1tKtsd3J5CV8rFRUeW/os=; b=Xcwgz2+y07DjXft8NL+zfJrIjmZ8fw28DzkAvO75Yq1c3YWf+mmsCKWB6RW3IrXy9wJC8N7UW fUcvLtn1GWtp73WlMCHVUxqIwj3NPOOrXAjK/Bru3lzI+fCCE2VkQrk7CDfXPJTC39PhZ/xOWU1 h03E6Xnq9KHY2XpDPs3oWAnYfww4LjV1ofRPXKjWHGxuanY2fUb5EMeB4pVvkNNiAs8pGgMCZB6 pZ3J3xhvQCPljW4JqLlkQAoPPCuA/SO04okkwx00X5kxtx2nUk3a8scv4GRsMcUsV0GqbP5g9jt u6w/T+WzEO70CmXKY7vqIAeVp8i3eLxkFAHZJVJJ+QlA== From: Jonas Karlman To: Heiko Stuebner , Sandy Huang , Andy Yan , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter Cc: Diederik de Haas , dri-devel@lists.freedesktop.org, linux-rockchip@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Jonas Karlman Subject: [PATCH v2 1/7] drm/rockchip: dw_hdmi: Filter modes based on hdmiphy_clk Date: Sun, 8 Sep 2024 14:54:58 +0000 Message-ID: <20240908145511.3331451-2-jonas@kwiboo.se> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240908145511.3331451-1-jonas@kwiboo.se> References: <20240908145511.3331451-1-jonas@kwiboo.se> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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, 207.246.76.47 X-ForwardEmail-ID: 66ddbadb3c9877b459588e82 Content-Type: text/plain; charset="utf-8" RK3228 and RK3328 clock rate is being validated against a mpll config table intended for a Synopsys phy, and not the used inno-hdmi-phy. 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 Tested-by: Diederik de Haas # Rock64 --- v2: Collect t-b tag --- 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 240552eb517f..36cc700766fd 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; @@ -251,10 +252,7 @@ dw_hdmi_rockchip_mode_valid(struct dw_hdmi *dw_hdmi, v= oid *data, const struct drm_display_mode *mode) { struct rockchip_hdmi *hdmi =3D data; - const struct dw_hdmi_mpll_config *mpll_cfg =3D rockchip_mpll_cfg; int pclk =3D mode->clock * 1000; - bool exact_match =3D hdmi->plat_data->phy_force_vendor; - int i; =20 if (hdmi->chip_data->max_tmds_clock && mode->clock > hdmi->chip_data->max_tmds_clock) @@ -263,26 +261,18 @@ dw_hdmi_rockchip_mode_valid(struct dw_hdmi *dw_hdmi, = void *data, if (hdmi->ref_clk) { int rpclk =3D clk_round_rate(hdmi->ref_clk, pclk); =20 - if (abs(rpclk - pclk) > pclk / 1000) + if (rpclk < 0 || abs(rpclk - pclk) > pclk / 1000) return MODE_NOCLOCK; } =20 - for (i =3D 0; mpll_cfg[i].mpixelclock !=3D (~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 =3D=3D 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 <=3D mpll_cfg[i].mpixelclock) - return MODE_OK; + if (hdmi->hdmiphy_clk) { + int rpclk =3D clk_round_rate(hdmi->hdmiphy_clk, pclk); + + if (rpclk < 0 || abs(rpclk - pclk) > pclk / 1000) + return MODE_NOCLOCK; } =20 - return MODE_BAD; + return MODE_OK; } =20 static void dw_hdmi_rockchip_encoder_disable(struct drm_encoder *encoder) @@ -607,6 +597,15 @@ static int dw_hdmi_rockchip_bind(struct device *dev, s= truct device *master, return ret; } =20 + if (hdmi->phy) { + struct of_phandle_args clkspec; + + clkspec.np =3D hdmi->phy->dev.of_node; + hdmi->hdmiphy_clk =3D of_clk_get_from_provider(&clkspec); + if (IS_ERR(hdmi->hdmiphy_clk)) + hdmi->hdmiphy_clk =3D NULL; + } + if (hdmi->chip_data =3D=3D &rk3568_chip_data) { regmap_write(hdmi->regmap, RK3568_GRF_VO_CON1, HIWORD_UPDATE(RK3568_HDMI_SDAIN_MSK | --=20 2.46.0 From nobody Sat Nov 30 16:25:53 2024 Received: from smtp.forwardemail.net (smtp.forwardemail.net [149.28.215.223]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 95174171652 for ; Sun, 8 Sep 2024 14:55:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=149.28.215.223 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725807355; cv=none; b=rgy42X4E2451WHs2YqCkgauIC5El6Xbby6kl0zXAsl/SbVMwpoYDDDc6qpTcFW5N7Rt0TUc2lfqitQjyljK77DChuiowkQlXrMhcyZB+IhxFSYFh7Iw0Q1Oify9yzf7PsBZsAg/ESh2GBNdS5btLIsLHhHwLA0+zOxlIgzCk1P4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725807355; c=relaxed/simple; bh=gH17k/hgoxWWnDI+TiP+CAFBgkQO9cbEtxG+mFs9ywY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=aCPlSUlTIh8aoH+QXPwsb2w6BFUNvORfjkbC8AoHQNVf2Bv/j7HflN89UhVpqRtbcfcAyRA6X/wv8QuIgoY/6tM6UhEpU0ubxaBsnKl8dLOTeoHN7ypZoNdIVikF17f+nhOIeC/jwJgK5HkVBLGCRzsT/IGRyb5lV9L5vxYYBY4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=kwiboo.se; spf=pass smtp.mailfrom=fe-bounces.kwiboo.se; dkim=pass (2048-bit key) header.d=kwiboo.se header.i=@kwiboo.se header.b=dDz0Rd+y; arc=none smtp.client-ip=149.28.215.223 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=kwiboo.se Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=fe-bounces.kwiboo.se Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kwiboo.se header.i=@kwiboo.se header.b="dDz0Rd+y" 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=1725807332; bh=s4d/+ThRHSQtfU43RCtR36kOGQZWrroV7EpFOhfrkPA=; b=dDz0Rd+ysMJo7E7Mp/8ntt1o7OUMS97maozuVK800alL0C7nalo7oYo02BiBtmFvibztL0h6V 0esFL6jjvePN3SxQgMjohPvX5NV3d38QJK9IDb1i5UFay1F7LoC6+x+V1BETArYs4QwFf6nyIWD jI7G/S2TDMp46puwgyQdgt5YoEOQDJrvVGLifkIOXsbFcZGwwCGSVfzd6FaB18cA/uvmNM/uf44 A2xHypv3Vitpof6yldLNUz4pzBxitCaky3kOcq1x1LTHKyKf0UTnaAZcC483yTgP26gUqcAFV0Q nGJsENbQ/8W/7x4XwcR24/2fHGDKD8sfEHsUqXIkyv9Q== From: Jonas Karlman To: Heiko Stuebner , Sandy Huang , Andy Yan , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter Cc: Diederik de Haas , dri-devel@lists.freedesktop.org, linux-rockchip@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Jonas Karlman , Yakir Yang Subject: [PATCH v2 2/7] drm/rockchip: dw_hdmi: Adjust cklvl & txlvl for RF/EMI Date: Sun, 8 Sep 2024 14:54:59 +0000 Message-ID: <20240908145511.3331451-3-jonas@kwiboo.se> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240908145511.3331451-1-jonas@kwiboo.se> References: <20240908145511.3331451-1-jonas@kwiboo.se> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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: 66ddbadf3c9877b459588e98 Content-Type: text/plain; charset="utf-8" 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 =3D 20 & txlvl =3D 13 (RF/EMI failed) ck: lvl =3D 13, term=3D100, vlo =3D 2.71, vhi=3D3.14, vswing =3D 0.43 tx: lvl =3D 20, term=3D100, vlo =3D 2.81, vhi=3D3.16, vswing =3D 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 =3D 6, term=3D100, vlo =3D 2.61, vhi=3D3.11, vswing =3D 0.50 tx: lvl =3D 6, term=3D100, vlo =3D 2.61, vhi=3D3.11, vswing =3D 0.50 2. We try to keep voltage value and vswing both lower, then RF/EMI test all passed ;) ck: lvl =3D 11, term=3D 66, vlo =3D 2.68, vhi=3D3.09, vswing =3D 0.40 tx: lvl =3D 11, term=3D 66, vlo =3D 2.68, vhi=3D3.09, vswing =3D 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 =3D 9, term=3D100, vlo =3D 2.65, vhi=3D3.12, vswing =3D 0.47 tx: lvl =3D 16, term=3D100, vlo =3D 2.75, vhi=3D3.15, vswing =3D 0.39 Signed-off-by: Yakir Yang Signed-off-by: Jonas Karlman --- v2: No change --- 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 36cc700766fd..fc5e87285a91 100644 --- a/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c +++ b/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c @@ -202,7 +202,7 @@ static const struct dw_hdmi_curr_ctrl rockchip_cur_ctr[= ] =3D { static const struct dw_hdmi_phy_config rockchip_phy_config[] =3D { /*pixelclk symbol term vlev*/ { 74250000, 0x8009, 0x0004, 0x0272}, - { 148500000, 0x802b, 0x0004, 0x028d}, + { 165000000, 0x802b, 0x0004, 0x0209}, { 297000000, 0x8039, 0x0005, 0x028d}, { ~0UL, 0x0000, 0x0000, 0x0000} }; --=20 2.46.0 From nobody Sat Nov 30 16:25:53 2024 Received: from smtp.forwardemail.net (smtp.forwardemail.net [149.28.215.223]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 951C3171E4F for ; Sun, 8 Sep 2024 14:55:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=149.28.215.223 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725807353; cv=none; b=MR3SZX+nLrA+mzTPZRN05P5T83bFRzaT9i3NIc7Iprkigr9V2sdBkeCtUba3a3UBOrifMFHJ7BcHKjKxX+BV6di2AVLuvgSxfhKxa4HV8JA1KgemnP3drkGyu/PuXf0n7VTQ5PV5Pq2OQwEZKopAj0v3BGPhj2ejiKi7fJ9p1sw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725807353; c=relaxed/simple; bh=eHTkdr7y77ghbU7+/Khvq9iSPwLUxOqI2Sp0bsjqUWo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ukYIOgkOVaC2W8qaZKFreVs86XHwh5y6rtl9Ybudxh16w4EmXMnHunYwqLh/ssHDNP353Br+Mh2wDrXZhy/IBFVLf9ZoTAo6F4/ER1kjFggw1xhv62pD9XU6OdC/GA9NGkXcNmTZRjo0sRJkkorchVSVZxxXi3g7IfaQhiHUpa0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=kwiboo.se; spf=pass smtp.mailfrom=fe-bounces.kwiboo.se; dkim=pass (2048-bit key) header.d=kwiboo.se header.i=@kwiboo.se header.b=cKDElm8h; arc=none smtp.client-ip=149.28.215.223 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=kwiboo.se Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=fe-bounces.kwiboo.se Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kwiboo.se header.i=@kwiboo.se header.b="cKDElm8h" 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=1725807332; bh=ctgViwAoHsdszvG54A8azRGdEh0njwBKxxYrSAjOB98=; b=cKDElm8hkD5z4aDRmrjf1JCNcgRL4B5pCSs5R0UJigy1xpP45jYyDXBkE1nFaYhrYUs/2FKWA L+HlkMoh6YbZhuoHrmwJVurpAmo3teK3NvylohUiM6c8xYZ2kYc8xwOI19K/YOQUQ/QilKDn4b6 BZtF+DqgGwoTkm/GFo0vPOJ0ZNMb7YHWjRUf36CBF9/FEywtBbvL/q/SGTw7PORtSjIU1axCQml GEWtk4VViZ/vrXBYPmeuP79/7Iecsv6LM3wEXjt6gn/qVHwTre7M3+6360b2rwa75eDyJRgA9pG GJxJdXUxKZtD+3en6+sVA/flh8HTI6qSPAqG9x3wsg7g== From: Jonas Karlman To: Heiko Stuebner , Sandy Huang , Andy Yan , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter Cc: Diederik de Haas , dri-devel@lists.freedesktop.org, linux-rockchip@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Jonas Karlman , Nickey Yang Subject: [PATCH v2 3/7] drm/rockchip: dw_hdmi: Add phy_config for 594Mhz pixel clock Date: Sun, 8 Sep 2024 14:55:00 +0000 Message-ID: <20240908145511.3331451-4-jonas@kwiboo.se> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240908145511.3331451-1-jonas@kwiboo.se> References: <20240908145511.3331451-1-jonas@kwiboo.se> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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: 66ddbae33c9877b459588eac Content-Type: text/plain; charset="utf-8" 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 --- v2: No change --- 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 fc5e87285a91..dffbae005a96 100644 --- a/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c +++ b/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c @@ -204,6 +204,7 @@ static const struct dw_hdmi_phy_config rockchip_phy_con= fig[] =3D { { 74250000, 0x8009, 0x0004, 0x0272}, { 165000000, 0x802b, 0x0004, 0x0209}, { 297000000, 0x8039, 0x0005, 0x028d}, + { 594000000, 0x8039, 0x0000, 0x019d}, { ~0UL, 0x0000, 0x0000, 0x0000} }; =20 --=20 2.46.0 From nobody Sat Nov 30 16:25:53 2024 Received: from smtp.forwardemail.net (smtp.forwardemail.net [149.28.215.223]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1C25E172BD5 for ; Sun, 8 Sep 2024 14:55:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=149.28.215.223 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725807360; cv=none; b=iNJrY3h/RqgbMIz7ngdLe8BA9K8AOSkQ9t8dzt2xUokoG4KpryMyQBxKi2TULwU7gmSYa3QUpQbS2QTrpiGJxsrO1XBT8txzMXa/EVO6yhIaKI+t/kFgkZUF2KDGbtCpH55rpMGhnlpACIa2z792iGZ/x+MQ8cznCdhJ8AM4RiU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725807360; c=relaxed/simple; bh=i+l41S3DZ0geQKv4DNbjFlROfjZrIxPPUIAUJ41DYew=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ToT2pIjHzpHP/R4twrXv35dzJkFM1fUuXNz6lU9Jhn4dy2oab8GmC+spLqna0sNCl4SFbcY3fBvoCsQK9fL7g8VU5Jvsr7XknaGTUba/GiAytMsmQt8m2iIjepaYLJhdOWCeub07fmCa6WteD3RwKU6BMhGzOmABwLLln3Y4lhQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=kwiboo.se; spf=pass smtp.mailfrom=fe-bounces.kwiboo.se; dkim=pass (2048-bit key) header.d=kwiboo.se header.i=@kwiboo.se header.b=0E6pG1Zy; arc=none smtp.client-ip=149.28.215.223 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=kwiboo.se Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=fe-bounces.kwiboo.se Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kwiboo.se header.i=@kwiboo.se header.b="0E6pG1Zy" 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=1725807337; bh=ayVVX1VNsu2ahinEz6B9K+t21YFAycF1+6CeV0lPdHk=; b=0E6pG1ZyTJEWWiA5yGSht//uI0NtsQbBQCvqzXVm5YjbainV6iPICFQ1iKCowP+Pq+CKw4j83 mm0F3pW1ZxgFo9njfnmG+FJep0Ni8GSk5vzkUsShTYQJlDJRH6WqwYFCmZYGesUJI9fmeocXr/G +OjmcyEjG7PcMA0MMbFlsdazR2GeJWUcyHiKRKiPKl1+ghojdAy3HoPowwWO/N8zbvFO1iHM9l/ VCzLFFqw3iaz+fiEcLJGZYrmSRQ+ocEpFIH8/Btfj0LiuFzL1ngUZucnaExyJTjKwg0pjjDkf/5 zDSF/T5Onxl4g5O+6Edn2i1mxxzlDjWxwmxkFI/JzshA== From: Jonas Karlman To: Heiko Stuebner , Sandy Huang , Andy Yan , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter Cc: Diederik de Haas , dri-devel@lists.freedesktop.org, linux-rockchip@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Jonas Karlman , Douglas Anderson , Yakir Yang Subject: [PATCH v2 4/7] drm/rockchip: dw_hdmi: Set cur_ctr to 0 always Date: Sun, 8 Sep 2024 14:55:01 +0000 Message-ID: <20240908145511.3331451-5-jonas@kwiboo.se> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240908145511.3331451-1-jonas@kwiboo.se> References: <20240908145511.3331451-1-jonas@kwiboo.se> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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: 66ddbae83c9877b459588ec0 Content-Type: text/plain; charset="utf-8" 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 --- v2: No change --- 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 dffbae005a96..a050a65af8f2 100644 --- a/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c +++ b/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c @@ -179,23 +179,9 @@ static const struct dw_hdmi_mpll_config rockchip_mpll_= cfg[] =3D { static const struct dw_hdmi_curr_ctrl rockchip_cur_ctr[] =3D { /* 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 }, } }; =20 --=20 2.46.0 From nobody Sat Nov 30 16:25:53 2024 Received: from smtp.forwardemail.net (smtp.forwardemail.net [149.28.215.223]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5E505175D27 for ; Sun, 8 Sep 2024 14:56:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=149.28.215.223 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725807363; cv=none; b=PYxE/rz6zhYR31gQ7vBhpvgKMfN+MBjpRTx01S49+x9z8WktMvdZDqjgLm2lS0K9x2gdhb5fmpm98kHdDameLSKUPqGf+F9QyMdxLZzuHyfDKMrkGlEOFuTWh2kGc3Bo/D4KP73w2b1VFten7pA1uHx8K3cO7tPuQYf3qQQwa3g= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725807363; c=relaxed/simple; bh=moiSpzl80f/Tu1sFNQK9KnI8iEgyHxQHuPwyF40Mqmg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=olPoyDc3piEzppAR4TED0VAHfh4ryZnDWzri3nqfJNj+sftss8ZPw3DKpV3lt0WaQvBK9LpduCJGCgTizEe5vHY3qCWXDUPIwzpF7gNqLUmHcV3PAKCGiw5z4//q73eRdcGS1TuvjiCrnqyeb8k0rTwWxL7+CgW5Uqil5TJadXU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=kwiboo.se; spf=pass smtp.mailfrom=fe-bounces.kwiboo.se; dkim=pass (2048-bit key) header.d=kwiboo.se header.i=@kwiboo.se header.b=A81/VitD; arc=none smtp.client-ip=149.28.215.223 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=kwiboo.se Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=fe-bounces.kwiboo.se Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kwiboo.se header.i=@kwiboo.se header.b="A81/VitD" 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=1725807342; bh=A4vnwoL7sstjHcuswUpS2YQ16w3NXCb74wI/o3dGYlM=; b=A81/VitDk6OBeV1JkUiwkQvaKl+bP+0pqYrpGtawKzezpJCM6Fqme6h4nPutEC2x96PDYylrR gks2UUfCb09b/JSzrjYISQb2wSAI56HYi8cUy3F5BEhFI/gV4Xef1Wy6pmz48z7qZDOKUrKSvRx OTH9pr8Xmw5xNhLrRdYWEo4uNi0u95LCEVU/Fb/qbkr4XDrLMseZ0AX/rX5KdZ+ikaD0ACuH28e x0MnWyAwManFhlJAKKJM7LVdgqCVes8QAWbo8H+LShdgaIPsqC+1gfJVAxYlTcfX88B1a5S8Fgk t7ss59+vbxz9ZPmznjjUb9vc+uuObdXzBMZrXQzptDdg== From: Jonas Karlman To: Heiko Stuebner , Sandy Huang , Andy Yan , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter Cc: Diederik de Haas , dri-devel@lists.freedesktop.org, linux-rockchip@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Jonas Karlman , Douglas Anderson , Yakir Yang Subject: [PATCH v2 5/7] drm/rockchip: dw_hdmi: Use auto-generated tables Date: Sun, 8 Sep 2024 14:55:02 +0000 Message-ID: <20240908145511.3331451-6-jonas@kwiboo.se> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240908145511.3331451-1-jonas@kwiboo.se> References: <20240908145511.3331451-1-jonas@kwiboo.se> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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: 66ddbaec3c9877b459588eeb Content-Type: text/plain; charset="utf-8" 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 --- v2: No change --- 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 a050a65af8f2..090d8c0f306f 100644 --- a/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c +++ b/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c @@ -92,74 +92,70 @@ static struct rockchip_hdmi *to_rockchip_hdmi(struct dr= m_encoder *encoder) =20 static const struct dw_hdmi_mpll_config rockchip_mpll_cfg[] =3D { { - 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, { @@ -167,11 +163,17 @@ static const struct dw_hdmi_mpll_config rockchip_mpll= _cfg[] =3D { { 0x3b4c, 0x0003 }, { 0x5a64, 0x0003 }, }, + }, { + 600000000, { + { 0x1a40, 0x0003 }, + { 0x3b4c, 0x0003 }, + { 0x5a64, 0x0003 }, + }, }, { ~0UL, { - { 0x00a0, 0x000a }, - { 0x2001, 0x000f }, - { 0x4002, 0x000f }, + { 0x0000, 0x0000 }, + { 0x0000, 0x0000 }, + { 0x0000, 0x0000 }, }, } }; --=20 2.46.0 From nobody Sat Nov 30 16:25:53 2024 Received: from smtp.forwardemail.net (smtp.forwardemail.net [149.28.215.223]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 78DF5175D27 for ; Sun, 8 Sep 2024 14:56:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=149.28.215.223 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725807369; cv=none; b=kVBCD61AZY0omSx/t80rIDnl9oxAC9QY7ezm8boLbg1GVvZGwPghbxCmV9v/oJAMcvYkNR/81WVQ9eE/45xmzLudS+O/r5fbIcTGnWPg+zsIJcW9h80MxidCtBd1dQH249r3UtzBmDxS5E9FvaZ8GZeAKvd0kpzQWinKNKT9rJ8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725807369; c=relaxed/simple; bh=A2AxR9xSRjg/K7y3Z60Yb5AJMbrkD6IZDJS9jfCAxSA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=WKnTU/SmrhMhdNf6rOxX8ZY70gA/vtaVihg/mocYv7Or8kCQ47YX0QoTJ61D33wF3ygzrXrepFf+mnWJZHBv2FvD7NtKXF2NV8BTewpMKMB2L7xDVO1wR2O7vOoyBicetFITXRqtVCvrUXR1QP1uXZliu5shflTPv+nWcdnl4gU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=kwiboo.se; spf=pass smtp.mailfrom=fe-bounces.kwiboo.se; dkim=pass (2048-bit key) header.d=kwiboo.se header.i=@kwiboo.se header.b=ZWFw9OF1; arc=none smtp.client-ip=149.28.215.223 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=kwiboo.se Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=fe-bounces.kwiboo.se Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kwiboo.se header.i=@kwiboo.se header.b="ZWFw9OF1" 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=1725807347; bh=Z2Cb05mWFWfLkKZu5GopUYFl3Iafbmet5hEZs8+nUeA=; b=ZWFw9OF16J2MAEap+3I5h+/az2xi/wHRm7DllMZjY0aQd7sjFlUhM/H+FinAB7Km48FhKRnqw IGE8v5JowRdcX9XWgyYCHMbu//+nXvqEh035H/W5T2z9N//axANOb9VN93Ed53+TKtEUOOGepKe Jq8Glb3tWa4tZ95gXSAxiXbnj71SFioMLm1QpXPlOZDkaH9UjMa8sdik2yQYEkPDS9NDi2cx9zn wuj0njHuyUpbrrybPmuLJty8WSJK8htzDrI+/xG/jAm9oweo6QjhwyI5s70HEkfRik5epconors yF/T92FDl+eRPSSIQs4EoKjzkcDyB9ueUgUvHqcjtwdg== From: Jonas Karlman To: Heiko Stuebner , Sandy Huang , Andy Yan , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter Cc: Diederik de Haas , dri-devel@lists.freedesktop.org, linux-rockchip@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Jonas Karlman Subject: [PATCH v2 6/7] drm/rockchip: dw_hdmi: Enable 4K@60Hz mode on RK3399 and RK356x Date: Sun, 8 Sep 2024 14:55:03 +0000 Message-ID: <20240908145511.3331451-7-jonas@kwiboo.se> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240908145511.3331451-1-jonas@kwiboo.se> References: <20240908145511.3331451-1-jonas@kwiboo.se> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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: 66ddbaf13c9877b459588eff Content-Type: text/plain; charset="utf-8" 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 Tested-by: Diederik de Haas # Quartz64 Model B --- v2: Collect t-b tag --- 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 090d8c0f306f..96e1097f993d 100644 --- a/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c +++ b/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c @@ -481,7 +481,7 @@ static struct rockchip_hdmi_chip_data rk3399_chip_data = =3D { .lcdsel_grf_reg =3D RK3399_GRF_SOC_CON20, .lcdsel_big =3D HIWORD_UPDATE(0, RK3399_HDMI_LCDC_SEL), .lcdsel_lit =3D HIWORD_UPDATE(RK3399_HDMI_LCDC_SEL, RK3399_HDMI_LCDC_SEL), - .max_tmds_clock =3D 340000, + .max_tmds_clock =3D 594000, }; =20 static const struct dw_hdmi_plat_data rk3399_hdmi_drv_data =3D { @@ -495,7 +495,7 @@ static const struct dw_hdmi_plat_data rk3399_hdmi_drv_d= ata =3D { =20 static struct rockchip_hdmi_chip_data rk3568_chip_data =3D { .lcdsel_grf_reg =3D -1, - .max_tmds_clock =3D 340000, + .max_tmds_clock =3D 594000, }; =20 static const struct dw_hdmi_plat_data rk3568_hdmi_drv_data =3D { --=20 2.46.0 From nobody Sat Nov 30 16:25:53 2024 Received: from smtp.forwardemail.net (smtp.forwardemail.net [149.28.215.223]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 24739173347 for ; Sun, 8 Sep 2024 14:56:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=149.28.215.223 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725807370; cv=none; b=DsotRQ1ri0k2rvmaHCc6xMrSsg3iCcnBly05z+YXpJajgffkGusuZk3FznSAL1uw3qluOVkFwNrOLafqVUHoLdBjKgp3TA1yW9lwzmxn613j5OwLZSyh6oikPC2/+ueCQw05b53NfMKC1qIhZnuTGZ6DNUJV/CDe0gD37vzcGgQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725807370; c=relaxed/simple; bh=a1deiAozCdmJ4GF9o0XtiEt1ZU8QWLsHqhwArBEVCNQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=W6zLn7x92pQaazB/4s8CNFVHeRuDYQJZFwqDdtrXRrJphAhRCNiPWtXHuZjhsLOaR3J5ofJzeI/UdAEqqAG00+XW6GptOrBwo2mrjj+rBMCI3VH7+xunNHXe64x9tcz3RbF7L7cpnMFaGGVRHoSHk+Qt3fM9MUEeLnv7ZzxVktw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=kwiboo.se; spf=pass smtp.mailfrom=fe-bounces.kwiboo.se; dkim=pass (2048-bit key) header.d=kwiboo.se header.i=@kwiboo.se header.b=m5w1Uc0E; arc=none smtp.client-ip=149.28.215.223 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=kwiboo.se Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=fe-bounces.kwiboo.se Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kwiboo.se header.i=@kwiboo.se header.b="m5w1Uc0E" 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=1725807352; bh=Fen8SXObvKui+EcVpqkgeahn1KAOdYtBUTto1YpsJkY=; b=m5w1Uc0EeJDeC8pY9mEZGT+8uLPtvOHjxBvWrFo7oXfen30wNWXyRXtKQ2KTcWdmeFsmPsjbY iyKSEUAZkXkU+YOFZkTZzjyJ85ybHQi+pls3GRgyRaEm7S4+TzaPvxIqNG8SzNo9OAd3s4Hd/ql v2GXx+LxPcBrdcfOI6Ln1klzhkOGb7LJi1SlQFUv0Ucsgh0YpyhYoZvrcdi06I+FlkAX1qXceKe Yz5omvgvyPkBsiFTWP57yurqi3nfRr6j5ERcqpKI2/5rQWMNeEXnqvW1GZDjgAjRF5fnf3RmLNH C59wRK93UqFi8h5SnYBvvOuXAPw6ssz3VW3XfyA7pd0g== From: Jonas Karlman To: Heiko Stuebner , Sandy Huang , Andy Yan , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter Cc: Diederik de Haas , dri-devel@lists.freedesktop.org, linux-rockchip@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Jonas Karlman Subject: [PATCH v2 7/7] drm/rockchip: Load crtc devices in preferred order Date: Sun, 8 Sep 2024 14:55:04 +0000 Message-ID: <20240908145511.3331451-8-jonas@kwiboo.se> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240908145511.3331451-1-jonas@kwiboo.se> References: <20240908145511.3331451-1-jonas@kwiboo.se> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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: 66ddbaf53c9877b459588f11 Content-Type: text/plain; charset="utf-8" On RK3399 the VOPL is loaded before VOPB and get 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 --- v2: No change --- 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 44d769d9234d..b84451d59187 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); } =20 +/* list of preferred vop devices */ +static const char *const rockchip_drm_match_preferred[] =3D { + "rockchip,rk3399-vop-big", + NULL, +}; + static struct component_match *rockchip_drm_match_add(struct device *dev) { struct component_match *match =3D NULL; + struct device_node *port; int i; =20 + /* add preferred vop device match before adding driver device matches */ + for (i =3D 0; ; i++) { + port =3D 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 =3D 0; i < num_rockchip_sub_drivers; i++) { struct platform_driver *drv =3D rockchip_sub_drivers[i]; struct device *p =3D NULL, *d; --=20 2.46.0