Skip to content

Commit 2884364

Browse files
Timur Kristófgregkh
authored andcommitted
drm/amd/display: Turn off DAC in DCE link encoder using VBIOS
[ Upstream commit e021ee9 ] 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: 0fbe321 ("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>
1 parent aeafffb commit 2884364

2 files changed

Lines changed: 17 additions & 16 deletions

File tree

drivers/gpu/drm/amd/display/dc/dce/dce_link_encoder.c

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,21 @@ static enum bp_result link_transmitter_control(
131131
return result;
132132
}
133133

134+
static enum bp_result link_dac_encoder_control(
135+
struct dce110_link_encoder *link_enc,
136+
enum bp_encoder_control_action action,
137+
uint32_t pix_clk_100hz)
138+
{
139+
struct dc_bios *bios = link_enc->base.ctx->dc_bios;
140+
struct bp_encoder_control encoder_control = {0};
141+
142+
encoder_control.action = action;
143+
encoder_control.engine_id = link_enc->base.analog_engine;
144+
encoder_control.pixel_clock = pix_clk_100hz / 10;
145+
146+
return bios->funcs->encoder_control(bios, &encoder_control);
147+
}
148+
134149
static void enable_phy_bypass_mode(
135150
struct dce110_link_encoder *enc110,
136151
bool enable)
@@ -1337,19 +1352,8 @@ void dce110_link_encoder_disable_output(
13371352
struct bp_transmitter_control cntl = { 0 };
13381353
enum bp_result result;
13391354

1340-
switch (enc->analog_engine) {
1341-
case ENGINE_ID_DACA:
1342-
REG_UPDATE(DAC_ENABLE, DAC_ENABLE, 0);
1343-
break;
1344-
case ENGINE_ID_DACB:
1345-
/* DACB doesn't seem to be present on DCE6+,
1346-
* although there are references to it in the register file.
1347-
*/
1348-
DC_LOG_ERROR("%s DACB is unsupported\n", __func__);
1349-
break;
1350-
default:
1351-
break;
1352-
}
1355+
if (enc->analog_engine != ENGINE_ID_UNKNOWN)
1356+
link_dac_encoder_control(enc110, ENCODER_CONTROL_DISABLE, 0);
13531357

13541358
/* The code below only applies to connectors that support digital signals. */
13551359
if (enc->transmitter == TRANSMITTER_UNKNOWN)

drivers/gpu/drm/amd/display/dc/hwss/dce110/dce110_hwseq.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1218,9 +1218,6 @@ void dce110_disable_stream(struct pipe_ctx *pipe_ctx)
12181218
dccg->funcs->disable_symclk_se(dccg, stream_enc->stream_enc_inst,
12191219
link_enc->transmitter - TRANSMITTER_UNIPHY_A);
12201220
}
1221-
1222-
if (dc_is_rgb_signal(pipe_ctx->stream->signal))
1223-
dce110_dac_encoder_control(pipe_ctx, false);
12241221
}
12251222

12261223
void dce110_unblank_stream(struct pipe_ctx *pipe_ctx,

0 commit comments

Comments
 (0)