Commit 30bdf50b authored by Yongqiang Sun's avatar Yongqiang Sun Committed by Alex Deucher

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: default avatarYongqiang Sun <yongqiang.sun@amd.com>
Reviewed-by: default avatarTony Cheng <Tony.Cheng@amd.com>
Acked-by: default avatarAnthony Koo <Anthony.Koo@amd.com>
Acked-by: default avatarAric Cyr <Aric.Cyr@amd.com>
Acked-by: default avatarRodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent c85ef99a
...@@ -149,6 +149,20 @@ static void destroy_links(struct dc *dc) ...@@ -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( static bool create_links(
struct dc *dc, struct dc *dc,
uint32_t num_virtual_links) uint32_t num_virtual_links)
...@@ -250,6 +264,8 @@ static bool create_links( ...@@ -250,6 +264,8 @@ static bool create_links(
virtual_link_encoder_construct(link->link_enc, &enc_init); 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; return true;
failed_alloc: failed_alloc:
......
...@@ -169,6 +169,7 @@ struct dc_caps { ...@@ -169,6 +169,7 @@ struct dc_caps {
bool psp_setup_panel_mode; bool psp_setup_panel_mode;
bool extended_aux_timeout_support; bool extended_aux_timeout_support;
bool dmcub_support; bool dmcub_support;
uint32_t num_of_internal_disp;
enum dp_protocol_version max_dp_protocol_version; enum dp_protocol_version max_dp_protocol_version;
struct dc_plane_cap planes[MAX_PLANES]; struct dc_plane_cap planes[MAX_PLANES];
struct dc_color_caps color; struct dc_color_caps color;
......
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