Commit 4a9a5d62 authored by Zeyu Fan's avatar Zeyu Fan Committed by Alex Deucher

drm/amd/display: Refactor on dc_sink structure.

Signed-off-by: default avatarZeyu Fan <Zeyu.Fan@amd.com>
Acked-by: default avatarHarry Wentland <Harry.Wentland@amd.com>
Reviewed-by: default avatarTony Cheng <Tony.Cheng@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent a3621485
...@@ -675,10 +675,6 @@ bool dc_link_detect(const struct dc_link *dc_link, bool boot) ...@@ -675,10 +675,6 @@ bool dc_link_detect(const struct dc_link *dc_link, bool boot)
sink_init_data.link = &link->public; sink_init_data.link = &link->public;
sink_init_data.sink_signal = sink_caps.signal; sink_init_data.sink_signal = sink_caps.signal;
sink_init_data.dongle_max_pix_clk =
sink_caps.max_hdmi_pixel_clock;
sink_init_data.converter_disable_audio =
converter_disable_audio;
dc_sink = dc_sink_create(&sink_init_data); dc_sink = dc_sink_create(&sink_init_data);
if (!dc_sink) { if (!dc_sink) {
...@@ -686,6 +682,9 @@ bool dc_link_detect(const struct dc_link *dc_link, bool boot) ...@@ -686,6 +682,9 @@ bool dc_link_detect(const struct dc_link *dc_link, bool boot)
return false; return false;
} }
dc_sink->dongle_max_pix_clk = sink_caps.max_hdmi_pixel_clock;
dc_sink->converter_disable_audio = converter_disable_audio;
sink = DC_SINK_TO_CORE(dc_sink); sink = DC_SINK_TO_CORE(dc_sink);
link->public.local_sink = &sink->public; link->public.local_sink = &sink->public;
...@@ -1361,7 +1360,7 @@ enum dc_status dc_link_validate_mode_timing( ...@@ -1361,7 +1360,7 @@ enum dc_status dc_link_validate_mode_timing(
struct core_link *link, struct core_link *link,
const struct dc_crtc_timing *timing) const struct dc_crtc_timing *timing)
{ {
uint32_t max_pix_clk = stream->sink->dongle_max_pix_clk; uint32_t max_pix_clk = stream->sink->public.dongle_max_pix_clk;
/* A hack to avoid failing any modes for EDID override feature on /* A hack to avoid failing any modes for EDID override feature on
* topology change such as lower quality cable for DP or different dongle * topology change such as lower quality cable for DP or different dongle
......
...@@ -1193,7 +1193,7 @@ enum dc_status resource_map_pool_resources( ...@@ -1193,7 +1193,7 @@ enum dc_status resource_map_pool_resources(
pipe_ctx->stream_enc); pipe_ctx->stream_enc);
/* TODO: Add check if ASIC support and EDID audio */ /* TODO: Add check if ASIC support and EDID audio */
if (!stream->sink->converter_disable_audio && if (!stream->sink->public.converter_disable_audio &&
dc_is_audio_capable_signal(pipe_ctx->stream->signal) && dc_is_audio_capable_signal(pipe_ctx->stream->signal) &&
stream->public.audio_info.mode_count) { stream->public.audio_info.mode_count) {
pipe_ctx->audio = find_first_free_audio( pipe_ctx->audio = find_first_free_audio(
......
...@@ -60,8 +60,8 @@ static bool construct(struct sink *sink, const struct dc_sink_init_data *init_pa ...@@ -60,8 +60,8 @@ static bool construct(struct sink *sink, const struct dc_sink_init_data *init_pa
sink->protected.public.sink_signal = init_params->sink_signal; sink->protected.public.sink_signal = init_params->sink_signal;
sink->protected.link = core_link; sink->protected.link = core_link;
sink->protected.ctx = core_link->ctx; sink->protected.ctx = core_link->ctx;
sink->protected.dongle_max_pix_clk = init_params->dongle_max_pix_clk; sink->protected.public.dongle_max_pix_clk = init_params->dongle_max_pix_clk;
sink->protected.converter_disable_audio = sink->protected.public.converter_disable_audio =
init_params->converter_disable_audio; init_params->converter_disable_audio;
return true; return true;
......
...@@ -653,6 +653,8 @@ struct dc_sink { ...@@ -653,6 +653,8 @@ struct dc_sink {
enum signal_type sink_signal; enum signal_type sink_signal;
struct dc_edid dc_edid; /* raw edid */ struct dc_edid dc_edid; /* raw edid */
struct dc_edid_caps edid_caps; /* parse display caps */ struct dc_edid_caps edid_caps; /* parse display caps */
uint32_t dongle_max_pix_clk;
bool converter_disable_audio;
}; };
void dc_sink_retain(const struct dc_sink *sink); void dc_sink_retain(const struct dc_sink *sink);
......
...@@ -109,8 +109,6 @@ struct core_sink { ...@@ -109,8 +109,6 @@ struct core_sink {
/* not used for now */ /* not used for now */
struct core_link *link; struct core_link *link;
struct dc_context *ctx; struct dc_context *ctx;
uint32_t dongle_max_pix_clk;
bool converter_disable_audio;
}; };
/************ link *****************/ /************ link *****************/
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment