Commit 980d6042 authored by Wyatt Wood's avatar Wyatt Wood Committed by Alex Deucher
Browse files

drm/amd/display: Add get_current_time interface to dmub_srv



[Why]
Need to get current DMUB time.

[How]
Add get_current_time interface to dmub_srv.

v2: drop whitespace changes (Alex)

Signed-off-by: default avatarWyatt Wood <wyatt.wood@amd.com>
Reviewed-by: default avatarAric Cyr <Aric.Cyr@amd.com>
Acked-by: default avatarStylon Wang <stylon.wang@amd.com>
Tested-by: default avatarDaniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 132c894e
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -2663,7 +2663,6 @@ static void commit_planes_for_stream(struct dc *dc,
			dc->hwss.interdependent_update_lock(dc, context, false);
		else
			dc->hwss.pipe_control_lock(dc, top_pipe_to_program, false);

		dc->hwss.post_unlock_program_front_end(dc, context);
		return;
	}
@@ -2764,6 +2763,7 @@ static void commit_planes_for_stream(struct dc *dc,
							plane_state->flip_immediate);
				}
			}

		/* Perform requested Updates */
		for (i = 0; i < surface_count; i++) {
			struct dc_plane_state *plane_state = srf_updates[i].surface;
@@ -2786,6 +2786,7 @@ static void commit_planes_for_stream(struct dc *dc,
					dc->hwss.update_plane_addr(dc, pipe_ctx);
			}
		}

	}

	if ((update_type != UPDATE_TYPE_FAST) && dc->hwss.interdependent_update_lock)
+1 −0
Original line number Diff line number Diff line
@@ -323,6 +323,7 @@ struct dmub_srv_hw_funcs {

	uint32_t (*get_gpint_response)(struct dmub_srv *dmub);

	uint32_t (*get_current_time)(struct dmub_srv *dmub);
};

/**
+5 −0
Original line number Diff line number Diff line
@@ -399,3 +399,8 @@ void dmub_dcn20_skip_dmub_panel_power_sequence(struct dmub_srv *dmub, bool skip)
	boot_options.bits.skip_phy_init_panel_sequence = skip;
	REG_WRITE(DMCUB_SCRATCH14, boot_options.all);
}

uint32_t dmub_dcn20_get_current_time(struct dmub_srv *dmub)
{
	return REG_READ(DMCUB_TIMER_CURRENT);
}
+4 −1
Original line number Diff line number Diff line
@@ -107,7 +107,8 @@ struct dmub_srv;
	DMUB_SR(MMHUBBUB_SOFT_RESET) \
	DMUB_SR(DCN_VM_FB_LOCATION_BASE) \
	DMUB_SR(DCN_VM_FB_OFFSET) \
	DMUB_SR(DMCUB_INTERRUPT_ACK)
	DMUB_SR(DMCUB_INTERRUPT_ACK) \
	DMUB_SR(DMCUB_TIMER_CURRENT)

#define DMUB_COMMON_FIELDS() \
	DMUB_SF(DMCUB_CNTL, DMCUB_ENABLE) \
@@ -231,4 +232,6 @@ bool dmub_dcn20_use_cached_inbox(struct dmub_srv *dmub);

bool dmub_dcn20_use_cached_trace_buffer(struct dmub_srv *dmub);

uint32_t dmub_dcn20_get_current_time(struct dmub_srv *dmub);

#endif /* _DMUB_DCN20_H_ */
+1 −0
Original line number Diff line number Diff line
@@ -159,6 +159,7 @@ static bool dmub_srv_hw_setup(struct dmub_srv *dmub, enum dmub_asic asic)
		funcs->get_fw_status = dmub_dcn20_get_fw_boot_status;
		funcs->enable_dmub_boot_options = dmub_dcn20_enable_dmub_boot_options;
		funcs->skip_dmub_panel_power_sequence = dmub_dcn20_skip_dmub_panel_power_sequence;
		funcs->get_current_time = dmub_dcn20_get_current_time;

		// Out mailbox register access functions for RN and above
		funcs->setup_out_mailbox = dmub_dcn20_setup_out_mailbox;