drm/amd/display: Register init
[Why] Driver re-initialize registers already set in FW [How] Transfer init to FW Signed-off-by: Igor Kravchenko <Igor.Kravchenko@amd.com> Reviewed-by: Tony Cheng <Tony.Cheng@amd.com> Acked-by: Eryk Brol <eryk.brol@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
3c0dcf9f2a
commit
cd9a180a29
|
@ -1255,6 +1255,7 @@ void dcn10_init_hw(struct dc *dc)
|
|||
struct dc_bios *dcb = dc->ctx->dc_bios;
|
||||
struct resource_pool *res_pool = dc->res_pool;
|
||||
uint32_t backlight = MAX_BACKLIGHT_LEVEL;
|
||||
bool is_optimized_init_done = false;
|
||||
|
||||
if (dc->clk_mgr && dc->clk_mgr->funcs->init_clocks)
|
||||
dc->clk_mgr->funcs->init_clocks(dc->clk_mgr);
|
||||
|
@ -1288,7 +1289,9 @@ void dcn10_init_hw(struct dc *dc)
|
|||
if (!dcb->funcs->is_accelerated_mode(dcb))
|
||||
hws->funcs.disable_vga(dc->hwseq);
|
||||
|
||||
if (!dc_dmub_srv_optimized_init_done(dc->ctx->dmub_srv))
|
||||
is_optimized_init_done = dc_dmub_srv_optimized_init_done(dc->ctx->dmub_srv);
|
||||
|
||||
if (!is_optimized_init_done)
|
||||
hws->funcs.bios_golden_init(dc);
|
||||
|
||||
if (dc->ctx->dc_bios->fw_info_valid) {
|
||||
|
@ -1323,7 +1326,8 @@ void dcn10_init_hw(struct dc *dc)
|
|||
*/
|
||||
struct dc_link *link = dc->links[i];
|
||||
|
||||
link->link_enc->funcs->hw_init(link->link_enc);
|
||||
if (!is_optimized_init_done)
|
||||
link->link_enc->funcs->hw_init(link->link_enc);
|
||||
|
||||
/* Check for enabled DIG to identify enabled display */
|
||||
if (link->link_enc->funcs->is_dig_enabled &&
|
||||
|
@ -1332,9 +1336,11 @@ void dcn10_init_hw(struct dc *dc)
|
|||
}
|
||||
|
||||
/* Power gate DSCs */
|
||||
for (i = 0; i < res_pool->res_cap->num_dsc; i++)
|
||||
if (hws->funcs.dsc_pg_control != NULL)
|
||||
hws->funcs.dsc_pg_control(hws, res_pool->dscs[i]->inst, false);
|
||||
if (!is_optimized_init_done) {
|
||||
for (i = 0; i < res_pool->res_cap->num_dsc; i++)
|
||||
if (hws->funcs.dsc_pg_control != NULL)
|
||||
hws->funcs.dsc_pg_control(hws, res_pool->dscs[i]->inst, false);
|
||||
}
|
||||
|
||||
/* we want to turn off all dp displays before doing detection */
|
||||
if (dc->config.power_down_display_on_boot) {
|
||||
|
@ -1379,10 +1385,12 @@ void dcn10_init_hw(struct dc *dc)
|
|||
* everything down.
|
||||
*/
|
||||
if (dcb->funcs->is_accelerated_mode(dcb) || dc->config.power_down_display_on_boot) {
|
||||
hws->funcs.init_pipes(dc, dc->current_state);
|
||||
if (dc->res_pool->hubbub->funcs->allow_self_refresh_control)
|
||||
dc->res_pool->hubbub->funcs->allow_self_refresh_control(dc->res_pool->hubbub,
|
||||
!dc->res_pool->hubbub->ctx->dc->debug.disable_stutter);
|
||||
if (!is_optimized_init_done) {
|
||||
hws->funcs.init_pipes(dc, dc->current_state);
|
||||
if (dc->res_pool->hubbub->funcs->allow_self_refresh_control)
|
||||
dc->res_pool->hubbub->funcs->allow_self_refresh_control(dc->res_pool->hubbub,
|
||||
!dc->res_pool->hubbub->ctx->dc->debug.disable_stutter);
|
||||
}
|
||||
}
|
||||
|
||||
/* In headless boot cases, DIG may be turned
|
||||
|
@ -1417,30 +1425,34 @@ void dcn10_init_hw(struct dc *dc)
|
|||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < res_pool->audio_count; i++) {
|
||||
struct audio *audio = res_pool->audios[i];
|
||||
if (!is_optimized_init_done) {
|
||||
|
||||
audio->funcs->hw_init(audio);
|
||||
for (i = 0; i < res_pool->audio_count; i++) {
|
||||
struct audio *audio = res_pool->audios[i];
|
||||
|
||||
audio->funcs->hw_init(audio);
|
||||
}
|
||||
|
||||
for (i = 0; i < dc->link_count; i++) {
|
||||
struct dc_link *link = dc->links[i];
|
||||
|
||||
if (link->panel_cntl)
|
||||
backlight = link->panel_cntl->funcs->hw_init(link->panel_cntl);
|
||||
}
|
||||
|
||||
if (abm != NULL)
|
||||
abm->funcs->abm_init(abm, backlight);
|
||||
|
||||
if (dmcu != NULL && !dmcu->auto_load_dmcu)
|
||||
dmcu->funcs->dmcu_init(dmcu);
|
||||
}
|
||||
|
||||
for (i = 0; i < dc->link_count; i++) {
|
||||
struct dc_link *link = dc->links[i];
|
||||
|
||||
if (link->panel_cntl)
|
||||
backlight = link->panel_cntl->funcs->hw_init(link->panel_cntl);
|
||||
}
|
||||
|
||||
if (abm != NULL)
|
||||
abm->funcs->abm_init(abm, backlight);
|
||||
|
||||
if (dmcu != NULL && !dmcu->auto_load_dmcu)
|
||||
dmcu->funcs->dmcu_init(dmcu);
|
||||
|
||||
if (abm != NULL && dmcu != NULL)
|
||||
abm->dmcu_is_running = dmcu->funcs->is_dmcu_initialized(dmcu);
|
||||
|
||||
/* power AFMT HDMI memory TODO: may move to dis/en output save power*/
|
||||
REG_WRITE(DIO_MEM_PWR_CTRL, 0);
|
||||
if (!is_optimized_init_done)
|
||||
REG_WRITE(DIO_MEM_PWR_CTRL, 0);
|
||||
|
||||
if (!dc->debug.disable_clock_gate) {
|
||||
/* enable all DCN clock gating */
|
||||
|
|
Loading…
Reference in New Issue