[PATCH 6.19 243/781] drm/amd/display: Use local variable for analog_engine initialization

Greg Kroah-Hartman
2026-02-25T01:31:22Z

From: Ivan Lipski <ivan.lipski@amd.com>

[ Upstream commit 6afc422e1a49d18b63f7042fb1cb6f519a972c8a ]

[Why&How]
Use local variable for analog_engine retrieval and check if it is supported
instead of the struct parameter.

Signed-off-by: Ivan Lipski <ivan.lipski@amd.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Tested-by: Dan Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Stable-dep-of: 436d0d22aa70 ("drm/amd/display: Pass proper DAC encoder ID to VBIOS")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/amd/display/dc/link/link_factory.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/link/link_factory.c b/drivers/gpu/drm/amd/display/dc/link/link_factory.c
index b3ca83f918747..c79c18efb6f89 100644
--- a/drivers/gpu/drm/amd/display/dc/link/link_factory.c
+++ b/drivers/gpu/drm/amd/display/dc/link/link_factory.c
@@ -478,6 +478,7 @@ static bool construct_phy(struct dc_link *link,
struct bp_disp_connector_caps_info disp_connect_caps_info = { 0 };
struct graphics_object_id link_encoder = { 0 };
enum transmitter transmitter_from_encoder;
+ enum engine_id link_analog_engine;

DC_LOGGER_INIT(dc_ctx->logger);

@@ -507,10 +508,10 @@ static bool construct_phy(struct dc_link *link,
*/
bp_funcs->get_src_obj(bios, link->link_id, 0, &link_encoder);
transmitter_from_encoder = translate_encoder_to_transmitter(link_encoder);
- enc_init_data.analog_engine = find_analog_engine(link);
+ link_analog_engine = find_analog_engine(link);

if (transmitter_from_encoder == TRANSMITTER_UNKNOWN &&
- !analog_engine_supported(enc_init_data.analog_engine)) {
+ !analog_engine_supported(link_analog_engine)) {
DC_LOG_WARNING("link_id %d has unsupported encoder\n", link->link_id.id);
goto create_fail;
}
@@ -648,6 +649,7 @@ static bool construct_phy(struct dc_link *link,
enc_init_data.hpd_source = get_hpd_line(link);
enc_init_data.transmitter = transmitter_from_encoder;
enc_init_data.encoder = link_encoder;
+ enc_init_data.analog_engine = link_analog_engine;

link->hpd_src = enc_init_data.hpd_source;

--
2.51.0