]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/amd/display: Implement DAC load detection on external DP bridge encoders
authorTimur Kristóf <timur.kristof@gmail.com>
Mon, 26 Jan 2026 21:08:36 +0000 (22:08 +0100)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 23 Feb 2026 19:28:32 +0000 (14:28 -0500)
Use the pre-existing implementation in the BIOS parser, but call
the ExternalEncoderControl function for external encoders instead
of the built-in DAC load detection function.

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/bios/bios_parser.c
drivers/gpu/drm/amd/display/dc/dc_bios_types.h
drivers/gpu/drm/amd/display/dc/hwss/dce110/dce110_hwseq.c

index f947f82013c66616396d45eb4caac337c8b6e617..242032c047edf6b00bdba4b4c551afa591304d9e 100644 (file)
@@ -794,11 +794,13 @@ static enum bp_result bios_parser_external_encoder_control(
 
 static enum bp_result bios_parser_dac_load_detection(
        struct dc_bios *dcb,
-       enum engine_id engine_id)
+       enum engine_id engine_id,
+       struct graphics_object_id ext_enc_id)
 {
        struct bios_parser *bp = BP_FROM_DCB(dcb);
        struct dc_context *ctx = dcb->ctx;
        struct bp_load_detection_parameters bp_params = {0};
+       struct bp_external_encoder_control ext_cntl = {0};
        enum bp_result bp_result = BP_RESULT_UNSUPPORTED;
        uint32_t bios_0_scratch;
        uint32_t device_id_mask = 0;
@@ -824,6 +826,13 @@ static enum bp_result bios_parser_dac_load_detection(
 
                bp_params.engine_id = engine_id;
                bp_result = bp->cmd_tbl.dac_load_detection(bp, &bp_params);
+       } else if (ext_enc_id.id) {
+               if (!bp->cmd_tbl.external_encoder_control)
+                       return BP_RESULT_UNSUPPORTED;
+
+               ext_cntl.action = EXTERNAL_ENCODER_CONTROL_DAC_LOAD_DETECT;
+               ext_cntl.encoder_id = ext_enc_id;
+               bp_result = bp->cmd_tbl.external_encoder_control(bp, &ext_cntl);
        }
 
        if (bp_result != BP_RESULT_OK)
index 6f96c5cf39fe8dc096cb20a6e91b9074ab77cb6b..526f71616f94b8b9b9c2b55c72ee60be61d444e5 100644 (file)
@@ -102,7 +102,8 @@ struct dc_vbios_funcs {
                struct bp_external_encoder_control *cntl);
        enum bp_result (*dac_load_detection)(
                struct dc_bios *bios,
-               enum engine_id engine_id);
+               enum engine_id engine_id,
+               struct graphics_object_id ext_enc_id);
        enum bp_result (*transmitter_control)(
                struct dc_bios *bios,
                struct bp_transmitter_control *cntl);
index 3313acf5755350b8a66e5c2571af1d7a89a99a12..8aafd460c36fd71eeeedcb3170fbe07e991b7ce3 100644 (file)
@@ -709,7 +709,8 @@ dce110_dac_load_detect(struct dc_link *link)
        struct link_encoder *link_enc = link->link_enc;
        enum bp_result bp_result;
 
-       bp_result = bios->funcs->dac_load_detection(bios, link_enc->analog_engine);
+       bp_result = bios->funcs->dac_load_detection(
+                       bios, link_enc->analog_engine, link->ext_enc_id);
        return bp_result == BP_RESULT_OK;
 }