Commit 499e4b1c authored by Eric Yang's avatar Eric Yang Committed by Alex Deucher
Browse files

drm/amd/display: add mechanism to skip DCN init



[Why]
If optimized init is done in FW. DCN init can be skipped in driver. This
need to be communicated between driver and fw and maintain backwards
compatibility.

[How]
Use DMUB scratch 0 bit 2 to indicate optimized init done in fw and
use DMUB scatch 4 bit 0 to indicate drive supports the optimized flow
so FW will perform it.

Signed-off-by: default avatarEric Yang <Eric.Yang2@amd.com>
Acked-by: default avatarAurabindo Pillai <aurabindo.pillai@amd.com>
Tested-by: default avatarDaniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent bddb55cc
Loading
Loading
Loading
Loading
+0 −3
Original line number Diff line number Diff line
@@ -4267,9 +4267,6 @@ void dc_set_power_state(

		dc_z10_restore(dc);

		if (dc->ctx->dmub_srv)
			dc_dmub_srv_wait_phy_init(dc->ctx->dmub_srv);

		dc->hwss.init_hw(dc);

		if (dc->hwss.init_sys_ctx != NULL &&
+7 −21
Original line number Diff line number Diff line
@@ -179,31 +179,17 @@ bool dc_dmub_srv_cmd_run_list(struct dc_dmub_srv *dc_dmub_srv, unsigned int coun
	return true;
}

void dc_dmub_srv_wait_phy_init(struct dc_dmub_srv *dc_dmub_srv)
bool dc_dmub_srv_optimized_init_done(struct dc_dmub_srv *dc_dmub_srv)
{
	struct dmub_srv *dmub = dc_dmub_srv->dmub;
	struct dc_context *dc_ctx = dc_dmub_srv->ctx;
	enum dmub_status status;

	for (;;) {
		/* Wait up to a second for PHY init. */
		status = dmub_srv_wait_for_phy_init(dmub, 1000000);
		if (status == DMUB_STATUS_OK)
			/* Initialization OK */
			break;
	struct dmub_srv *dmub;
	union dmub_fw_boot_status status;

		DC_ERROR("DMCUB PHY init failed: status=%d\n", status);
		ASSERT(0);
	if (!dc_dmub_srv || !dc_dmub_srv->dmub)
		return false;

		if (status != DMUB_STATUS_TIMEOUT)
			/*
			 * Server likely initialized or we don't have
			 * DMCUB HW support - this won't end.
			 */
			break;
	dmub = dc_dmub_srv->dmub;

		/* Continue spinning so we don't hang the ASIC. */
	}
	return status.bits.optimized_init_done;
}

bool dc_dmub_srv_notify_stream_mask(struct dc_dmub_srv *dc_dmub_srv,
+1 −1
Original line number Diff line number Diff line
@@ -54,7 +54,7 @@ struct dc_dmub_srv {

void dc_dmub_srv_wait_idle(struct dc_dmub_srv *dc_dmub_srv);

void dc_dmub_srv_wait_phy_init(struct dc_dmub_srv *dc_dmub_srv);
bool dc_dmub_srv_optimized_init_done(struct dc_dmub_srv *dc_dmub_srv);

bool dc_dmub_srv_cmd_run(struct dc_dmub_srv *dc_dmub_srv, union dmub_rb_cmd *cmd, enum dm_dmub_wait_type wait_type);

+3 −1
Original line number Diff line number Diff line
@@ -1524,8 +1524,10 @@ 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))
		hws->funcs.bios_golden_init(dc);


	if (dc->ctx->dc_bios->fw_info_valid) {
		res_pool->ref_clocks.xtalin_clock_inKhz =
				dc->ctx->dc_bios->fw_info.pll_info.crystal_frequency;
+0 −1
Original line number Diff line number Diff line
@@ -366,7 +366,6 @@ struct dmub_srv_hw_funcs {

	bool (*is_hw_init)(struct dmub_srv *dmub);

	bool (*is_phy_init)(struct dmub_srv *dmub);
	void (*enable_dmub_boot_options)(struct dmub_srv *dmub,
				const struct dmub_srv_hw_params *params);

Loading