]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/amd/display: Use external DP bridge encoders
authorTimur Kristóf <timur.kristof@gmail.com>
Mon, 26 Jan 2026 21:08:35 +0000 (22:08 +0100)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 23 Feb 2026 19:28:32 +0000 (14:28 -0500)
Implement link creation for external DP bridge encoders
such as NUTMEG and TRAVIS used with CIK APUs such as
Kaveri for supporting analog and LVDS connections.
Typically found in CIK APU based laptops or on FM2
motherboards that have analog connectors.

When we query connector information from the VBIOS and
discover a connector using such an encoder, let's find the
real DisplayPort encoder and use that. Set the connector
signal type to DP, so the pre-existing DP code paths can
work with it without refactoring every signal type check
in the DC code base.

In the DM, make sure to report correct connector type and
also to initialize DP specifics such as the AUX channel.

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/amdgpu_dm/amdgpu_dm.c
drivers/gpu/drm/amd/display/dc/link/link_factory.c

index e19ac0429299ffb3c7cb759d34605c97e16e3cc6..55e875806ee74b578229c25d6715600ac7ebb51c 100644 (file)
@@ -8483,6 +8483,12 @@ static int to_drm_connector_type(enum signal_type st, uint32_t connector_id)
                return DRM_MODE_CONNECTOR_VGA;
        case SIGNAL_TYPE_DISPLAY_PORT:
        case SIGNAL_TYPE_DISPLAY_PORT_MST:
+               /* External DP bridges have a different connector type. */
+               if (connector_id == CONNECTOR_ID_VGA)
+                       return DRM_MODE_CONNECTOR_VGA;
+               else if (connector_id == CONNECTOR_ID_LVDS)
+                       return DRM_MODE_CONNECTOR_LVDS;
+
                return DRM_MODE_CONNECTOR_DisplayPort;
        case SIGNAL_TYPE_DVI_DUAL_LINK:
        case SIGNAL_TYPE_DVI_SINGLE_LINK:
@@ -9155,8 +9161,7 @@ static int amdgpu_dm_connector_init(struct amdgpu_display_manager *dm,
            connector_type == DRM_MODE_CONNECTOR_HDMIB)
                amdgpu_dm_initialize_hdmi_connector(aconnector);
 
-       if (connector_type == DRM_MODE_CONNECTOR_DisplayPort
-               || connector_type == DRM_MODE_CONNECTOR_eDP)
+       if (dc_is_dp_signal(link->connector_signal))
                amdgpu_dm_initialize_dp_connector(dm, aconnector, link->link_index);
 
 out_free:
index 21815ad01a295164733050588148b71c812bad10..7e7682d7dfc834700641bd8cdfbabf372195cfcd 100644 (file)
@@ -367,6 +367,18 @@ static enum transmitter translate_encoder_to_transmitter(
        }
 }
 
+static bool encoder_is_external_dp(
+               struct graphics_object_id encoder)
+{
+       switch (encoder.id) {
+       case ENCODER_ID_EXTERNAL_NUTMEG:
+       case ENCODER_ID_EXTERNAL_TRAVIS:
+               return true;
+       default:
+               return false;
+       }
+}
+
 static void link_destruct(struct dc_link *link)
 {
        int i;
@@ -514,6 +526,13 @@ static bool construct_phy(struct dc_link *link,
         * so that we avoid initializing DDC and HPD, etc.
         */
        bp_funcs->get_src_obj(bios, link->link_id, 0, &link_encoder);
+
+       if (encoder_is_external_dp(link_encoder)) {
+               /* External DP bridge encoders: find the actual link encoder and use that. */
+               link->ext_enc_id = link_encoder;
+               bp_funcs->get_src_obj(bios, link->ext_enc_id, 0, &link_encoder);
+       }
+
        transmitter_from_encoder = translate_encoder_to_transmitter(link_encoder);
        link_analog_engine = find_analog_engine(link, &enc_init_data.analog_encoder);
 
@@ -691,6 +710,13 @@ static bool construct_phy(struct dc_link *link,
                goto create_fail;
        }
 
+       /* For external DP bridge encoders:
+        * Set the connector signal to DisplayPort so that they can work with
+        * the pre-existing code paths for DP without a lot of code churn.
+        */
+       if (link->ext_enc_id.id != ENCODER_ID_UNKNOWN)
+               link->connector_signal = SIGNAL_TYPE_DISPLAY_PORT;
+
        LINK_INFO("Connector[%d] description: signal: %s\n",
                  init_params->connector_index,
                  signal_type_to_string(link->connector_signal));
@@ -735,7 +761,8 @@ static bool construct_phy(struct dc_link *link,
                                                      link->device_tag.dev_id))
                        continue;
                if (link->device_tag.dev_id.device_type == DEVICE_TYPE_CRT &&
-                   link->connector_signal != SIGNAL_TYPE_RGB)
+                   link->connector_signal != SIGNAL_TYPE_RGB &&
+                   link->ext_enc_id.id == ENCODER_ID_UNKNOWN)
                        continue;
                if (link->device_tag.dev_id.device_type == DEVICE_TYPE_LCD &&
                    link->connector_signal == SIGNAL_TYPE_RGB)