Skip to contentSkip to conversation

drm/msm/dp: add support of HBR3 link rate

PATCH In review Kuogee Hsieh 3 participants 3 messages Feb 17, 2021 – Feb 18, 2021

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/msm/dp: add support of HBR3 link rate

Add hbr3_hbr2 voltage and pre-emphasis swing table to support HBR3 link rate

---
 drivers/gpu/drm/msm/dp/dp_panel.c   |  4 ----
 drivers/phy/qualcomm/phy-qcom-qmp.c | 24 ++++++++++++++++++++++--
 2 files changed, 22 insertions(+), 6 deletions(-)
drivers/gpu/drm/msm/dp/dp_panel.c +0 -4
index 9cc8166..63112fa 100644
@@ -76,10 +76,6 @@ 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);
-
 	DRM_DEBUG_DP("version: %d.%d\n", major, minor);
 	DRM_DEBUG_DP("link_rate=%d\n", link_info->rate);
 	DRM_DEBUG_DP("lane_count=%d\n", link_info->num_lanes);
drivers/phy/qualcomm/phy-qcom-qmp.c +22 -2
index 0939a9e..cc5ef59 100644
@@ -2965,6 +2965,21 @@ static void qcom_qmp_phy_dp_aux_init(struct qmp_phy *qphy)
 	       qphy->pcs + QSERDES_V3_DP_PHY_AUX_INTERRUPT_MASK);
 }
 
+
+static u8 const qmp_dp_v3_pre_emphasis_hbr3_hbr2[4][4] = {
+        {0x00, 0x0C, 0x15, 0x1A},
+        {0x02, 0x0E, 0x16, 0xFF},
+        {0x02, 0x11, 0xFF, 0xFF},
+        {0x04, 0xFF, 0xFF, 0xFF}
+};
+
+static u8 const qmp_dp_v3_voltage_swing_hbr3_hbr2[4][4] = {
+        {0x02, 0x12, 0x16, 0x1A},
+        {0x09, 0x19, 0x1F, 0xFF},
+        {0x10, 0x1F, 0xFF, 0xFF},
+        {0x1F, 0xFF, 0xFF, 0xFF}
+};
+
 static const u8 qmp_dp_v3_pre_emphasis_hbr_rbr[4][4] = {
 	{ 0x00, 0x0c, 0x14, 0x19 },
 	{ 0x00, 0x0b, 0x12, 0xff },
@@ -3000,8 +3015,13 @@ static void qcom_qmp_phy_configure_dp_tx(struct qmp_phy *qphy)
 		drvr_en = 0x10;
 	}
 
-	voltage_swing_cfg = qmp_dp_v3_voltage_swing_hbr_rbr[v_level][p_level];
-	pre_emphasis_cfg = qmp_dp_v3_pre_emphasis_hbr_rbr[v_level][p_level];
+	if (dp_opts->link_rate <= 2700) {
+		voltage_swing_cfg = qmp_dp_v3_voltage_swing_hbr_rbr[v_level][p_level];
+		pre_emphasis_cfg = qmp_dp_v3_pre_emphasis_hbr_rbr[v_level][p_level];
+	} else {
+		voltage_swing_cfg = qmp_dp_v3_voltage_swing_hbr3_hbr2[v_level][p_level];
+		pre_emphasis_cfg = qmp_dp_v3_pre_emphasis_hbr3_hbr2[v_level][p_level];
+	}
 
 	/* TODO: Move check to config check */
 	if (voltage_swing_cfg == 0xFF && pre_emphasis_cfg == 0xFF)
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project
#1 lore raw

Quoting Kuogee Hsieh (2021-02-17 08:58:42)

Quoted 7 lines

Add hbr3_hbr2 voltage and pre-emphasis swing table to support HBR3 link rate

---
 drivers/gpu/drm/msm/dp/dp_panel.c   |  4 ----
 drivers/phy/qualcomm/phy-qcom-qmp.c | 24 ++++++++++++++++++++++--

This spans to subsystems so at least you should run get_maintainers and include phy maintainers. Maybe it should be split into two patches too so it can go via different trees.

Quoted 22 lines
 2 files changed, 22 insertions(+), 6 deletions(-)
drivers/gpu/drm/msm/dp/dp_panel.c +0 -4
index 9cc8166..63112fa 100644
@@ -76,10 +76,6 @@ 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);
-
        DRM_DEBUG_DP("version: %d.%d\n", major, minor);
        DRM_DEBUG_DP("link_rate=%d\n", link_info->rate);
        DRM_DEBUG_DP("lane_count=%d\n", link_info->num_lanes);
drivers/phy/qualcomm/phy-qcom-qmp.c +0 -0
index 0939a9e..cc5ef59 100644

drivers/phy/qualcomm/phy-qcom-qmp.c static void qcom_qmp_phy_dp_aux_init(struct qmp_phy *qphy) · line 2969

Quoted 5 lines
drivers/phy/qualcomm/phy-qcom-qmp.c +2 -0
@@ -2965,6 +2965,21 @@ static void qcom_qmp_phy_dp_aux_init(struct qmp_phy *qphy)
               qphy->pcs + QSERDES_V3_DP_PHY_AUX_INTERRUPT_MASK);
 }
 
+
+static u8 const qmp_dp_v3_pre_emphasis_hbr3_hbr2[4][4] = {

Should be static const u8 qmp_dp...

drivers/phy/qualcomm/phy-qcom-qmp.c static void qcom_qmp_phy_dp_aux_init(struct qmp_phy *qphy) · line 2976

Quoted 7 lines
drivers/phy/qualcomm/phy-qcom-qmp.c +7 -0
+        {0x00, 0x0C, 0x15, 0x1A},
+        {0x02, 0x0E, 0x16, 0xFF},
+        {0x02, 0x11, 0xFF, 0xFF},
+        {0x04, 0xFF, 0xFF, 0xFF}
+};
+
+static u8 const qmp_dp_v3_voltage_swing_hbr3_hbr2[4][4] = {

Same.

drivers/phy/qualcomm/phy-qcom-qmp.c static void qcom_qmp_phy_dp_aux_init(struct qmp_phy *qphy) · line 2977

Quoted 1 line
drivers/phy/qualcomm/phy-qcom-qmp.c +1 -0
+        {0x02, 0x12, 0x16, 0x1A},

Please add a space after { and before } and use lowercase hex to match the qmp_dp_v3_pre_emphasis_hbr_rbr design.

Quoted 11 lines
drivers/phy/qualcomm/phy-qcom-qmp.c +5 -0
+        {0x09, 0x19, 0x1F, 0xFF},
+        {0x10, 0x1F, 0xFF, 0xFF},
+        {0x1F, 0xFF, 0xFF, 0xFF}
+};
+
 static const u8 qmp_dp_v3_pre_emphasis_hbr_rbr[4][4] = {
        { 0x00, 0x0c, 0x14, 0x19 },
        { 0x00, 0x0b, 0x12, 0xff },
@@ -3000,8 +3015,13 @@ static void qcom_qmp_phy_configure_dp_tx(struct qmp_phy *qphy)
                drvr_en = 0x10;
        }

drivers/phy/qualcomm/phy-qcom-qmp.c static void qcom_qmp_phy_configure_dp_tx(struct qmp_phy *qphy) · line 3024

Quoted 10 lines
drivers/phy/qualcomm/phy-qcom-qmp.c +7 -2
 
-       voltage_swing_cfg = qmp_dp_v3_voltage_swing_hbr_rbr[v_level][p_level];
-       pre_emphasis_cfg = qmp_dp_v3_pre_emphasis_hbr_rbr[v_level][p_level];
+       if (dp_opts->link_rate <= 2700) {
+               voltage_swing_cfg = qmp_dp_v3_voltage_swing_hbr_rbr[v_level][p_level];
+               pre_emphasis_cfg = qmp_dp_v3_pre_emphasis_hbr_rbr[v_level][p_level];
+       } else {
+               voltage_swing_cfg = qmp_dp_v3_voltage_swing_hbr3_hbr2[v_level][p_level];
+               pre_emphasis_cfg = qmp_dp_v3_pre_emphasis_hbr3_hbr2[v_level][p_level];
+       }

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

maintainer
#2 lore raw
Quoted 4 lines · Stephen Boyd

Quoting Kuogee Hsieh (2021-02-17 08:58:42)

Quoted 3 lines

Add hbr3_hbr2 voltage and pre-emphasis swing table to support HBR3 link rate

Quoted 8 lines
Quoted 4 lines
---
 drivers/gpu/drm/msm/dp/dp_panel.c   |  4 ----
 drivers/phy/qualcomm/phy-qcom-qmp.c | 24 ++++++++++++++++++++++--

This spans to subsystems so at least you should run get_maintainers and include phy maintainers. Maybe it should be split into two patches too so it can go via different trees.

different patches for different subsytem unless we risk breaking bisect should be general approach...

Quoted 67 lines
Quoted 23 lines
 2 files changed, 22 insertions(+), 6 deletions(-)
drivers/gpu/drm/msm/dp/dp_panel.c +0 -4
index 9cc8166..63112fa 100644
@@ -76,10 +76,6 @@ 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);
-
        DRM_DEBUG_DP("version: %d.%d\n", major, minor);
        DRM_DEBUG_DP("link_rate=%d\n", link_info->rate);
        DRM_DEBUG_DP("lane_count=%d\n", link_info->num_lanes);
drivers/phy/qualcomm/phy-qcom-qmp.c +0 -0
index 0939a9e..cc5ef59 100644

drivers/phy/qualcomm/phy-qcom-qmp.c static void qcom_qmp_phy_dp_aux_init(struct qmp_phy *qphy) · line 2969

Quoted 5 lines
drivers/phy/qualcomm/phy-qcom-qmp.c +2 -0
@@ -2965,6 +2965,21 @@ static void qcom_qmp_phy_dp_aux_init(struct qmp_phy *qphy)
               qphy->pcs + QSERDES_V3_DP_PHY_AUX_INTERRUPT_MASK);
 }
 
+
+static u8 const qmp_dp_v3_pre_emphasis_hbr3_hbr2[4][4] = {

Should be static const u8 qmp_dp...

drivers/phy/qualcomm/phy-qcom-qmp.c static void qcom_qmp_phy_dp_aux_init(struct qmp_phy *qphy) · line 2976

Quoted 7 lines
drivers/phy/qualcomm/phy-qcom-qmp.c +7 -0
+        {0x00, 0x0C, 0x15, 0x1A},
+        {0x02, 0x0E, 0x16, 0xFF},
+        {0x02, 0x11, 0xFF, 0xFF},
+        {0x04, 0xFF, 0xFF, 0xFF}
+};
+
+static u8 const qmp_dp_v3_voltage_swing_hbr3_hbr2[4][4] = {

Same.

drivers/phy/qualcomm/phy-qcom-qmp.c static void qcom_qmp_phy_dp_aux_init(struct qmp_phy *qphy) · line 2977

Quoted 1 line
drivers/phy/qualcomm/phy-qcom-qmp.c +1 -0
+        {0x02, 0x12, 0x16, 0x1A},

Please add a space after { and before } and use lowercase hex to match the qmp_dp_v3_pre_emphasis_hbr_rbr design.

Quoted 21 lines
drivers/phy/qualcomm/phy-qcom-qmp.c +12 -2
+        {0x09, 0x19, 0x1F, 0xFF},
+        {0x10, 0x1F, 0xFF, 0xFF},
+        {0x1F, 0xFF, 0xFF, 0xFF}
+};
+
 static const u8 qmp_dp_v3_pre_emphasis_hbr_rbr[4][4] = {
        { 0x00, 0x0c, 0x14, 0x19 },
        { 0x00, 0x0b, 0x12, 0xff },
@@ -3000,8 +3015,13 @@ static void qcom_qmp_phy_configure_dp_tx(struct qmp_phy *qphy)
                drvr_en = 0x10;
        }
 
-       voltage_swing_cfg = qmp_dp_v3_voltage_swing_hbr_rbr[v_level][p_level];
-       pre_emphasis_cfg = qmp_dp_v3_pre_emphasis_hbr_rbr[v_level][p_level];
+       if (dp_opts->link_rate <= 2700) {
+               voltage_swing_cfg = qmp_dp_v3_voltage_swing_hbr_rbr[v_level][p_level];
+               pre_emphasis_cfg = qmp_dp_v3_pre_emphasis_hbr_rbr[v_level][p_level];
+       } else {
+               voltage_swing_cfg = qmp_dp_v3_voltage_swing_hbr3_hbr2[v_level][p_level];
+               pre_emphasis_cfg = qmp_dp_v3_pre_emphasis_hbr3_hbr2[v_level][p_level];
+       }
Signature · 5 lines
~Vinod
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel