Skip to content

Commit e021ee9

Browse files
Timur Kristófalexdeucher
authored andcommitted
drm/amd/display: Turn off DAC in DCE link encoder using VBIOS
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>
1 parent 613b173 commit e021ee9

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
@@ -133,6 +133,21 @@ static enum bp_result link_transmitter_control(
133133
return result;
134134
}
135135

136+
static enum bp_result link_dac_encoder_control(
137+
struct dce110_link_encoder *link_enc,
138+
enum bp_encoder_control_action action,
139+
uint32_t pix_clk_100hz)
140+
{
141+
struct dc_bios *bios = link_enc->base.ctx->dc_bios;
142+
struct bp_encoder_control encoder_control = {0};
143+
144+
encoder_control.action = action;
145+
encoder_control.engine_id = link_enc->base.analog_engine;
146+
encoder_control.pixel_clock = pix_clk_100hz / 10;
147+
148+
return bios->funcs->encoder_control(bios, &encoder_control);
149+
}
150+
136151
static void enable_phy_bypass_mode(
137152
struct dce110_link_encoder *enc110,
138153
bool enable)
@@ -1345,19 +1360,8 @@ void dce110_link_encoder_disable_output(
13451360
struct bp_transmitter_control cntl = { 0 };
13461361
enum bp_result result;
13471362

1348-
switch (enc->analog_engine) {
1349-
case ENGINE_ID_DACA:
1350-
REG_UPDATE(DAC_ENABLE, DAC_ENABLE, 0);
1351-
break;
1352-
case ENGINE_ID_DACB:
1353-
/* DACB doesn't seem to be present on DCE6+,
1354-
* although there are references to it in the register file.
1355-
*/
1356-
DC_LOG_ERROR("%s DACB is unsupported\n", __func__);
1357-
break;
1358-
default:
1359-
break;
1360-
}
1363+
if (enc->analog_engine != ENGINE_ID_UNKNOWN)
1364+
link_dac_encoder_control(enc110, ENCODER_CONTROL_DISABLE, 0);
13611365

13621366
/* The code below only applies to connectors that support digital signals. */
13631367
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
@@ -1199,9 +1199,6 @@ void dce110_disable_stream(struct pipe_ctx *pipe_ctx)
11991199
dccg->funcs->disable_symclk_se(dccg, stream_enc->stream_enc_inst,
12001200
link_enc->transmitter - TRANSMITTER_UNIPHY_A);
12011201
}
1202-
1203-
if (dc_is_rgb_signal(pipe_ctx->stream->signal))
1204-
dce110_dac_encoder_control(pipe_ctx, false);
12051202
}
12061203

12071204
void dce110_unblank_stream(struct pipe_ctx *pipe_ctx,

0 commit comments

Comments
 (0)