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

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
...@@ -2663,7 +2663,6 @@ static void commit_planes_for_stream(struct dc *dc, ...@@ -2663,7 +2663,6 @@ static void commit_planes_for_stream(struct dc *dc,
dc->hwss.interdependent_update_lock(dc, context, false); dc->hwss.interdependent_update_lock(dc, context, false);
else else
dc->hwss.pipe_control_lock(dc, top_pipe_to_program, false); dc->hwss.pipe_control_lock(dc, top_pipe_to_program, false);
dc->hwss.post_unlock_program_front_end(dc, context); dc->hwss.post_unlock_program_front_end(dc, context);
return; return;
} }
...@@ -2764,6 +2763,7 @@ static void commit_planes_for_stream(struct dc *dc, ...@@ -2764,6 +2763,7 @@ static void commit_planes_for_stream(struct dc *dc,
plane_state->flip_immediate); plane_state->flip_immediate);
} }
} }
/* Perform requested Updates */ /* Perform requested Updates */
for (i = 0; i < surface_count; i++) { for (i = 0; i < surface_count; i++) {
struct dc_plane_state *plane_state = srf_updates[i].surface; struct dc_plane_state *plane_state = srf_updates[i].surface;
...@@ -2786,6 +2786,7 @@ static void commit_planes_for_stream(struct dc *dc, ...@@ -2786,6 +2786,7 @@ static void commit_planes_for_stream(struct dc *dc,
dc->hwss.update_plane_addr(dc, pipe_ctx); dc->hwss.update_plane_addr(dc, pipe_ctx);
} }
} }
} }
if ((update_type != UPDATE_TYPE_FAST) && dc->hwss.interdependent_update_lock) if ((update_type != UPDATE_TYPE_FAST) && dc->hwss.interdependent_update_lock)
......
...@@ -323,6 +323,7 @@ struct dmub_srv_hw_funcs { ...@@ -323,6 +323,7 @@ struct dmub_srv_hw_funcs {
uint32_t (*get_gpint_response)(struct dmub_srv *dmub); uint32_t (*get_gpint_response)(struct dmub_srv *dmub);
uint32_t (*get_current_time)(struct dmub_srv *dmub);
}; };
/** /**
......
...@@ -399,3 +399,8 @@ void dmub_dcn20_skip_dmub_panel_power_sequence(struct dmub_srv *dmub, bool skip) ...@@ -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; boot_options.bits.skip_phy_init_panel_sequence = skip;
REG_WRITE(DMCUB_SCRATCH14, boot_options.all); REG_WRITE(DMCUB_SCRATCH14, boot_options.all);
} }
uint32_t dmub_dcn20_get_current_time(struct dmub_srv *dmub)
{
return REG_READ(DMCUB_TIMER_CURRENT);
}
...@@ -107,7 +107,8 @@ struct dmub_srv; ...@@ -107,7 +107,8 @@ struct dmub_srv;
DMUB_SR(MMHUBBUB_SOFT_RESET) \ DMUB_SR(MMHUBBUB_SOFT_RESET) \
DMUB_SR(DCN_VM_FB_LOCATION_BASE) \ DMUB_SR(DCN_VM_FB_LOCATION_BASE) \
DMUB_SR(DCN_VM_FB_OFFSET) \ 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() \ #define DMUB_COMMON_FIELDS() \
DMUB_SF(DMCUB_CNTL, DMCUB_ENABLE) \ DMUB_SF(DMCUB_CNTL, DMCUB_ENABLE) \
...@@ -231,4 +232,6 @@ bool dmub_dcn20_use_cached_inbox(struct dmub_srv *dmub); ...@@ -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); 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_ */ #endif /* _DMUB_DCN20_H_ */
...@@ -159,6 +159,7 @@ static bool dmub_srv_hw_setup(struct dmub_srv *dmub, enum dmub_asic asic) ...@@ -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->get_fw_status = dmub_dcn20_get_fw_boot_status;
funcs->enable_dmub_boot_options = dmub_dcn20_enable_dmub_boot_options; 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->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 // Out mailbox register access functions for RN and above
funcs->setup_out_mailbox = dmub_dcn20_setup_out_mailbox; funcs->setup_out_mailbox = dmub_dcn20_setup_out_mailbox;
......
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