Skip to content

Commit 53841c4

Browse files
Timur Kristófgregkh
authored andcommitted
drm/amd/display: Initialize DAC in DCE link encoder using VBIOS
[ Upstream commit e2a0243 ] 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> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 2884364 commit 53841c4

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
@@ -1033,6 +1033,16 @@ void dce110_link_encoder_hw_init(
10331033
cntl.coherent = false;
10341034
cntl.hpd_sel = enc110->base.hpd_source;
10351035

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

0 commit comments

Comments
 (0)