summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/amd/display/dc/dc_link.h
diff options
context:
space:
mode:
authorDmytro Laktyushkin <Dmytro.Laktyushkin@amd.com>2022-12-06 10:06:14 -0500
committerAlex Deucher <alexander.deucher@amd.com>2023-01-03 16:57:57 -0500
commit324de40a56550e22b0a5ec40442ee13d5a0e7688 (patch)
tree6f23334f99c8a939617c8887ee6b52007b82b28f /drivers/gpu/drm/amd/display/dc/dc_link.h
parent2d90a1c054831338d57b39aec4d273cf3e867590 (diff)
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: Aurabindo Pillai <aurabindo.pillai@amd.com> Signed-off-by: Dmytro Laktyushkin <Dmytro.Laktyushkin@amd.com> Tested-by: Daniel Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/display/dc/dc_link.h')
-rw-r--r--drivers/gpu/drm/amd/display/dc/dc_link.h15
1 files changed, 9 insertions, 6 deletions
diff --git a/drivers/gpu/drm/amd/display/dc/dc_link.h b/drivers/gpu/drm/amd/display/dc/dc_link.h
index 2e18bcf6b11a..8565bbb75177 100644
--- a/drivers/gpu/drm/amd/display/dc/dc_link.h
+++ b/drivers/gpu/drm/amd/display/dc/dc_link.h
@@ -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;
}