]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
drm/amd/display: Find link encoder for flexible DIG mapping cases
authorOvidiu Bunea <ovidiu.bunea@amd.com>
Fri, 17 Apr 2026 19:11:12 +0000 (15:11 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 5 May 2026 13:56:52 +0000 (09:56 -0400)
[why & how]
link->link_enc can only be used to identify the link's link encoder
when the link is not permitted to use flexible link encoder
assignments.

Use the correct function for identifying link encoder and add
function pointer guards before calling them.

Reviewed-by: Wenjing Liu <wenjing.liu@amd.com>
Signed-off-by: Ovidiu Bunea <ovidiu.bunea@amd.com>
Signed-off-by: James Lin <pinglei.lin@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/hwss/dce110/dce110_hwseq.c

index 921e70c143467d6a51dd73630bb4d07f57d32050..d81271b870bb2be954717acc319badacba173420 100644 (file)
@@ -1787,20 +1787,22 @@ static void power_down_encoders(struct dc *dc)
 
        for (i = 0; i < dc->link_count; i++) {
                struct dc_link *link = dc->links[i];
-               struct link_encoder *link_enc = link->link_enc;
+               struct link_encoder *link_enc = link_enc_cfg_get_link_enc(link);
                enum signal_type signal = link->connector_signal;
 
                dc->link_srv->blank_dp_stream(link, false);
                if (signal != SIGNAL_TYPE_EDP)
                        signal = SIGNAL_TYPE_NONE;
 
-               if (link->ep_type == DISPLAY_ENDPOINT_PHY)
+               if (link->ep_type == DISPLAY_ENDPOINT_PHY && link_enc)
                        link_enc->funcs->disable_output(link_enc, signal);
 
                if (link->fec_state == dc_link_fec_enabled) {
-                       link_enc->funcs->fec_set_enable(link_enc, false);
-                       link_enc->funcs->fec_set_ready(link_enc, false);
-                       link->fec_state = dc_link_fec_not_ready;
+                       if (link_enc && link_enc->funcs->fec_set_enable && link_enc->funcs->fec_set_ready) {
+                               link_enc->funcs->fec_set_enable(link_enc, false);
+                               link_enc->funcs->fec_set_ready(link_enc, false);
+                               link->fec_state = dc_link_fec_not_ready;
+                       }
                }
 
                link->link_status.link_active = false;