AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Timur Kristóf" <timur.kristof@gmail.com>
To: amd-gfx@lists.freedesktop.org, Alexander.Deucher@amd.com,
	Mario Limonciello <mario.limonciello@amd.com>,
	Ivan Lipski <ivan.lipski@amd.com>,
	harry.wentland@amd.com, Alex Hung <alex.hung@amd.com>,
	Ray Wu <Ray.Wu@amd.com>,
	siqueira@igalia.com, Mauro Rossi <issor.oruam@gmail.com>
Cc: "Timur Kristóf" <timur.kristof@gmail.com>,
	"Alex Deucher" <alexander.deucher@amd.com>
Subject: [PATCH 5/8] drm/amd/display: Initialize DAC in DCE link encoder using VBIOS
Date: Mon,  2 Feb 2026 12:25:05 +0100	[thread overview]
Message-ID: <20260202112508.43000-6-timur.kristof@gmail.com> (raw)
In-Reply-To: <20260202112508.43000-1-timur.kristof@gmail.com>

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: 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>
---
 drivers/gpu/drm/amd/display/dc/bios/command_table.c   |  3 +--
 drivers/gpu/drm/amd/display/dc/dce/dce_link_encoder.c | 10 ++++++++++
 2 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/bios/command_table.c b/drivers/gpu/drm/amd/display/dc/bios/command_table.c
index 76a3559f0ddc..b692fa37402d 100644
--- a/drivers/gpu/drm/amd/display/dc/bios/command_table.c
+++ b/drivers/gpu/drm/amd/display/dc/bios/command_table.c
@@ -1874,8 +1874,7 @@ static void dac_encoder_control_prepare_params(
 	uint8_t dac_standard)
 {
 	params->ucDacStandard = dac_standard;
-	if (action == ENCODER_CONTROL_SETUP ||
-	    action == ENCODER_CONTROL_INIT)
+	if (action == ENCODER_CONTROL_INIT)
 		params->ucAction = ATOM_ENCODER_INIT;
 	else if (action == ENCODER_CONTROL_ENABLE)
 		params->ucAction = ATOM_ENABLE;
diff --git a/drivers/gpu/drm/amd/display/dc/dce/dce_link_encoder.c b/drivers/gpu/drm/amd/display/dc/dce/dce_link_encoder.c
index f8fcf8d1a4dd..8903bdb89c66 100644
--- a/drivers/gpu/drm/amd/display/dc/dce/dce_link_encoder.c
+++ b/drivers/gpu/drm/amd/display/dc/dce/dce_link_encoder.c
@@ -1036,6 +1036,16 @@ void dce110_link_encoder_hw_init(
 	cntl.coherent = false;
 	cntl.hpd_sel = enc110->base.hpd_source;
 
+	if (enc110->base.analog_engine != ENGINE_ID_UNKNOWN) {
+		result = link_dac_encoder_control(enc110, ENCODER_CONTROL_INIT, 0);
+		if (result != BP_RESULT_OK) {
+			DC_LOG_ERROR("%s: Failed to execute VBIOS command table for DAC!\n",
+				__func__);
+			BREAK_TO_DEBUGGER();
+			return;
+		}
+	}
+
 	/* The code below is only applicable to encoders with a digital transmitter. */
 	if (enc110->base.transmitter == TRANSMITTER_UNKNOWN)
 		return;
-- 
2.52.0


  parent reply	other threads:[~2026-02-02 11:25 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-02 11:25 [PATCH 0/8] drm/amd/display: Fix and cleanup analog encoders Timur Kristóf
2026-02-02 11:25 ` [PATCH 1/8] drm/amd/display: Use DCE 6 link encoder for DCE 6 analog connectors Timur Kristóf
2026-02-18  4:51   ` Alex Hung
2026-02-02 11:25 ` [PATCH 2/8] drm/amd/display: Fix disabling fastboot on DCE 6-8 Timur Kristóf
2026-02-18  4:53   ` Alex Hung
2026-02-02 11:25 ` [PATCH 3/8] drm/amd/display: Don't call find_analog_engine() twice Timur Kristóf
2026-02-02 11:25 ` [PATCH 4/8] drm/amd/display: Turn off DAC in DCE link encoder using VBIOS Timur Kristóf
2026-02-02 11:25 ` Timur Kristóf [this message]
2026-02-02 11:25 ` [PATCH 6/8] drm/amd/display: Set CRTC source for DAC using registers Timur Kristóf
2026-02-02 11:25 ` [PATCH 7/8] drm/amd/display: Enable DAC in DCE link encoder Timur Kristóf
2026-02-02 11:25 ` [PATCH 8/8] drm/amd/display: Remove unneeded DAC link encoder register Timur Kristóf
2026-02-02 21:25 ` [PATCH 0/8] drm/amd/display: Fix and cleanup analog encoders Alex Deucher
2026-02-03  0:47   ` Alex Hung
2026-02-16 14:41     ` Alex Deucher
2026-02-16 17:53       ` Alex Hung
2026-02-18  4:54 ` Alex Hung

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260202112508.43000-6-timur.kristof@gmail.com \
    --to=timur.kristof@gmail.com \
    --cc=Alexander.Deucher@amd.com \
    --cc=Ray.Wu@amd.com \
    --cc=alex.hung@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=harry.wentland@amd.com \
    --cc=issor.oruam@gmail.com \
    --cc=ivan.lipski@amd.com \
    --cc=mario.limonciello@amd.com \
    --cc=siqueira@igalia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox