summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/amd/display/dc/core/dc.c
diff options
context:
space:
mode:
authorYongqiang Sun <yongqiang.sun@amd.com>2020-11-12 19:21:16 +0300
committerAlex Deucher <alexander.deucher@amd.com>2020-11-24 20:08:23 +0300
commit30bdf50b77bd3dbc111b4aeff7018d8c58ec7d8d (patch)
tree015ea3ab4835e9b67c876435d9617e34e7d7fd6e /drivers/gpu/drm/amd/display/dc/core/dc.c
parentc85ef99a9fa394f1cd3cc3694415f80d2c9378ec (diff)
downloadlinux-30bdf50b77bd3dbc111b4aeff7018d8c58ec7d8d.tar.xz
drm/amd/display: Check multiple internal displays for power optimization.
[Why & How] only apply multiple display power optimization in case there are more than one internal display. Signed-off-by: Yongqiang Sun <yongqiang.sun@amd.com> Reviewed-by: Tony Cheng <Tony.Cheng@amd.com> Acked-by: Anthony Koo <Anthony.Koo@amd.com> Acked-by: Aric Cyr <Aric.Cyr@amd.com> Acked-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/display/dc/core/dc.c')
-rw-r--r--drivers/gpu/drm/amd/display/dc/core/dc.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/display/dc/core/dc.c b/drivers/gpu/drm/amd/display/dc/core/dc.c
index 28b856e2686d..903353389edb 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc.c
@@ -149,6 +149,20 @@ static void destroy_links(struct dc *dc)
}
}
+static uint32_t get_num_of_internal_disp(struct dc_link **links, uint32_t num_links)
+{
+ int i;
+ uint32_t count = 0;
+
+ for (i = 0; i < num_links; i++) {
+ if (links[i]->connector_signal == SIGNAL_TYPE_EDP ||
+ links[i]->is_internal_display)
+ count++;
+ }
+
+ return count;
+}
+
static bool create_links(
struct dc *dc,
uint32_t num_virtual_links)
@@ -250,6 +264,8 @@ static bool create_links(
virtual_link_encoder_construct(link->link_enc, &enc_init);
}
+ dc->caps.num_of_internal_disp = get_num_of_internal_disp(dc->links, dc->link_count);
+
return true;
failed_alloc: