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

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
Loading
Loading
Loading
Loading
+35 −23
Original line number Diff line number Diff line
@@ -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,6 +1326,7 @@ void dcn10_init_hw(struct dc *dc)
		 */
		struct dc_link *link = dc->links[i];

		if (!is_optimized_init_done)
			link->link_enc->funcs->hw_init(link->link_enc);

		/* Check for enabled DIG to identify enabled display */
@@ -1332,9 +1336,11 @@ void dcn10_init_hw(struct dc *dc)
	}

	/* Power gate DSCs */
	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,11 +1385,13 @@ void dcn10_init_hw(struct dc *dc)
	 * everything down.
	 */
	if (dcb->funcs->is_accelerated_mode(dcb) || dc->config.power_down_display_on_boot) {
		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
	 * on which causes HW/SW discrepancies.
@@ -1417,6 +1425,8 @@ void dcn10_init_hw(struct dc *dc)
		}
	}

	if (!is_optimized_init_done) {

		for (i = 0; i < res_pool->audio_count; i++) {
			struct audio *audio = res_pool->audios[i];

@@ -1435,11 +1445,13 @@ void dcn10_init_hw(struct dc *dc)

		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*/
	if (!is_optimized_init_done)
		REG_WRITE(DIO_MEM_PWR_CTRL, 0);

	if (!dc->debug.disable_clock_gate) {