]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
drm/amd/display: Turn off DAC in DCE link encoder using VBIOS
authorTimur Kristóf <timur.kristof@gmail.com>
Mon, 2 Feb 2026 11:25:04 +0000 (12:25 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 26 Feb 2026 23:01:38 +0000 (15:01 -0800)
[ Upstream commit e021ee995056ee7e58114edd92bcd4578d8b4bb5 ]

Apparently, the VBIOS DAC1EncoderControl function is much more
graceful about turning off the DAC. It writes various DAC
registers in a specific sequence. Use that instead of just
clearing the DAC_ENABLE register.

Do this in just the dce110_link_encoder_disable_output
function and remove it from the HWSS.

Fixes: 0fbe321a93ce ("drm/amd/display: Implement DCE analog link encoders (v2)")
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Tested-by: Mauro Rossi <issor.oruam@gmail.com>
Suggested-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Alex Hung <alex.hung@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/amd/display/dc/dce/dce_link_encoder.c
drivers/gpu/drm/amd/display/dc/hwss/dce110/dce110_hwseq.c

index 5c1a10f77733a5b4523b3a0ac33d49d627f0b1fd..2e742950a62c7b06ff9fe1df2368eacc9896ab5f 100644 (file)
@@ -131,6 +131,21 @@ static enum bp_result link_transmitter_control(
        return result;
 }
 
+static enum bp_result link_dac_encoder_control(
+       struct dce110_link_encoder *link_enc,
+       enum bp_encoder_control_action action,
+       uint32_t pix_clk_100hz)
+{
+       struct dc_bios *bios = link_enc->base.ctx->dc_bios;
+       struct bp_encoder_control encoder_control = {0};
+
+       encoder_control.action = action;
+       encoder_control.engine_id = link_enc->base.analog_engine;
+       encoder_control.pixel_clock = pix_clk_100hz / 10;
+
+       return bios->funcs->encoder_control(bios, &encoder_control);
+}
+
 static void enable_phy_bypass_mode(
        struct dce110_link_encoder *enc110,
        bool enable)
@@ -1337,19 +1352,8 @@ void dce110_link_encoder_disable_output(
        struct bp_transmitter_control cntl = { 0 };
        enum bp_result result;
 
-       switch (enc->analog_engine) {
-       case ENGINE_ID_DACA:
-               REG_UPDATE(DAC_ENABLE, DAC_ENABLE, 0);
-               break;
-       case ENGINE_ID_DACB:
-               /* DACB doesn't seem to be present on DCE6+,
-                * although there are references to it in the register file.
-                */
-               DC_LOG_ERROR("%s DACB is unsupported\n", __func__);
-               break;
-       default:
-               break;
-       }
+       if (enc->analog_engine != ENGINE_ID_UNKNOWN)
+               link_dac_encoder_control(enc110, ENCODER_CONTROL_DISABLE, 0);
 
        /* The code below only applies to connectors that support digital signals. */
        if (enc->transmitter == TRANSMITTER_UNKNOWN)
index ebd74b43e935eeab6333e77238ca98dcaad80e96..fd41e52e4d2f121f130864438de20a9699ba7919 100644 (file)
@@ -1218,9 +1218,6 @@ void dce110_disable_stream(struct pipe_ctx *pipe_ctx)
                dccg->funcs->disable_symclk_se(dccg, stream_enc->stream_enc_inst,
                                               link_enc->transmitter - TRANSMITTER_UNIPHY_A);
        }
-
-       if (dc_is_rgb_signal(pipe_ctx->stream->signal))
-               dce110_dac_encoder_control(pipe_ctx, false);
 }
 
 void dce110_unblank_stream(struct pipe_ctx *pipe_ctx,