From: <Roman.Li@amd.com>
To: <amd-gfx@lists.freedesktop.org>
Cc: Harry Wentland <harry.wentland@amd.com>,
Leo Li <sunpeng.li@amd.com>,
Aurabindo Pillai <aurabindo.pillai@amd.com>,
Roman Li <roman.li@amd.com>, Wayne Lin <wayne.lin@amd.com>,
Tom Chung <chiahsuan.chung@amd.com>,
"Fangzhi Zuo" <jerry.zuo@amd.com>,
Dan Wheeler <daniel.wheeler@amd.com>, Ray Wu <Ray.Wu@amd.com>,
Ivan Lipski <ivan.lipski@amd.com>, Alex Hung <alex.hung@amd.com>
Subject: [PATCH 01/14] drm/amd/display: Remove unused encoder types
Date: Wed, 26 Nov 2025 18:06:01 -0500 [thread overview]
Message-ID: <20251126230614.13409-2-Roman.Li@amd.com> (raw)
In-Reply-To: <20251126230614.13409-1-Roman.Li@amd.com>
From: Ivan Lipski <ivan.lipski@amd.com>
[Why&How]
We only support ENCODER_ID_INTERNAL_UNIPHY encoders now, so NUTMEG & TRAVIS
can be removed from translate_encoder_to_transmitter.
Also refactor to use local variables of transmitter to exit early.
V2: Fix construct_phy check for TRANSMITTER_UKNOWN
Signed-off-by: Ivan Lipski <ivan.lipski@amd.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
---
.../drm/amd/display/dc/link/link_factory.c | 47 +++++--------------
1 file changed, 12 insertions(+), 35 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 e9af184dbe5d..e9f966b5be65 100644
--- a/drivers/gpu/drm/amd/display/dc/link/link_factory.c
+++ b/drivers/gpu/drm/amd/display/dc/link/link_factory.c
@@ -354,24 +354,6 @@ static enum transmitter translate_encoder_to_transmitter(
return TRANSMITTER_UNKNOWN;
}
break;
- case ENCODER_ID_EXTERNAL_NUTMEG:
- switch (encoder.enum_id) {
- case ENUM_ID_1:
- return TRANSMITTER_NUTMEG_CRT;
- default:
- return TRANSMITTER_UNKNOWN;
- }
- break;
- case ENCODER_ID_EXTERNAL_TRAVIS:
- switch (encoder.enum_id) {
- case ENUM_ID_1:
- return TRANSMITTER_TRAVIS_CRT;
- case ENUM_ID_2:
- return TRANSMITTER_TRAVIS_LCD;
- default:
- return TRANSMITTER_UNKNOWN;
- }
- break;
default:
return TRANSMITTER_UNKNOWN;
}
@@ -481,14 +463,6 @@ static enum engine_id find_analog_engine(struct dc_link *link)
return ENGINE_ID_UNKNOWN;
}
-static bool transmitter_supported(const enum transmitter transmitter)
-{
- return transmitter != TRANSMITTER_UNKNOWN &&
- transmitter != TRANSMITTER_NUTMEG_CRT &&
- transmitter != TRANSMITTER_TRAVIS_CRT &&
- transmitter != TRANSMITTER_TRAVIS_LCD;
-}
-
static bool analog_engine_supported(const enum engine_id engine_id)
{
return engine_id == ENGINE_ID_DACA ||
@@ -506,6 +480,8 @@ static bool construct_phy(struct dc_link *link,
struct dc_bios *bios = init_params->dc->ctx->dc_bios;
const struct dc_vbios_funcs *bp_funcs = bios->funcs;
struct bp_disp_connector_caps_info disp_connect_caps_info = { 0 };
+ struct graphics_object_id link_encoder = { 0 };
+ enum transmitter transmitter_from_encoder;
DC_LOGGER_INIT(dc_ctx->logger);
@@ -526,21 +502,21 @@ static bool construct_phy(struct dc_link *link,
link->link_id =
bios->funcs->get_connector_id(bios, init_params->connector_index);
+ link->ep_type = DISPLAY_ENDPOINT_PHY;
+
+ DC_LOG_DC("BIOS object table - link_id: %d", link->link_id.id);
+
/* Determine early if the link has any supported encoders,
* so that we avoid initializing DDC and HPD, etc.
*/
- bp_funcs->get_src_obj(bios, link->link_id, 0, &enc_init_data.encoder);
- enc_init_data.transmitter = translate_encoder_to_transmitter(enc_init_data.encoder);
+ 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->ep_type = DISPLAY_ENDPOINT_PHY;
-
- DC_LOG_DC("BIOS object table - link_id: %d", link->link_id.id);
-
- if (!transmitter_supported(enc_init_data.transmitter) &&
+ if (transmitter_from_encoder == TRANSMITTER_UNKNOWN &&
!analog_engine_supported(enc_init_data.analog_engine)) {
DC_LOG_WARNING("link_id %d has unsupported encoder\n", link->link_id.id);
- goto unsupported_fail;
+ goto create_fail;
}
if (bios->funcs->get_disp_connector_caps_info) {
@@ -674,6 +650,8 @@ static bool construct_phy(struct dc_link *link,
enc_init_data.connector = link->link_id;
enc_init_data.channel = get_ddc_line(link);
enc_init_data.hpd_source = get_hpd_line(link);
+ enc_init_data.transmitter = transmitter_from_encoder;
+ enc_init_data.encoder = link_encoder;
link->hpd_src = enc_init_data.hpd_source;
@@ -810,7 +788,6 @@ static bool construct_phy(struct dc_link *link,
link->hpd_gpio = NULL;
}
-unsupported_fail:
DC_LOG_DC("BIOS object table - %s failed.\n", __func__);
return false;
}
--
2.34.1
next prev parent reply other threads:[~2025-11-26 23:06 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-26 23:06 [PATCH 00/14] DC Patches November 26, 2025 Roman.Li
2025-11-26 23:06 ` Roman.Li [this message]
2025-11-26 23:06 ` [PATCH 02/14] drm/amd/display: Use local variable for analog_engine initialization Roman.Li
2025-11-26 23:06 ` [PATCH 03/14] drm/amd/display: Move RGB-type check for audio sync to DCE HW sequence Roman.Li
2025-11-26 23:06 ` [PATCH 04/14] drm/amd/display: fix Smart Power OLED not working after S4 Roman.Li
2025-11-26 23:06 ` [PATCH 05/14] drm/amd/display: refactor HPD to increase flexibility Roman.Li
2025-11-26 23:06 ` [PATCH 06/14] drm/amd/display: Fix wrong x_pos and y_pos for cursor offload Roman.Li
2025-11-26 23:06 ` [PATCH 07/14] drm/amd/display: add dc interface for query QoS information Roman.Li
2025-11-26 23:06 ` [PATCH 08/14] drm/amd/display: Guard FAMS2 configuration updates Roman.Li
2025-11-26 23:06 ` [PATCH 09/14] drm/amd/display: Add additional info from DML Roman.Li
2025-11-26 23:06 ` [PATCH 10/14] drm/amd/display: Correct FIXED_VS Link Rate Toggle Condition Roman.Li
2025-11-26 23:06 ` [PATCH 11/14] drm/amd/display: add register definitions in dcn_hubbub_registers Roman.Li
2025-11-26 23:06 ` [PATCH 12/14] drm/amd/display: Reset pipe mask at beginning of cursor offload Roman.Li
2025-11-26 23:06 ` [PATCH 13/14] drm/amd/display - dc: Add configurable SPL namespace prefix Roman.Li
2025-11-26 23:06 ` [PATCH 14/14] drm/amd/display: Promote DC to 3.2.361 Roman.Li
2025-12-01 13:08 ` [PATCH 00/14] DC Patches November 26, 2025 Wheeler, Daniel
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=20251126230614.13409-2-Roman.Li@amd.com \
--to=roman.li@amd.com \
--cc=Ray.Wu@amd.com \
--cc=alex.hung@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=aurabindo.pillai@amd.com \
--cc=chiahsuan.chung@amd.com \
--cc=daniel.wheeler@amd.com \
--cc=harry.wentland@amd.com \
--cc=ivan.lipski@amd.com \
--cc=jerry.zuo@amd.com \
--cc=sunpeng.li@amd.com \
--cc=wayne.lin@amd.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