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>
This commit is contained in:
parent
c85ef99a9f
commit
30bdf50b77
|
@ -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:
|
||||
|
|
|
@ -169,6 +169,7 @@ struct dc_caps {
|
|||
bool psp_setup_panel_mode;
|
||||
bool extended_aux_timeout_support;
|
||||
bool dmcub_support;
|
||||
uint32_t num_of_internal_disp;
|
||||
enum dp_protocol_version max_dp_protocol_version;
|
||||
struct dc_plane_cap planes[MAX_PLANES];
|
||||
struct dc_color_caps color;
|
||||
|
|
Loading…
Reference in New Issue