Commit 324de40a authored by Dmytro Laktyushkin's avatar Dmytro Laktyushkin Committed by Alex Deucher
Browse files

drm/amd/display: fix dc_get_edp_link_panel_inst to only consider links with panels



This function is meant to be used on multi-edp systems and only makes sense
if only links with connected panels are considered.

Acked-by: default avatarAurabindo Pillai <aurabindo.pillai@amd.com>
Signed-off-by: default avatarDmytro Laktyushkin <Dmytro.Laktyushkin@amd.com>
Tested-by: default avatarDaniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 2d90a1c0
Loading
Loading
Loading
Loading
+9 −6
Original line number Diff line number Diff line
@@ -335,15 +335,18 @@ static inline bool dc_get_edp_link_panel_inst(const struct dc *dc,
		unsigned int *inst_out)
{
	struct dc_link *edp_links[MAX_NUM_EDP];
	int edp_num;
	int edp_num, i;

	if (link->connector_signal != SIGNAL_TYPE_EDP)
	*inst_out = 0;
	if (link->connector_signal != SIGNAL_TYPE_EDP || !link->local_sink)
		return false;
	get_edp_links(dc, edp_links, &edp_num);
	if ((edp_num > 1) && (link->link_index > edp_links[0]->link_index))
		*inst_out = 1;
	else
		*inst_out = 0;
	for (i = 0; i < edp_num; i++) {
		if (link == edp_links[i])
			break;
		if (edp_links[i]->local_sink)
			(*inst_out)++;
	}
	return true;
}