]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
drm/amd/display: Fix coding style issue
authorChuanyu Tseng <Chuanyu.Tseng@amd.com>
Sat, 28 Mar 2026 00:13:49 +0000 (08:13 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 17 Apr 2026 19:21:47 +0000 (15:21 -0400)
[Why & How]
Function logic should put after variable declare section, so let's move it.

Reviewed-by: Aurabindo Pillai <aurabindo.pillai@amd.com>
Signed-off-by: Chuanyu Tseng <Chuanyu.Tseng@amd.com>
Signed-off-by: Roman Li <roman.li@amd.com>
Tested-by: Dan Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_capability.c

index e12bf3dd3e464d346db0f4fd9ebd83c6a760e838..782a45caa13d4a1fe82390adb23b40958b76f615 100644 (file)
@@ -743,8 +743,6 @@ static bool decide_dp_link_settings(struct dc_link *link, struct dc_link_setting
 {
        struct dc_link_settings initial_link_setting = {
                LANE_COUNT_ONE, LINK_RATE_LOW, LINK_SPREAD_DISABLED, false, 0};
-       if (link->preferred_link_setting.link_rate != LINK_RATE_UNKNOWN)
-               initial_link_setting.link_rate = link->preferred_link_setting.link_rate;
        struct dc_link_settings current_link_setting =
                        initial_link_setting;
        uint32_t link_bw;
@@ -752,6 +750,9 @@ static bool decide_dp_link_settings(struct dc_link *link, struct dc_link_setting
        if (req_bw > dp_link_bandwidth_kbps(link, &link->verified_link_cap))
                return false;
 
+       if (link->preferred_link_setting.link_rate != LINK_RATE_UNKNOWN)
+               initial_link_setting.link_rate = link->preferred_link_setting.link_rate;
+
        /* search for the minimum link setting that:
         * 1. is supported according to the link training result
         * 2. could support the b/w requested by the timing