]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/amd/display: Use preferred DP link rate if specified
authorTimur Kristóf <timur.kristof@gmail.com>
Mon, 26 Jan 2026 21:08:32 +0000 (22:08 +0100)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 23 Feb 2026 19:28:32 +0000 (14:28 -0500)
The DisplayPort code already has the concept of preferred link
settings, but it only allows setting a preferred lane count and
link width at the same time. It does not consider the possiblity
that some devices may not work on lower link rates but may
support various lane counts.

Allow specifying a preferred link rate which will be used as
the initial link rate when deciding the DP link settings.

This is necessary to support NUTMEG which only works with HBR
but not with RBR.

For reference, see the legacy non-DC amdgpu display code:
amdgpu_atombios_dp_get_dp_link_config()

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Alex Hung <alex.hung@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_capability.c

index cdc7587cf0b6826544abf1674e83ef46d78563c8..e12bf3dd3e464d346db0f4fd9ebd83c6a760e838 100644 (file)
@@ -743,6 +743,8 @@ 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;