Commit cd9a180a authored by Igor Kravchenko's avatar Igor Kravchenko Committed by Alex Deucher

drm/amd/display: Register init

[Why]
Driver re-initialize registers already set in FW

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