]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/amd/display: Link detection for external DP bridge encoders
authorTimur Kristóf <timur.kristof@gmail.com>
Mon, 26 Jan 2026 21:08:34 +0000 (22:08 +0100)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 23 Feb 2026 19:28:32 +0000 (14:28 -0500)
Deal with some minor idiosyncracies of TRAVIS and NUTMEG chips.

- Always use DP signal type with these chips so that the
  normal DP code paths can work with them without a major
  refactor of the code base. Properly set this.

- NUTMEG seems to only work with HBR, not RBR, so set a
  preferred link rate for this chip.
  See amdgpu_atombios_dp_get_dp_link_config() for reference.

- NUTMEG is recognized as a DP branch device but reports 0 sinks,
  which is wrong and confuses DC (it hits an early return).
  Fix that by hardcoding the sink count to 1.

- Fixup old DC code selecting a special panel mode necessary
  for NUTMEG and TRAVIS.

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/link_detection.c
drivers/gpu/drm/amd/display/dc/link/protocols/link_edp_panel_control.c

index 2d1f3d13c1773b92636dc18df911835c003efcea..d0bb26888f4b1edc74440406ec868c1fa1016c18 100644 (file)
@@ -150,14 +150,6 @@ static enum signal_type get_basic_signal_type(struct graphics_object_id encoder,
                default:
                        return SIGNAL_TYPE_NONE;
                }
-       } else if (downstream.type == OBJECT_TYPE_ENCODER) {
-               switch (downstream.id) {
-               case ENCODER_ID_EXTERNAL_NUTMEG:
-               case ENCODER_ID_EXTERNAL_TRAVIS:
-                       return SIGNAL_TYPE_DISPLAY_PORT;
-               default:
-                       return SIGNAL_TYPE_NONE;
-               }
        }
 
        return SIGNAL_TYPE_NONE;
@@ -174,6 +166,10 @@ static enum signal_type link_detect_sink_signal_type(struct dc_link *link,
        struct audio_support *aud_support;
        struct graphics_object_id enc_id;
 
+       /* External DP bridges should use DP signal regardless of connector type. */
+       if (link->ext_enc_id.id)
+               return SIGNAL_TYPE_DISPLAY_PORT;
+
        if (link->is_dig_mapping_flexible)
                enc_id = (struct graphics_object_id){.id = ENCODER_ID_UNKNOWN};
        else
@@ -620,6 +616,14 @@ static bool detect_dp(struct dc_link *link,
                link->dpcd_caps.usb4_dp_tun_info.dp_tun_cap.raw = 0;
        }
 
+       if (link->ext_enc_id.id) {
+               /* Fix number of connected sinks reported by external DP bridge */
+               link->dpcd_caps.sink_count.bits.SINK_COUNT = 1;
+               /* NUTMEG requires that we use HBR, doesn't work with RBR. */
+               if (link->dpcd_caps.branch_dev_id == DP_BRANCH_DEVICE_ID_00001A)
+                       link->preferred_link_setting.link_rate = LINK_RATE_HIGH;
+       }
+
        return true;
 }
 
index aa02b38e183aa76bd4f871bb1cb688a3a5878d94..5b2c1a4911cf0d542190b16a496d4ec667bfa021 100644 (file)
@@ -100,11 +100,7 @@ void dp_set_panel_mode(struct dc_link *link, enum dp_panel_mode panel_mode)
 
 enum dp_panel_mode dp_get_panel_mode(struct dc_link *link)
 {
-       /* We need to explicitly check that connector
-        * is not DP. Some Travis_VGA get reported
-        * by video bios as DP.
-        */
-       if (link->connector_signal != SIGNAL_TYPE_DISPLAY_PORT) {
+       if (link->ext_enc_id.id) {
 
                switch (link->dpcd_caps.branch_dev_id) {
                case DP_BRANCH_DEVICE_ID_0022B9:
@@ -124,7 +120,7 @@ enum dp_panel_mode dp_get_panel_mode(struct dc_link *link)
                        }
                        break;
                case DP_BRANCH_DEVICE_ID_00001A:
-                       /* alternate scrambler reset is required for Travis
+                       /* alternate scrambler reset is required for NUTMEG
                         * for the case when external chip does not provide
                         * sink device id, alternate scrambler scheme will
                         * be overriden later by querying Encoder feature