OSDN Git Service

drm/amd/display: Add get_current_time interface to dmub_srv
authorWyatt Wood <wyatt.wood@amd.com>
Tue, 19 Jan 2021 22:05:05 +0000 (17:05 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 20 May 2021 02:38:42 +0000 (22:38 -0400)
[Why]
Need to get current DMUB time.

[How]
Add get_current_time interface to dmub_srv.

v2: drop whitespace changes (Alex)

Signed-off-by: Wyatt Wood <wyatt.wood@amd.com>
Reviewed-by: Aric Cyr <Aric.Cyr@amd.com>
Acked-by: Stylon Wang <stylon.wang@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/core/dc.c
drivers/gpu/drm/amd/display/dmub/dmub_srv.h
drivers/gpu/drm/amd/display/dmub/src/dmub_dcn20.c
drivers/gpu/drm/amd/display/dmub/src/dmub_dcn20.h
drivers/gpu/drm/amd/display/dmub/src/dmub_srv.c

index d6f11db..ef157b8 100644 (file)
@@ -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)
index 3ef6b53..deff333 100644 (file)
@@ -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);
 };
 
 /**
index b11f530..8cdc1c7 100644 (file)
@@ -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);
+}
index 42d610a..f772f8b 100644 (file)
@@ -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_ */
index ed9fa61..fa89ada 100644 (file)
@@ -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;