drm/amd/display: rename lane_settings to hw_lane_settings
authorWenjing Liu <wenjing.liu@amd.com>
Sun, 12 Sep 2021 03:06:31 +0000 (23:06 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 21 Jun 2022 22:17:23 +0000 (18:17 -0400)
[why]
This is one of the major steps to decouple hw lane settings
from dpcd lane settings.

Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Reviewed-by: Jun Lei <Jun.Lei@amd.com>
Acked-by: Alan Liu <HaoPing.Liu@amd.com>
Signed-off-by: Wenjing Liu <wenjing.liu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c
drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c
drivers/gpu/drm/amd/display/dc/core/dc_link_dpia.c
drivers/gpu/drm/amd/display/include/link_service_types.h

index c7a592d..4d5824e 100644 (file)
@@ -540,11 +540,11 @@ static ssize_t dp_phy_settings_write(struct file *f, const char __user *buf,
 
        /* apply phy settings from user */
        for (r = 0; r < link_lane_settings.link_settings.lane_count; r++) {
-               link_lane_settings.lane_settings[r].VOLTAGE_SWING =
+               link_lane_settings.hw_lane_settings[r].VOLTAGE_SWING =
                                (enum dc_voltage_swing) (param[0]);
-               link_lane_settings.lane_settings[r].PRE_EMPHASIS =
+               link_lane_settings.hw_lane_settings[r].PRE_EMPHASIS =
                                (enum dc_pre_emphasis) (param[1]);
-               link_lane_settings.lane_settings[r].POST_CURSOR2 =
+               link_lane_settings.hw_lane_settings[r].POST_CURSOR2 =
                                (enum dc_post_cursor2) (param[2]);
        }
 
@@ -738,7 +738,7 @@ static ssize_t dp_phy_test_pattern_debugfs_write(struct file *f, const char __us
        }
 
        for (i = 0; i < (unsigned int)(link_training_settings.link_settings.lane_count); i++)
-               link_training_settings.lane_settings[i] = link->cur_lane_setting[i];
+               link_training_settings.hw_lane_settings[i] = link->cur_lane_setting[i];
 
        dc_link_set_test_pattern(
                link,
index 9f873d2..dfee3ba 100644 (file)
@@ -1660,15 +1660,15 @@ static void override_training_settings(
                lt_settings->always_match_dpcd_with_hw_lane_settings = false;
        }
        for (lane = 0; lane < LANE_COUNT_DP_MAX; lane++) {
-               lt_settings->lane_settings[lane].VOLTAGE_SWING =
+               lt_settings->hw_lane_settings[lane].VOLTAGE_SWING =
                        lt_settings->voltage_swing != NULL ?
                        *lt_settings->voltage_swing :
                        VOLTAGE_SWING_LEVEL0;
-               lt_settings->lane_settings[lane].PRE_EMPHASIS =
+               lt_settings->hw_lane_settings[lane].PRE_EMPHASIS =
                        lt_settings->pre_emphasis != NULL ?
                        *lt_settings->pre_emphasis
                        : PRE_EMPHASIS_DISABLED;
-               lt_settings->lane_settings[lane].POST_CURSOR2 =
+               lt_settings->hw_lane_settings[lane].POST_CURSOR2 =
                        lt_settings->post_cursor2 != NULL ?
                        *lt_settings->post_cursor2
                        : POST_CURSOR2_DISABLED;
@@ -1935,8 +1935,8 @@ static void print_status_message(
                                link_rate,
                                lt_settings->link_settings.lane_count,
                                lt_result,
-                               lt_settings->lane_settings[0].VOLTAGE_SWING,
-                               lt_settings->lane_settings[0].PRE_EMPHASIS,
+                               lt_settings->hw_lane_settings[0].VOLTAGE_SWING,
+                               lt_settings->hw_lane_settings[0].PRE_EMPHASIS,
                                lt_spread);
 }
 
index 1b7a877..a29ebd9 100644 (file)
@@ -177,13 +177,13 @@ static uint8_t dpia_build_set_config_data(enum dpia_set_config_type type,
                break;
        case DPIA_SET_CFG_SET_VSPE:
                /* Assume all lanes have same drive settings. */
-               data.set_vspe.swing = lt_settings->lane_settings[0].VOLTAGE_SWING;
-               data.set_vspe.pre_emph = lt_settings->lane_settings[0].PRE_EMPHASIS;
+               data.set_vspe.swing = lt_settings->hw_lane_settings[0].VOLTAGE_SWING;
+               data.set_vspe.pre_emph = lt_settings->hw_lane_settings[0].PRE_EMPHASIS;
                data.set_vspe.max_swing_reached =
-                       lt_settings->lane_settings[0].VOLTAGE_SWING ==
+                       lt_settings->hw_lane_settings[0].VOLTAGE_SWING ==
                        VOLTAGE_SWING_MAX_LEVEL ? 1 : 0;
                data.set_vspe.max_pre_emph_reached =
-                       lt_settings->lane_settings[0].PRE_EMPHASIS ==
+                       lt_settings->hw_lane_settings[0].PRE_EMPHASIS ==
                        PRE_EMPHASIS_MAX_LEVEL ? 1 : 0;
                break;
        default:
@@ -405,7 +405,7 @@ static enum link_training_result dpia_training_cr_non_transparent(
 
                /* Update VS/PE. */
                dp_decide_lane_settings(lt_settings, dpcd_lane_adjust,
-                               lt_settings->lane_settings,
+                               lt_settings->hw_lane_settings,
                                lt_settings->dpcd_lane_settings);
                retry_count++;
        }
index 23f7d73..79fabc5 100644 (file)
@@ -94,7 +94,6 @@ struct link_training_settings {
        /* TODO: turn lane settings below into mandatory fields
         * as initial lane configuration
         */
-       struct dc_lane_settings lane_settings[LANE_COUNT_DP_MAX];
        enum dc_voltage_swing *voltage_swing;
        enum dc_pre_emphasis *pre_emphasis;
        enum dc_post_cursor2 *post_cursor2;