mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-21 16:29:59 +00:00
drm/amd/display: Change return type of dm_helpers_dp_mst_stop_top_mgr
Prepare for future dm can have different implementation depends on the return value. Tested-by: Daniel Wheeler <daniel.wheeler@amd.com> Reviewed-by: Wenjing Liu <Wenjing.Liu@amd.com> Acked-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com> Signed-off-by: Ian Chen <ian.chen@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
parent
1210b17dd4
commit
87e298d6e3
3 changed files with 13 additions and 27 deletions
|
@ -445,40 +445,24 @@ bool dm_helpers_dp_mst_start_top_mgr(
|
|||
return (drm_dp_mst_topology_mgr_set_mst(&aconnector->mst_mgr, true) == 0);
|
||||
}
|
||||
|
||||
void dm_helpers_dp_mst_stop_top_mgr(
|
||||
bool dm_helpers_dp_mst_stop_top_mgr(
|
||||
struct dc_context *ctx,
|
||||
struct dc_link *link)
|
||||
{
|
||||
struct amdgpu_dm_connector *aconnector = link->priv;
|
||||
uint8_t i;
|
||||
|
||||
if (!aconnector) {
|
||||
DRM_ERROR("Failed to find connector for link!");
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
|
||||
DRM_INFO("DM_MST: stopping TM on aconnector: %p [id: %d]\n",
|
||||
aconnector, aconnector->base.base.id);
|
||||
|
||||
if (aconnector->mst_mgr.mst_state == true) {
|
||||
if (aconnector->mst_mgr.mst_state == true)
|
||||
drm_dp_mst_topology_mgr_set_mst(&aconnector->mst_mgr, false);
|
||||
|
||||
for (i = 0; i < MAX_SINKS_PER_LINK; i++) {
|
||||
if (link->remote_sinks[i] == NULL)
|
||||
continue;
|
||||
|
||||
if (link->remote_sinks[i]->sink_signal ==
|
||||
SIGNAL_TYPE_DISPLAY_PORT_MST) {
|
||||
dc_link_remove_remote_sink(link, link->remote_sinks[i]);
|
||||
|
||||
if (aconnector->dc_sink) {
|
||||
dc_sink_release(aconnector->dc_sink);
|
||||
aconnector->dc_sink = NULL;
|
||||
aconnector->dc_link->cur_link_settings.lane_count = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool dm_helpers_dp_read_dpcd(
|
||||
|
|
|
@ -840,20 +840,22 @@ static bool discover_dp_mst_topology(struct dc_link *link, enum dc_detect_reason
|
|||
return link->type == dc_connection_mst_branch;
|
||||
}
|
||||
|
||||
static void reset_cur_dp_mst_topology(struct dc_link *link)
|
||||
static bool reset_cur_dp_mst_topology(struct dc_link *link)
|
||||
{
|
||||
bool result = false;
|
||||
DC_LOGGER_INIT(link->ctx->logger);
|
||||
|
||||
LINK_INFO("link=%d, mst branch is now Disconnected\n",
|
||||
link->link_index);
|
||||
|
||||
revert_dpia_mst_dsc_always_on_wa(link);
|
||||
dm_helpers_dp_mst_stop_top_mgr(link->ctx, link);
|
||||
result = dm_helpers_dp_mst_stop_top_mgr(link->ctx, link);
|
||||
|
||||
link->mst_stream_alloc_table.stream_count = 0;
|
||||
memset(link->mst_stream_alloc_table.stream_allocations,
|
||||
0,
|
||||
sizeof(link->mst_stream_alloc_table.stream_allocations));
|
||||
return result;
|
||||
}
|
||||
|
||||
static bool should_prepare_phy_clocks_for_link_verification(const struct dc *dc,
|
||||
|
@ -1306,7 +1308,7 @@ static bool detect_link_and_local_sink(struct dc_link *link,
|
|||
bool dc_link_detect(struct dc_link *link, enum dc_detect_reason reason)
|
||||
{
|
||||
bool is_local_sink_detect_success;
|
||||
bool is_remote_sink_detect_required = false;
|
||||
bool is_delegated_to_mst_top_mgr = false;
|
||||
enum dc_connection_type pre_link_type = link->type;
|
||||
|
||||
is_local_sink_detect_success = detect_link_and_local_sink(link, reason);
|
||||
|
@ -1317,14 +1319,14 @@ bool dc_link_detect(struct dc_link *link, enum dc_detect_reason reason)
|
|||
if (is_local_sink_detect_success && link->local_sink &&
|
||||
dc_is_dp_signal(link->local_sink->sink_signal) &&
|
||||
link->dpcd_caps.is_mst_capable)
|
||||
is_remote_sink_detect_required = discover_dp_mst_topology(link, reason);
|
||||
is_delegated_to_mst_top_mgr = discover_dp_mst_topology(link, reason);
|
||||
|
||||
if (is_local_sink_detect_success &&
|
||||
pre_link_type == dc_connection_mst_branch &&
|
||||
link->type != dc_connection_mst_branch)
|
||||
reset_cur_dp_mst_topology(link);
|
||||
is_delegated_to_mst_top_mgr = reset_cur_dp_mst_topology(link);
|
||||
|
||||
return is_local_sink_detect_success && !is_remote_sink_detect_required;
|
||||
return is_local_sink_detect_success && !is_delegated_to_mst_top_mgr;
|
||||
}
|
||||
|
||||
bool dc_link_get_hpd_state(struct dc_link *dc_link)
|
||||
|
|
|
@ -113,7 +113,7 @@ bool dm_helpers_dp_mst_start_top_mgr(
|
|||
const struct dc_link *link,
|
||||
bool boot);
|
||||
|
||||
void dm_helpers_dp_mst_stop_top_mgr(
|
||||
bool dm_helpers_dp_mst_stop_top_mgr(
|
||||
struct dc_context *ctx,
|
||||
struct dc_link *link);
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue