Skip to content

Commit e2a0243

Browse files
Timur Kristófalexdeucher
authored andcommitted
drm/amd/display: Initialize DAC in DCE link encoder using VBIOS
The VBIOS DAC1EncoderControl() function can initialize the DAC, by writing board-specific values to certain registers. Call this at link encoder hardware initialization time similarly to how the equivalent UNIPHYTransmitterControl initialization is done. This fixes DAC output on the Radeon HD 7790. Also remove the ENCODER_CONTROL_SETUP enum from the dac_encoder_control_prepare_params function which is actually not a supported operation for DAC encoders. 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 e021ee9 commit e2a0243

2 files changed

Lines changed: 11 additions & 2 deletions

File tree

drivers/gpu/drm/amd/display/dc/bios/command_table.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1874,8 +1874,7 @@ static void dac_encoder_control_prepare_params(
18741874
uint8_t dac_standard)
18751875
{
18761876
params->ucDacStandard = dac_standard;
1877-
if (action == ENCODER_CONTROL_SETUP ||
1878-
action == ENCODER_CONTROL_INIT)
1877+
if (action == ENCODER_CONTROL_INIT)
18791878
params->ucAction = ATOM_ENCODER_INIT;
18801879
else if (action == ENCODER_CONTROL_ENABLE)
18811880
params->ucAction = ATOM_ENABLE;

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1036,6 +1036,16 @@ void dce110_link_encoder_hw_init(
10361036
cntl.coherent = false;
10371037
cntl.hpd_sel = enc110->base.hpd_source;
10381038

1039+
if (enc110->base.analog_engine != ENGINE_ID_UNKNOWN) {
1040+
result = link_dac_encoder_control(enc110, ENCODER_CONTROL_INIT, 0);
1041+
if (result != BP_RESULT_OK) {
1042+
DC_LOG_ERROR("%s: Failed to execute VBIOS command table for DAC!\n",
1043+
__func__);
1044+
BREAK_TO_DEBUGGER();
1045+
return;
1046+
}
1047+
}
1048+
10391049
/* The code below is only applicable to encoders with a digital transmitter. */
10401050
if (enc110->base.transmitter == TRANSMITTER_UNKNOWN)
10411051
return;

0 commit comments

Comments
 (0)