linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/2] Add DP max link rate  support
@ 2022-11-09 18:34 Kuogee Hsieh
  2022-11-09 18:34 ` [PATCH v2 1/2] arm64: dts: qcom: Add link-frequencies property to specify the max link rate allowed Kuogee Hsieh
  2022-11-09 18:34 ` [PATCH v2 2/2] drm/msm/dp: add support of max dp link rate Kuogee Hsieh
  0 siblings, 2 replies; 4+ messages in thread
From: Kuogee Hsieh @ 2022-11-09 18:34 UTC (permalink / raw)
  To: dri-devel, robdclark, sean, swboyd, dianders, vkoul, daniel,
	airlied, agross, dmitry.baryshkov, bjorn.andersson
  Cc: Kuogee Hsieh, quic_abhinavk, quic_sbillaka, freedreno,
	linux-arm-msm, linux-kernel

dd DP link-frequencies property to DTS file and support function to DP driver.

Kuogee Hsieh (2):
  arm64: dts: qcom: Add link-frequencies property to specify the max
    link rate allowed
  drm/msm/dp: add support of max dp link rate

 arch/arm64/boot/dts/qcom/sc7280-herobrine.dtsi | 1 +
 drivers/gpu/drm/msm/dp/dp_display.c            | 1 +
 drivers/gpu/drm/msm/dp/dp_panel.c              | 5 ++---
 drivers/gpu/drm/msm/dp/dp_panel.h              | 1 +
 drivers/gpu/drm/msm/dp/dp_parser.c             | 8 ++++++++
 drivers/gpu/drm/msm/dp/dp_parser.h             | 1 +
 6 files changed, 14 insertions(+), 3 deletions(-)

-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH v2 1/2] arm64: dts: qcom: Add link-frequencies property to specify the max link rate allowed
  2022-11-09 18:34 [PATCH v2 0/2] Add DP max link rate support Kuogee Hsieh
@ 2022-11-09 18:34 ` Kuogee Hsieh
  2022-11-09 19:27   ` Dmitry Baryshkov
  2022-11-09 18:34 ` [PATCH v2 2/2] drm/msm/dp: add support of max dp link rate Kuogee Hsieh
  1 sibling, 1 reply; 4+ messages in thread
From: Kuogee Hsieh @ 2022-11-09 18:34 UTC (permalink / raw)
  To: dri-devel, robdclark, sean, swboyd, dianders, vkoul, daniel,
	airlied, agross, dmitry.baryshkov, bjorn.andersson
  Cc: Kuogee Hsieh, quic_abhinavk, quic_sbillaka, freedreno,
	linux-arm-msm, linux-kernel

This patch add link-frequencies property to allow each platform to specify its
DP max link rate.

Signed-off-by: Kuogee Hsieh <quic_khsieh@quicinc.com>
---
 arch/arm64/boot/dts/qcom/sc7280-herobrine.dtsi | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm64/boot/dts/qcom/sc7280-herobrine.dtsi b/arch/arm64/boot/dts/qcom/sc7280-herobrine.dtsi
index 93e39fc..7e5d755 100644
--- a/arch/arm64/boot/dts/qcom/sc7280-herobrine.dtsi
+++ b/arch/arm64/boot/dts/qcom/sc7280-herobrine.dtsi
@@ -441,6 +441,7 @@ ap_i2c_tpm: &i2c14 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&dp_hot_plug_det>;
 	data-lanes = <0 1>;
+        link-frequencies = <810000>;
 };
 
 &mdss_mdp {
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH v2 2/2] drm/msm/dp: add support of max dp link rate
  2022-11-09 18:34 [PATCH v2 0/2] Add DP max link rate support Kuogee Hsieh
  2022-11-09 18:34 ` [PATCH v2 1/2] arm64: dts: qcom: Add link-frequencies property to specify the max link rate allowed Kuogee Hsieh
@ 2022-11-09 18:34 ` Kuogee Hsieh
  1 sibling, 0 replies; 4+ messages in thread
From: Kuogee Hsieh @ 2022-11-09 18:34 UTC (permalink / raw)
  To: dri-devel, robdclark, sean, swboyd, dianders, vkoul, daniel,
	airlied, agross, dmitry.baryshkov, bjorn.andersson
  Cc: Kuogee Hsieh, quic_abhinavk, quic_sbillaka, freedreno,
	linux-arm-msm, linux-kernel

Since it is not every platform supports HBR3 link rate, this patch
limit the DP link rate at max link rate if it is specified at DTS file.
Otherwise, the max dp link rate will be limited at HBR2 as before.

Changes in v2:
-- add max link rate from dtsi

Signed-off-by: Kuogee Hsieh <quic_khsieh@quicinc.com>
---
 drivers/gpu/drm/msm/dp/dp_display.c | 1 +
 drivers/gpu/drm/msm/dp/dp_panel.c   | 5 ++---
 drivers/gpu/drm/msm/dp/dp_panel.h   | 1 +
 drivers/gpu/drm/msm/dp/dp_parser.c  | 8 ++++++++
 drivers/gpu/drm/msm/dp/dp_parser.h  | 1 +
 5 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/msm/dp/dp_display.c b/drivers/gpu/drm/msm/dp/dp_display.c
index 29c9845..0e1a9b3 100644
--- a/drivers/gpu/drm/msm/dp/dp_display.c
+++ b/drivers/gpu/drm/msm/dp/dp_display.c
@@ -390,6 +390,7 @@ static int dp_display_process_hpd_high(struct dp_display_private *dp)
 	struct edid *edid;
 
 	dp->panel->max_dp_lanes = dp->parser->max_dp_lanes;
+	dp->panel->max_dp_link_rate = dp->parser->max_dp_link_rate;
 
 	rc = dp_panel_read_sink_caps(dp->panel, dp->dp_display.connector);
 	if (rc)
diff --git a/drivers/gpu/drm/msm/dp/dp_panel.c b/drivers/gpu/drm/msm/dp/dp_panel.c
index 5149ceb..87c27ca 100644
--- a/drivers/gpu/drm/msm/dp/dp_panel.c
+++ b/drivers/gpu/drm/msm/dp/dp_panel.c
@@ -78,9 +78,8 @@ static int dp_panel_read_dpcd(struct dp_panel *dp_panel)
 	if (link_info->num_lanes > dp_panel->max_dp_lanes)
 		link_info->num_lanes = dp_panel->max_dp_lanes;
 
-	/* Limit support upto HBR2 until HBR3 support is added */
-	if (link_info->rate >= (drm_dp_bw_code_to_link_rate(DP_LINK_BW_5_4)))
-		link_info->rate = drm_dp_bw_code_to_link_rate(DP_LINK_BW_5_4);
+	if (link_info->rate > dp_panel->max_dp_link_rate)
+		link_info->rate = dp_panel->max_dp_link_rate;
 
 	drm_dbg_dp(panel->drm_dev, "version: %d.%d\n", major, minor);
 	drm_dbg_dp(panel->drm_dev, "link_rate=%d\n", link_info->rate);
diff --git a/drivers/gpu/drm/msm/dp/dp_panel.h b/drivers/gpu/drm/msm/dp/dp_panel.h
index d861197a..f04d021 100644
--- a/drivers/gpu/drm/msm/dp/dp_panel.h
+++ b/drivers/gpu/drm/msm/dp/dp_panel.h
@@ -50,6 +50,7 @@ struct dp_panel {
 
 	u32 vic;
 	u32 max_dp_lanes;
+	u32 max_dp_link_rate;
 
 	u32 max_bw_code;
 };
diff --git a/drivers/gpu/drm/msm/dp/dp_parser.c b/drivers/gpu/drm/msm/dp/dp_parser.c
index dd73221..d2e31c2 100644
--- a/drivers/gpu/drm/msm/dp/dp_parser.c
+++ b/drivers/gpu/drm/msm/dp/dp_parser.c
@@ -95,6 +95,7 @@ static int dp_parser_misc(struct dp_parser *parser)
 {
 	struct device_node *of_node = parser->pdev->dev.of_node;
 	int len;
+	u32	rate;
 
 	len = drm_of_get_data_lanes_count(of_node, 1, DP_MAX_NUM_DP_LANES);
 	if (len < 0) {
@@ -104,6 +105,13 @@ static int dp_parser_misc(struct dp_parser *parser)
 	}
 
 	parser->max_dp_lanes = len;
+
+	len = of_property_read_s32(of_node, "link-frequencies", &rate);
+	if (len >= 0)
+		parser->max_dp_link_rate = rate;
+	else
+		parser->max_dp_link_rate = 540000;	/* default HBR2 */
+
 	return 0;
 }
 
diff --git a/drivers/gpu/drm/msm/dp/dp_parser.h b/drivers/gpu/drm/msm/dp/dp_parser.h
index 866c1a8..ba63375 100644
--- a/drivers/gpu/drm/msm/dp/dp_parser.h
+++ b/drivers/gpu/drm/msm/dp/dp_parser.h
@@ -119,6 +119,7 @@ struct dp_parser {
 	struct dp_io io;
 	struct dp_display_data disp_data;
 	u32 max_dp_lanes;
+	u32 max_dp_link_rate;
 	struct drm_bridge *next_bridge;
 
 	int (*parse)(struct dp_parser *parser);
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH v2 1/2] arm64: dts: qcom: Add link-frequencies property to specify the max link rate allowed
  2022-11-09 18:34 ` [PATCH v2 1/2] arm64: dts: qcom: Add link-frequencies property to specify the max link rate allowed Kuogee Hsieh
@ 2022-11-09 19:27   ` Dmitry Baryshkov
  0 siblings, 0 replies; 4+ messages in thread
From: Dmitry Baryshkov @ 2022-11-09 19:27 UTC (permalink / raw)
  To: Kuogee Hsieh, dri-devel, robdclark, sean, swboyd, dianders,
	vkoul, daniel, airlied, agross, bjorn.andersson
  Cc: quic_abhinavk, quic_sbillaka, freedreno, linux-arm-msm, linux-kernel

On 09/11/2022 21:34, Kuogee Hsieh wrote:
> This patch add link-frequencies property to allow each platform to specify its
> DP max link rate.
> 
> Signed-off-by: Kuogee Hsieh <quic_khsieh@quicinc.com>
> ---
>   arch/arm64/boot/dts/qcom/sc7280-herobrine.dtsi | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/arch/arm64/boot/dts/qcom/sc7280-herobrine.dtsi b/arch/arm64/boot/dts/qcom/sc7280-herobrine.dtsi
> index 93e39fc..7e5d755 100644
> --- a/arch/arm64/boot/dts/qcom/sc7280-herobrine.dtsi
> +++ b/arch/arm64/boot/dts/qcom/sc7280-herobrine.dtsi
> @@ -441,6 +441,7 @@ ap_i2c_tpm: &i2c14 {
>   	pinctrl-names = "default";
>   	pinctrl-0 = <&dp_hot_plug_det>;
>   	data-lanes = <0 1>;
> +        link-frequencies = <810000>;

The link frequency is a property of the link - in other words a graph 
connection. Please don't put random propreties into DT nodes where they 
are not to be used.


>   };
>   
>   &mdss_mdp {

-- 
With best wishes
Dmitry


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-11-09 19:27 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-09 18:34 [PATCH v2 0/2] Add DP max link rate support Kuogee Hsieh
2022-11-09 18:34 ` [PATCH v2 1/2] arm64: dts: qcom: Add link-frequencies property to specify the max link rate allowed Kuogee Hsieh
2022-11-09 19:27   ` Dmitry Baryshkov
2022-11-09 18:34 ` [PATCH v2 2/2] drm/msm/dp: add support of max dp link rate Kuogee Hsieh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).