drm/amd/display: replay: Augment Frameupdate Command
authorMax Tseng <max.tseng@amd.com>
Wed, 8 Nov 2023 03:31:50 +0000 (11:31 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 29 Nov 2023 21:48:59 +0000 (16:48 -0500)
[Why]
Sending certain Frameupdate number for Replay Power Evaluation

Reviewed-by: Dennis Chan <dennis.chan@amd.com>
Acked-by: Hamza Mahfooz <hamza.mahfooz@amd.com>
Signed-off-by: Max Tseng <max.tseng@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/dc_types.h
drivers/gpu/drm/amd/display/dc/dce/dmub_replay.h
drivers/gpu/drm/amd/display/dc/link/protocols/link_edp_panel_control.c
drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h

index 6f5da510e8de91fc78e272a327a93b1e45ac45d1..4a60d2c4768640cf65c064ac3dd812ecfad3e202 100644 (file)
@@ -1031,6 +1031,7 @@ enum replay_coasting_vtotal_type {
 enum replay_FW_Message_type {
        Replay_Msg_Not_Support = -1,
        Replay_Set_Timing_Sync_Supported,
+       Replay_Set_Residency_Frameupdate_Timer,
 };
 
 union replay_error_status {
index 368711f763350d615b9556ce1ba08b2db2ddd82d..b3ee90a0b8b3d28e3115ff4497a20098d9369670 100644 (file)
@@ -46,7 +46,7 @@ struct dmub_replay_funcs {
        void (*replay_set_power_opt)(struct dmub_replay *dmub, unsigned int power_opt,
                uint8_t panel_inst);
        void (*replay_send_cmd)(struct dmub_replay *dmub,
-               enum replay_FW_Message_type msg, unsigned int panel_inst, union dmub_replay_cmd_set *cmd_element);
+               enum replay_FW_Message_type msg, union dmub_replay_cmd_set *cmd_element);
        void (*replay_set_coasting_vtotal)(struct dmub_replay *dmub, uint16_t coasting_vtotal,
                uint8_t panel_inst);
        void (*replay_residency)(struct dmub_replay *dmub,
index 6bc8ec47e267f227c68a850f0d89309b4661da62..fdeb8dff5485ad03361d67a1cef884f41cf28ed3 100644 (file)
@@ -1023,10 +1023,16 @@ bool edp_send_replay_cmd(struct dc_link *link,
        if (!replay)
                return false;
 
-       if (!dc_get_edp_link_panel_inst(dc, link, &panel_inst))
+       DC_LOGGER_INIT(link->ctx->logger);
+
+       if (dc_get_edp_link_panel_inst(dc, link, &panel_inst))
+               cmd_data->panel_inst = panel_inst;
+       else {
+               DC_LOG_DC("%s(): get edp panel inst fail ", __func__);
                return false;
+       }
 
-       replay->funcs->replay_send_cmd(replay, msg, panel_inst, cmd_data);
+       replay->funcs->replay_send_cmd(replay, msg, cmd_data);
 
        return true;
 }
index 5f06cf4c663f9468b8c4c0ea88739e38f879c929..d1becbb5aa2927bc191dcb5eb43a6370fb3a3591 100644 (file)
@@ -2880,6 +2880,10 @@ enum dmub_cmd_replay_type {
         * Set disabled iiming sync.
         */
        DMUB_CMD__REPLAY_SET_TIMING_SYNC_SUPPORTED      = 5,
+       /**
+        * Set Residency Frameupdate Timer.
+        */
+       DMUB_CMD__REPLAY_SET_RESIDENCY_FRAMEUPDATE_TIMER = 6,
 };
 
 /**
@@ -3143,14 +3147,57 @@ struct dmub_rb_cmd_replay_set_timing_sync {
        struct dmub_cmd_replay_set_timing_sync_data replay_set_timing_sync_data;
 };
 
+/**
+ * Data passed from driver to FW in  DMUB_CMD__REPLAY_SET_RESIDENCY_FRAMEUPDATE_TIMER command.
+ */
+struct dmub_cmd_replay_frameupdate_timer_data {
+       /**
+        * Panel Instance.
+        * Panel isntance to identify which replay_state to use
+        * Currently the support is only for 0 or 1
+        */
+       uint8_t panel_inst;
+       /**
+        * Replay Frameupdate Timer Enable or not
+        */
+       uint8_t enable;
+       /**
+        * REPLAY force reflash frame update number
+        */
+       uint16_t frameupdate_count;
+};
+/**
+ * Definition of DMUB_CMD__REPLAY_SET_RESIDENCY_FRAMEUPDATE_TIMER
+ */
+struct dmub_rb_cmd_replay_set_frameupdate_timer {
+       /**
+        * Command header.
+        */
+       struct dmub_cmd_header header;
+       /**
+        * Definition of a DMUB_CMD__SET_REPLAY_POWER_OPT command.
+        */
+       struct dmub_cmd_replay_frameupdate_timer_data data;
+};
+
 /**
  * Definition union of replay command set
  */
 union dmub_replay_cmd_set {
+       /**
+        * Panel Instance.
+        * Panel isntance to identify which replay_state to use
+        * Currently the support is only for 0 or 1
+        */
+       uint8_t panel_inst;
        /**
         * Definition of DMUB_CMD__REPLAY_SET_TIMING_SYNC_SUPPORTED command data.
         */
        struct dmub_cmd_replay_set_timing_sync_data sync_data;
+       /**
+        * Definition of DMUB_CMD__REPLAY_SET_RESIDENCY_FRAMEUPDATE_TIMER command data.
+        */
+       struct dmub_cmd_replay_frameupdate_timer_data timer_data;
 };
 
 /**
@@ -4288,6 +4335,10 @@ union dmub_rb_cmd {
        struct dmub_rb_cmd_replay_set_power_opt_and_coasting_vtotal replay_set_power_opt_and_coasting_vtotal;
 
        struct dmub_rb_cmd_replay_set_timing_sync replay_set_timing_sync;
+       /**
+        * Definition of a DMUB_CMD__REPLAY_SET_RESIDENCY_FRAMEUPDATE_TIMER command.
+        */
+       struct dmub_rb_cmd_replay_set_frameupdate_timer replay_set_frameupdate_timer;
 };
 
 /**