* [PATCH 1/5] dt-bindings: display: vop2: Add optional PLL clock properties
2024-11-16 18:22 [PATCH 0/5] Improve Rockchip VOP2 display modes handling on RK3588 HDMI0 Cristian Ciocaltea
@ 2024-11-16 18:22 ` Cristian Ciocaltea
2024-11-19 17:14 ` Rob Herring (Arm)
2024-11-16 18:22 ` [PATCH 2/5] drm/rockchip: vop2: Drop unnecessary if_pixclk_rate computation Cristian Ciocaltea
` (4 subsequent siblings)
5 siblings, 1 reply; 10+ messages in thread
From: Cristian Ciocaltea @ 2024-11-16 18:22 UTC (permalink / raw)
To: Sandy Huang, Heiko Stübner, Andy Yan, Maarten Lankhorst,
Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter,
Rob Herring, Krzysztof Kozlowski, Conor Dooley
Cc: kernel, dri-devel, devicetree, linux-arm-kernel, linux-rockchip,
linux-kernel
On RK3588, HDMI PHY PLL can be used as an alternative and more accurate
pixel clock source for VOP2 video ports 0, 1 and 2.
Document the optional PLL clock properties corresponding to the two HDMI
PHYs available on the SoC.
Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
---
Documentation/devicetree/bindings/display/rockchip/rockchip-vop2.yaml | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/Documentation/devicetree/bindings/display/rockchip/rockchip-vop2.yaml b/Documentation/devicetree/bindings/display/rockchip/rockchip-vop2.yaml
index 2531726af306bd388c00c3c0a1785b2c7367e2bd..46d956e63338e196361483a668fbf5597ebce24f 100644
--- a/Documentation/devicetree/bindings/display/rockchip/rockchip-vop2.yaml
+++ b/Documentation/devicetree/bindings/display/rockchip/rockchip-vop2.yaml
@@ -53,6 +53,8 @@ properties:
- description: Pixel clock for video port 2.
- description: Pixel clock for video port 3.
- description: Peripheral(vop grf/dsi) clock.
+ - description: Alternative pixel clock provided by HDMI0 PHY PLL.
+ - description: Alternative pixel clock provided by HDMI1 PHY PLL.
clock-names:
minItems: 5
@@ -64,6 +66,8 @@ properties:
- const: dclk_vp2
- const: dclk_vp3
- const: pclk_vop
+ - const: pll_hdmiphy0
+ - const: pll_hdmiphy1
rockchip,grf:
$ref: /schemas/types.yaml#/definitions/phandle
--
2.47.0
^ permalink raw reply [flat|nested] 10+ messages in thread* Re: [PATCH 1/5] dt-bindings: display: vop2: Add optional PLL clock properties
2024-11-16 18:22 ` [PATCH 1/5] dt-bindings: display: vop2: Add optional PLL clock properties Cristian Ciocaltea
@ 2024-11-19 17:14 ` Rob Herring (Arm)
0 siblings, 0 replies; 10+ messages in thread
From: Rob Herring (Arm) @ 2024-11-19 17:14 UTC (permalink / raw)
To: Cristian Ciocaltea
Cc: Thomas Zimmermann, Maxime Ripard, Maarten Lankhorst,
David Airlie, devicetree, kernel, Sandy Huang, linux-arm-kernel,
dri-devel, linux-kernel, linux-rockchip, Conor Dooley,
Heiko Stübner, Andy Yan, Krzysztof Kozlowski, Simona Vetter
On Sat, 16 Nov 2024 20:22:32 +0200, Cristian Ciocaltea wrote:
> On RK3588, HDMI PHY PLL can be used as an alternative and more accurate
> pixel clock source for VOP2 video ports 0, 1 and 2.
>
> Document the optional PLL clock properties corresponding to the two HDMI
> PHYs available on the SoC.
>
> Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
> ---
> Documentation/devicetree/bindings/display/rockchip/rockchip-vop2.yaml | 4 ++++
> 1 file changed, 4 insertions(+)
>
Acked-by: Rob Herring (Arm) <robh@kernel.org>
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH 2/5] drm/rockchip: vop2: Drop unnecessary if_pixclk_rate computation
2024-11-16 18:22 [PATCH 0/5] Improve Rockchip VOP2 display modes handling on RK3588 HDMI0 Cristian Ciocaltea
2024-11-16 18:22 ` [PATCH 1/5] dt-bindings: display: vop2: Add optional PLL clock properties Cristian Ciocaltea
@ 2024-11-16 18:22 ` Cristian Ciocaltea
2024-11-16 18:22 ` [PATCH 3/5] drm/rockchip: vop2: Improve display modes handling on RK3588 HDMI0 Cristian Ciocaltea
` (3 subsequent siblings)
5 siblings, 0 replies; 10+ messages in thread
From: Cristian Ciocaltea @ 2024-11-16 18:22 UTC (permalink / raw)
To: Sandy Huang, Heiko Stübner, Andy Yan, Maarten Lankhorst,
Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter,
Rob Herring, Krzysztof Kozlowski, Conor Dooley
Cc: kernel, dri-devel, devicetree, linux-arm-kernel, linux-rockchip,
linux-kernel
The if_pixclk_rate variable is not being used outside of the if-block in
rk3588_calc_cru_cfg(), hence move the superfluous assignment from the
first branch to the inner comment-block.
Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
---
drivers/gpu/drm/rockchip/rockchip_drm_vop2.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c
index 9ad025aa9ab0523c8807b331564c68da10c56c18..3e4c1cfd0bac6fa90f4cab85e27c2a69b86fc9aa 100644
--- a/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c
+++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c
@@ -1838,8 +1838,8 @@ static unsigned long rk3588_calc_cru_cfg(struct vop2_video_port *vp, int id,
K = 2;
}
- if_pixclk_rate = (dclk_core_rate << 1) / K;
/*
+ * if_pixclk_rate = (dclk_core_rate << 1) / K;
* if_dclk_rate = dclk_core_rate / K;
* *if_pixclk_div = dclk_rate / if_pixclk_rate;
* *if_dclk_div = dclk_rate / if_dclk_rate;
--
2.47.0
^ permalink raw reply [flat|nested] 10+ messages in thread* [PATCH 3/5] drm/rockchip: vop2: Improve display modes handling on RK3588 HDMI0
2024-11-16 18:22 [PATCH 0/5] Improve Rockchip VOP2 display modes handling on RK3588 HDMI0 Cristian Ciocaltea
2024-11-16 18:22 ` [PATCH 1/5] dt-bindings: display: vop2: Add optional PLL clock properties Cristian Ciocaltea
2024-11-16 18:22 ` [PATCH 2/5] drm/rockchip: vop2: Drop unnecessary if_pixclk_rate computation Cristian Ciocaltea
@ 2024-11-16 18:22 ` Cristian Ciocaltea
2024-11-16 19:12 ` Jonas Karlman
2024-11-16 18:22 ` [PATCH 4/5] arm64: dts: rockchip: Enable HDMI0 PHY clk provider on RK3588 Cristian Ciocaltea
` (2 subsequent siblings)
5 siblings, 1 reply; 10+ messages in thread
From: Cristian Ciocaltea @ 2024-11-16 18:22 UTC (permalink / raw)
To: Sandy Huang, Heiko Stübner, Andy Yan, Maarten Lankhorst,
Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter,
Rob Herring, Krzysztof Kozlowski, Conor Dooley
Cc: kernel, dri-devel, devicetree, linux-arm-kernel, linux-rockchip,
linux-kernel
The RK3588 specific implementation is currently quite limited in terms
of handling the full range of display modes supported by the connected
screens, e.g. 2560x1440@75Hz, 2048x1152@60Hz, 1024x768@60Hz are just a
few of them.
Additionally, it doesn't cope well with non-integer refresh rates like
59.94, 29.97, 23.98, etc.
Make use of HDMI0 PHY PLL as a more accurate DCLK source to handle
all display modes up to 4K@60Hz.
Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
---
drivers/gpu/drm/rockchip/rockchip_drm_vop2.c | 34 ++++++++++++++++++++++++++++
1 file changed, 34 insertions(+)
diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c
index 3e4c1cfd0bac6fa90f4cab85e27c2a69b86fc9aa..dfe1a50132d596f036430d7db3631398d0802972 100644
--- a/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c
+++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c
@@ -158,6 +158,7 @@ struct vop2_video_port {
struct drm_crtc crtc;
struct vop2 *vop2;
struct clk *dclk;
+ struct clk *dclk_src;
unsigned int id;
const struct vop2_video_port_data *data;
@@ -212,6 +213,7 @@ struct vop2 {
struct clk *hclk;
struct clk *aclk;
struct clk *pclk;
+ struct clk *pll_hdmiphy0;
/* optional internal rgb encoder */
struct rockchip_rgb *rgb;
@@ -220,6 +222,8 @@ struct vop2 {
struct vop2_win win[];
};
+#define VOP2_MAX_DCLK_RATE 600000 /* kHz */
+
#define vop2_output_if_is_hdmi(x) ((x) == ROCKCHIP_VOP2_EP_HDMI0 || \
(x) == ROCKCHIP_VOP2_EP_HDMI1)
@@ -1103,6 +1107,9 @@ static void vop2_crtc_atomic_disable(struct drm_crtc *crtc,
vop2_crtc_disable_irq(vp, VP_INT_DSP_HOLD_VALID);
+ if (vp->dclk_src)
+ clk_set_parent(vp->dclk, vp->dclk_src);
+
clk_disable_unprepare(vp->dclk);
vop2->enable_count--;
@@ -2192,6 +2199,27 @@ static void vop2_crtc_atomic_enable(struct drm_crtc *crtc,
vop2_vp_write(vp, RK3568_VP_MIPI_CTRL, 0);
+ /*
+ * Switch to HDMI PHY PLL as DCLK source for display modes up
+ * to 4K@60Hz, if available, otherwise keep using the system CRU.
+ */
+ if (vop2->pll_hdmiphy0 && mode->crtc_clock <= VOP2_MAX_DCLK_RATE) {
+ drm_for_each_encoder_mask(encoder, crtc->dev, crtc_state->encoder_mask) {
+ struct rockchip_encoder *rkencoder = to_rockchip_encoder(encoder);
+
+ if (rkencoder->crtc_endpoint_id == ROCKCHIP_VOP2_EP_HDMI0) {
+ if (!vp->dclk_src)
+ vp->dclk_src = clk_get_parent(vp->dclk);
+
+ ret = clk_set_parent(vp->dclk, vop2->pll_hdmiphy0);
+ if (ret < 0)
+ drm_warn(vop2->drm,
+ "Could not switch to HDMI0 PHY PLL: %d\n", ret);
+ break;
+ }
+ }
+ }
+
clk_set_rate(vp->dclk, clock);
vop2_post_config(crtc);
@@ -3355,6 +3383,12 @@ static int vop2_bind(struct device *dev, struct device *master, void *data)
return PTR_ERR(vop2->pclk);
}
+ vop2->pll_hdmiphy0 = devm_clk_get_optional(vop2->dev, "pll_hdmiphy0");
+ if (IS_ERR(vop2->pll_hdmiphy0)) {
+ drm_err(vop2->drm, "failed to get pll_hdmiphy0\n");
+ return PTR_ERR(vop2->pll_hdmiphy0);
+ }
+
vop2->irq = platform_get_irq(pdev, 0);
if (vop2->irq < 0) {
drm_err(vop2->drm, "cannot find irq for vop2\n");
--
2.47.0
^ permalink raw reply [flat|nested] 10+ messages in thread* Re: [PATCH 3/5] drm/rockchip: vop2: Improve display modes handling on RK3588 HDMI0
2024-11-16 18:22 ` [PATCH 3/5] drm/rockchip: vop2: Improve display modes handling on RK3588 HDMI0 Cristian Ciocaltea
@ 2024-11-16 19:12 ` Jonas Karlman
2024-11-16 23:22 ` Cristian Ciocaltea
0 siblings, 1 reply; 10+ messages in thread
From: Jonas Karlman @ 2024-11-16 19:12 UTC (permalink / raw)
To: Cristian Ciocaltea
Cc: Sandy Huang, Heiko Stübner, Andy Yan, Maarten Lankhorst,
Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, kernel,
dri-devel, devicetree, linux-arm-kernel, linux-rockchip,
linux-kernel
Hi Cristian,
On 2024-11-16 19:22, Cristian Ciocaltea wrote:
> The RK3588 specific implementation is currently quite limited in terms
> of handling the full range of display modes supported by the connected
> screens, e.g. 2560x1440@75Hz, 2048x1152@60Hz, 1024x768@60Hz are just a
> few of them.
>
> Additionally, it doesn't cope well with non-integer refresh rates like
> 59.94, 29.97, 23.98, etc.
>
> Make use of HDMI0 PHY PLL as a more accurate DCLK source to handle
> all display modes up to 4K@60Hz.
>
> Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
> ---
> drivers/gpu/drm/rockchip/rockchip_drm_vop2.c | 34 ++++++++++++++++++++++++++++
> 1 file changed, 34 insertions(+)
>
> diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c
> index 3e4c1cfd0bac6fa90f4cab85e27c2a69b86fc9aa..dfe1a50132d596f036430d7db3631398d0802972 100644
> --- a/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c
> +++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c
> @@ -158,6 +158,7 @@ struct vop2_video_port {
> struct drm_crtc crtc;
> struct vop2 *vop2;
> struct clk *dclk;
> + struct clk *dclk_src;
> unsigned int id;
> const struct vop2_video_port_data *data;
>
> @@ -212,6 +213,7 @@ struct vop2 {
> struct clk *hclk;
> struct clk *aclk;
> struct clk *pclk;
> + struct clk *pll_hdmiphy0;
>
> /* optional internal rgb encoder */
> struct rockchip_rgb *rgb;
> @@ -220,6 +222,8 @@ struct vop2 {
> struct vop2_win win[];
> };
>
> +#define VOP2_MAX_DCLK_RATE 600000 /* kHz */
> +
> #define vop2_output_if_is_hdmi(x) ((x) == ROCKCHIP_VOP2_EP_HDMI0 || \
> (x) == ROCKCHIP_VOP2_EP_HDMI1)
>
> @@ -1103,6 +1107,9 @@ static void vop2_crtc_atomic_disable(struct drm_crtc *crtc,
>
> vop2_crtc_disable_irq(vp, VP_INT_DSP_HOLD_VALID);
>
> + if (vp->dclk_src)
> + clk_set_parent(vp->dclk, vp->dclk_src);
> +
> clk_disable_unprepare(vp->dclk);
>
> vop2->enable_count--;
> @@ -2192,6 +2199,27 @@ static void vop2_crtc_atomic_enable(struct drm_crtc *crtc,
>
> vop2_vp_write(vp, RK3568_VP_MIPI_CTRL, 0);
>
> + /*
> + * Switch to HDMI PHY PLL as DCLK source for display modes up
> + * to 4K@60Hz, if available, otherwise keep using the system CRU.
> + */
> + if (vop2->pll_hdmiphy0 && mode->crtc_clock <= VOP2_MAX_DCLK_RATE) {
> + drm_for_each_encoder_mask(encoder, crtc->dev, crtc_state->encoder_mask) {
> + struct rockchip_encoder *rkencoder = to_rockchip_encoder(encoder);
> +
> + if (rkencoder->crtc_endpoint_id == ROCKCHIP_VOP2_EP_HDMI0) {
> + if (!vp->dclk_src)
> + vp->dclk_src = clk_get_parent(vp->dclk);
> +
> + ret = clk_set_parent(vp->dclk, vop2->pll_hdmiphy0);
> + if (ret < 0)
> + drm_warn(vop2->drm,
> + "Could not switch to HDMI0 PHY PLL: %d\n", ret);
> + break;
> + }
> + }
> + }
Why do we need to do this dynamically here?
The device tree set PLL_HPLL as parent:
&vop {
assigned-clocks = <&cru DCLK_VOP0>, <&cru DCLK_VOP1>;
assigned-clock-parents = <&pmucru PLL_HPLL>, <&cru PLL_VPLL>;
status = "okay";
};
Could this not just be changed to assign hdptxphy_hdmi0 as parent?
&vop {
assigned-clocks = <&cru DCLK_VOP0>, <&cru DCLK_VOP1>;
assigned-clock-parents = <&hdptxphy_hdmi0>, <&cru PLL_VPLL>;
status = "okay";
};
or something similar?
For RK3328 the vop dclk parent is assigned to hdmiphy using DT.
Regards,
Jonas
> +
> clk_set_rate(vp->dclk, clock);
>
> vop2_post_config(crtc);
> @@ -3355,6 +3383,12 @@ static int vop2_bind(struct device *dev, struct device *master, void *data)
> return PTR_ERR(vop2->pclk);
> }
>
> + vop2->pll_hdmiphy0 = devm_clk_get_optional(vop2->dev, "pll_hdmiphy0");
> + if (IS_ERR(vop2->pll_hdmiphy0)) {
> + drm_err(vop2->drm, "failed to get pll_hdmiphy0\n");
> + return PTR_ERR(vop2->pll_hdmiphy0);
> + }
> +
> vop2->irq = platform_get_irq(pdev, 0);
> if (vop2->irq < 0) {
> drm_err(vop2->drm, "cannot find irq for vop2\n");
>
^ permalink raw reply [flat|nested] 10+ messages in thread* Re: [PATCH 3/5] drm/rockchip: vop2: Improve display modes handling on RK3588 HDMI0
2024-11-16 19:12 ` Jonas Karlman
@ 2024-11-16 23:22 ` Cristian Ciocaltea
0 siblings, 0 replies; 10+ messages in thread
From: Cristian Ciocaltea @ 2024-11-16 23:22 UTC (permalink / raw)
To: Jonas Karlman
Cc: Sandy Huang, Heiko Stübner, Andy Yan, Maarten Lankhorst,
Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, kernel,
dri-devel, devicetree, linux-arm-kernel, linux-rockchip,
linux-kernel
Hi Jonas,
On 11/16/24 9:12 PM, Jonas Karlman wrote:
> Hi Cristian,
>
> On 2024-11-16 19:22, Cristian Ciocaltea wrote:
>> The RK3588 specific implementation is currently quite limited in terms
>> of handling the full range of display modes supported by the connected
>> screens, e.g. 2560x1440@75Hz, 2048x1152@60Hz, 1024x768@60Hz are just a
>> few of them.
>>
>> Additionally, it doesn't cope well with non-integer refresh rates like
>> 59.94, 29.97, 23.98, etc.
>>
>> Make use of HDMI0 PHY PLL as a more accurate DCLK source to handle
>> all display modes up to 4K@60Hz.
>>
>> Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
>> ---
>> drivers/gpu/drm/rockchip/rockchip_drm_vop2.c | 34 ++++++++++++++++++++++++++++
>> 1 file changed, 34 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c
>> index 3e4c1cfd0bac6fa90f4cab85e27c2a69b86fc9aa..dfe1a50132d596f036430d7db3631398d0802972 100644
>> --- a/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c
>> +++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c
[...]
>> + /*
>> + * Switch to HDMI PHY PLL as DCLK source for display modes up
>> + * to 4K@60Hz, if available, otherwise keep using the system CRU.
>> + */
>> + if (vop2->pll_hdmiphy0 && mode->crtc_clock <= VOP2_MAX_DCLK_RATE) {
>> + drm_for_each_encoder_mask(encoder, crtc->dev, crtc_state->encoder_mask) {
>> + struct rockchip_encoder *rkencoder = to_rockchip_encoder(encoder);
>> +
>> + if (rkencoder->crtc_endpoint_id == ROCKCHIP_VOP2_EP_HDMI0) {
>> + if (!vp->dclk_src)
>> + vp->dclk_src = clk_get_parent(vp->dclk);
>> +
>> + ret = clk_set_parent(vp->dclk, vop2->pll_hdmiphy0);
>> + if (ret < 0)
>> + drm_warn(vop2->drm,
>> + "Could not switch to HDMI0 PHY PLL: %d\n", ret);
>> + break;
>> + }
>> + }
>> + }
>
> Why do we need to do this dynamically here?
>
> The device tree set PLL_HPLL as parent:
>
> &vop {
> assigned-clocks = <&cru DCLK_VOP0>, <&cru DCLK_VOP1>;
> assigned-clock-parents = <&pmucru PLL_HPLL>, <&cru PLL_VPLL>;
> status = "okay";
> };
>
> Could this not just be changed to assign hdptxphy_hdmi0 as parent?
>
> &vop {
> assigned-clocks = <&cru DCLK_VOP0>, <&cru DCLK_VOP1>;
> assigned-clock-parents = <&hdptxphy_hdmi0>, <&cru PLL_VPLL>;
> status = "okay";
> };
>
> or something similar?
>
> For RK3328 the vop dclk parent is assigned to hdmiphy using DT.
Yes, that would normally work. The problem is that the PHY PLLs cannot
provide pixel clocks for resolutions above 4K@60Hz (hence limited to
HDMI 2.0), while VOP2 on RK3588 supports up to 8K@60Hz (making use of
HDMI 2.1).
On top of that, the 2 PLLs are shared between 3 out of the 4 video ports
of the display controller. There is quite a bit of complexity in
downstream driver to handle all possible usecases - see [1] for a brief
description on how is that supposed to work.
Regards,
Cristian
[1] https://github.com/radxa/kernel/blob/linux-6.1-stan-rkr4.1/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c#L4742
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH 4/5] arm64: dts: rockchip: Enable HDMI0 PHY clk provider on RK3588
2024-11-16 18:22 [PATCH 0/5] Improve Rockchip VOP2 display modes handling on RK3588 HDMI0 Cristian Ciocaltea
` (2 preceding siblings ...)
2024-11-16 18:22 ` [PATCH 3/5] drm/rockchip: vop2: Improve display modes handling on RK3588 HDMI0 Cristian Ciocaltea
@ 2024-11-16 18:22 ` Cristian Ciocaltea
2024-11-16 18:22 ` [PATCH 5/5] arm64: dts: rockchip: Add HDMI0 PHY PLL clock source to VOP2 " Cristian Ciocaltea
2024-11-20 22:16 ` [PATCH 0/5] Improve Rockchip VOP2 display modes handling on RK3588 HDMI0 FUKAUMI Naoki
5 siblings, 0 replies; 10+ messages in thread
From: Cristian Ciocaltea @ 2024-11-16 18:22 UTC (permalink / raw)
To: Sandy Huang, Heiko Stübner, Andy Yan, Maarten Lankhorst,
Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter,
Rob Herring, Krzysztof Kozlowski, Conor Dooley
Cc: kernel, dri-devel, devicetree, linux-arm-kernel, linux-rockchip,
linux-kernel
Since commit c4b09c562086 ("phy: phy-rockchip-samsung-hdptx: Add clock
provider support"), the HDMI PHY PLL can be used as an alternative and
more accurate pixel clock source for VOP2 to improve display modes
handling on RK3588 SoC.
Add the missing #clock-cells property to allow using the clock provider
functionality of HDMI0 PHY.
Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
---
arch/arm64/boot/dts/rockchip/rk3588-base.dtsi | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/arm64/boot/dts/rockchip/rk3588-base.dtsi b/arch/arm64/boot/dts/rockchip/rk3588-base.dtsi
index a337f3fb8377e4a3a200d4d3a3773a237de2bd6e..22462e86f48027ab7c5e270f2fa04df7afcc1d24 100644
--- a/arch/arm64/boot/dts/rockchip/rk3588-base.dtsi
+++ b/arch/arm64/boot/dts/rockchip/rk3588-base.dtsi
@@ -2811,6 +2811,7 @@ hdptxphy_hdmi0: phy@fed60000 {
reg = <0x0 0xfed60000 0x0 0x2000>;
clocks = <&cru CLK_USB2PHY_HDPTXRXPHY_REF>, <&cru PCLK_HDPTX0>;
clock-names = "ref", "apb";
+ #clock-cells = <0>;
#phy-cells = <0>;
resets = <&cru SRST_HDPTX0>, <&cru SRST_P_HDPTX0>,
<&cru SRST_HDPTX0_INIT>, <&cru SRST_HDPTX0_CMN>,
--
2.47.0
^ permalink raw reply [flat|nested] 10+ messages in thread* [PATCH 5/5] arm64: dts: rockchip: Add HDMI0 PHY PLL clock source to VOP2 on RK3588
2024-11-16 18:22 [PATCH 0/5] Improve Rockchip VOP2 display modes handling on RK3588 HDMI0 Cristian Ciocaltea
` (3 preceding siblings ...)
2024-11-16 18:22 ` [PATCH 4/5] arm64: dts: rockchip: Enable HDMI0 PHY clk provider on RK3588 Cristian Ciocaltea
@ 2024-11-16 18:22 ` Cristian Ciocaltea
2024-11-20 22:16 ` [PATCH 0/5] Improve Rockchip VOP2 display modes handling on RK3588 HDMI0 FUKAUMI Naoki
5 siblings, 0 replies; 10+ messages in thread
From: Cristian Ciocaltea @ 2024-11-16 18:22 UTC (permalink / raw)
To: Sandy Huang, Heiko Stübner, Andy Yan, Maarten Lankhorst,
Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter,
Rob Herring, Krzysztof Kozlowski, Conor Dooley
Cc: kernel, dri-devel, devicetree, linux-arm-kernel, linux-rockchip,
linux-kernel
VOP2 on RK3588 is able to use the HDMI PHY PLL as an alternative and
more accurate pixel clock source to improve handling of display modes up
to 4K@60Hz on video ports 0, 1 and 2.
For now only HDMI0 output is supported, hence add the related PLL clock.
Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
---
arch/arm64/boot/dts/rockchip/rk3588-base.dtsi | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/arch/arm64/boot/dts/rockchip/rk3588-base.dtsi b/arch/arm64/boot/dts/rockchip/rk3588-base.dtsi
index 22462e86f48027ab7c5e270f2fa04df7afcc1d24..d07be2a81f28b4cbfe314992c662d8cfb3d3d344 100644
--- a/arch/arm64/boot/dts/rockchip/rk3588-base.dtsi
+++ b/arch/arm64/boot/dts/rockchip/rk3588-base.dtsi
@@ -1262,14 +1262,16 @@ vop: vop@fdd90000 {
<&cru DCLK_VOP1>,
<&cru DCLK_VOP2>,
<&cru DCLK_VOP3>,
- <&cru PCLK_VOP_ROOT>;
+ <&cru PCLK_VOP_ROOT>,
+ <&hdptxphy_hdmi0>;
clock-names = "aclk",
"hclk",
"dclk_vp0",
"dclk_vp1",
"dclk_vp2",
"dclk_vp3",
- "pclk_vop";
+ "pclk_vop",
+ "pll_hdmiphy0";
iommus = <&vop_mmu>;
power-domains = <&power RK3588_PD_VOP>;
rockchip,grf = <&sys_grf>;
--
2.47.0
^ permalink raw reply [flat|nested] 10+ messages in thread* Re: [PATCH 0/5] Improve Rockchip VOP2 display modes handling on RK3588 HDMI0
2024-11-16 18:22 [PATCH 0/5] Improve Rockchip VOP2 display modes handling on RK3588 HDMI0 Cristian Ciocaltea
` (4 preceding siblings ...)
2024-11-16 18:22 ` [PATCH 5/5] arm64: dts: rockchip: Add HDMI0 PHY PLL clock source to VOP2 " Cristian Ciocaltea
@ 2024-11-20 22:16 ` FUKAUMI Naoki
5 siblings, 0 replies; 10+ messages in thread
From: FUKAUMI Naoki @ 2024-11-20 22:16 UTC (permalink / raw)
To: Cristian Ciocaltea, Sandy Huang, Heiko Stübner, Andy Yan,
Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
David Airlie, Simona Vetter, Rob Herring, Krzysztof Kozlowski,
Conor Dooley
Cc: kernel, dri-devel, devicetree, linux-arm-kernel, linux-rockchip,
linux-kernel
Hi,
On 11/17/24 03:22, Cristian Ciocaltea wrote:
> VOP2 support for RK3588 SoC is currently not capable to handle the full
> range of display modes advertised by the connected screens, e.g. it
> doesn't cope well with non-integer refresh rates like 59.94, 29.97,
> 23.98, etc.
>
> There are two HDMI PHYs available on RK3588, each providing a PLL that
> can be used by three out of the four VOP2 video ports as an alternative
> and more accurate pixel clock source. This is able to correctly handle
> all display modes up to 4K@60Hz.
>
> As for the moment HDMI1 output is not supported upstream, the patch
> series targets HDMI0 only.
>
> Additionally, note that testing any HDMI 2.0 specific modes, e.g.
> 4K@60Hz, requires high TMDS clock ratio and scrambling support [1]. The
> patch is usable but not yet ready to be submitted - I will handle this
> soon.
>
> Thanks,
> Cristian
>
> [1] https://gitlab.collabora.com/hardware-enablement/rockchip-3588/linux/-/commits/rk3588-hdmi-bridge-next-20241115
>
> Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
for whole series
Tested-by: FUKAUMI Naoki <naoki@radxa.com>
Diginnos DG-NP09D 8.9inch 1920x1200 display works with your patch!
Name: HSE
EISA ID: ___0001
EDID version: 1.3
EDID extension blocks: 1
Screen size: 120.0 cm x 68.0 cm (54.30 inches, aspect ratio 16/9 = 1.76)
Gamma: 2.2
Digital signal
Max video bandwidth: 160 MHz
HorizSync 14-91
VertRefresh 22-80
# Monitor preferred modeline (59.9 Hz vsync, 74.6 kHz hsync, ratio
16/10, 40x44 dpi)
ModeLine "1920x1200" 193.25 1920 2008 2052 2592 1200 1204 1209 1245
+hsync +vsync
# Monitor supported modeline (59.9 Hz vsync, 33.7 kHz hsync,
interlaced, ratio 16/9, 40 dpi)
ModeLine "1920x1080" 74.18 1920 2008 2052 2200 1080 1084 1094 1125
+hsync +vsync Interlace
# Monitor supported CEA modeline (59.9 Hz vsync, 31.5 kHz hsync, ratio
4/3, 13x17 dpi) (bad ratio)
ModeLine "640x480" 25.175 640 656 752 800 480 490 492 525 -hsync -vsync
# Monitor supported CEA modeline (59.9 Hz vsync, 31.5 kHz hsync, ratio
3/2, 15x17 dpi) (bad ratio)
ModeLine "720x480" 27 720 736 798 858 480 489 495 525 -hsync -vsync
# Monitor supported CEA modeline (59.9 Hz vsync, 31.5 kHz hsync, ratio
3/2, 15x17 dpi) (bad ratio)
ModeLine "720x480" 27 720 736 798 858 480 489 495 525 -hsync -vsync
# Monitor supported CEA modeline (60.0 Hz vsync, 45.0 kHz hsync, ratio
16/9, 27 dpi)
ModeLine "1280x720" 74.25 1280 1390 1430 1650 720 725 730 750 +hsync +vsync
# Monitor supported CEA modeline (60.0 Hz vsync, 33.8 kHz hsync,
interlaced, ratio 16/9, 40 dpi)
ModeLine "1920x1080" 74.25 1920 2008 2052 2200 1080 1084 1094 1125
+hsync +vsync Interlace
# Monitor supported CEA modeline (60.0 Hz vsync, 67.5 kHz hsync, ratio
16/9, 40 dpi)
ModeLine "1920x1080" 148.5 1920 2008 2052 2200 1080 1084 1089 1125
+hsync +vsync
# Monitor supported CEA modeline (50.0 Hz vsync, 31.2 kHz hsync, ratio
5/4, 15x21 dpi) (bad ratio)
ModeLine "720x576" 27 720 732 796 864 576 581 586 625 -hsync -vsync
# Monitor supported CEA modeline (50.0 Hz vsync, 37.5 kHz hsync, ratio
16/9, 27 dpi)
ModeLine "1280x720" 74.25 1280 1720 1760 1980 720 725 730 750 +hsync +vsync
# Monitor supported CEA modeline (50.0 Hz vsync, 28.1 kHz hsync,
interlaced, ratio 16/9, 40 dpi)
ModeLine "1920x1080" 74.25 1920 2448 2492 2640 1080 1084 1094 1125
+hsync +vsync Interlace
# Monitor supported CEA modeline (50.0 Hz vsync, 56.2 kHz hsync, ratio
16/9, 40 dpi)
ModeLine "1920x1080" 148.5 1920 2448 2492 2640 1080 1084 1089 1125
+hsync +vsync
# Monitor supported modeline (85.4 Hz vsync, 44.9 kHz hsync, ratio
0.97, 9x17 dpi) (bad ratio)
ModeLine "464x480" 27 464 480 542 602 480 489 495 525 -hsync -vsync
# Monitor supported modeline (50.0 Hz vsync, 37.5 kHz hsync, ratio
16/9, 27 dpi)
ModeLine "1280x720" 74.25 1280 1720 1760 1980 720 725 730 750 +hsync +vsync
# Monitor supported modeline (50.0 Hz vsync, 28.1 kHz hsync,
interlaced, ratio 16/9, 40 dpi)
ModeLine "1920x1080" 74.25 1920 2448 2492 2640 1080 1084 1094 1125
+hsync +vsync Interlace
# Monitor supported modeline (59.9 Hz vsync, 31.5 kHz hsync, ratio 3/2,
15x17 dpi) (bad ratio)
ModeLine "720x480" 27 720 736 798 858 480 489 495 525 -hsync -vsync
# Monitor supported modeline (50.0 Hz vsync, 31.2 kHz hsync, ratio 5/4,
15x21 dpi) (bad ratio)
ModeLine "720x576" 27 720 732 796 864 576 581 586 625 -hsync -vsync
Best regards,
--
FUKAUMI Naoki
Radxa Computer (Shenzhen) Co., Ltd.
> ---
> Cristian Ciocaltea (5):
> dt-bindings: display: vop2: Add optional PLL clock properties
> drm/rockchip: vop2: Drop unnecessary if_pixclk_rate computation
> drm/rockchip: vop2: Improve display modes handling on RK3588 HDMI0
> arm64: dts: rockchip: Enable HDMI0 PHY clk provider on RK3588
> arm64: dts: rockchip: Add HDMI0 PHY PLL clock source to VOP2 on RK3588
>
> .../bindings/display/rockchip/rockchip-vop2.yaml | 4 +++
> arch/arm64/boot/dts/rockchip/rk3588-base.dtsi | 7 +++--
> drivers/gpu/drm/rockchip/rockchip_drm_vop2.c | 36 +++++++++++++++++++++-
> 3 files changed, 44 insertions(+), 3 deletions(-)
> ---
> base-commit: 744cf71b8bdfcdd77aaf58395e068b7457634b2c
> change-id: 20241116-vop2-hdmi0-disp-modes-b39e3619768f
^ permalink raw reply [flat|nested] 10+ messages in thread