drm/amd/display: replay: generalize the send command function usage
authorMax Tseng <max.tseng@amd.com>
Tue, 7 Nov 2023 07:00:03 +0000 (15:00 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 29 Nov 2023 21:48:59 +0000 (16:48 -0500)
Augment the function to allow send different format data in different
use case.

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/inc/link.h
drivers/gpu/drm/amd/display/dc/link/protocols/link_edp_panel_control.c
drivers/gpu/drm/amd/display/dc/link/protocols/link_edp_panel_control.h
drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h

index edf60c4f318cc18fd5c6fcc1c25c810fa200e4f1..6f5da510e8de91fc78e272a327a93b1e45ac45d1 100644 (file)
@@ -1029,6 +1029,7 @@ enum replay_coasting_vtotal_type {
  * passed to DMUB.
  */
 enum replay_FW_Message_type {
+       Replay_Msg_Not_Support = -1,
        Replay_Set_Timing_Sync_Supported,
 };
 
index 427bc47a676e6c44f6cb329634810bd40a419b59..368711f763350d615b9556ce1ba08b2db2ddd82d 100644 (file)
@@ -46,8 +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,
-               uint32_t cmd_data);
+               enum replay_FW_Message_type msg, unsigned int panel_inst, 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 dd3f53151d8b8cc589853853900d1cdacb106045..7439865d1b50c467fe6af1f0148f31d9cb423a61 100644 (file)
@@ -283,7 +283,7 @@ struct link_service {
                        const struct dc_stream_state *stream);
        bool (*edp_send_replay_cmd)(struct dc_link *link,
                        enum replay_FW_Message_type msg,
-                       uint32_t params);
+                       union dmub_replay_cmd_set *cmd_data);
        bool (*edp_set_coasting_vtotal)(
                        struct dc_link *link, uint16_t coasting_vtotal);
        bool (*edp_replay_residency)(const struct dc_link *link,
index c52b51b2b4b389c3123213b01443a2bd27519dcf..6bc8ec47e267f227c68a850f0d89309b4661da62 100644 (file)
@@ -1014,7 +1014,7 @@ bool edp_setup_replay(struct dc_link *link, const struct dc_stream_state *stream
  */
 bool edp_send_replay_cmd(struct dc_link *link,
                        enum replay_FW_Message_type msg,
-                       uint32_t cmd_data)
+                       union dmub_replay_cmd_set *cmd_data)
 {
        struct dc *dc = link->ctx->dc;
        struct dmub_replay *replay = dc->res_pool->replay;
@@ -1026,7 +1026,7 @@ bool edp_send_replay_cmd(struct dc_link *link,
        if (!dc_get_edp_link_panel_inst(dc, link, &panel_inst))
                return false;
 
-       replay->funcs->replay_send_cmd(replay, msg, cmd_data, panel_inst);
+       replay->funcs->replay_send_cmd(replay, msg, panel_inst, cmd_data);
 
        return true;
 }
index 6b223580ac8a79245db95cbaf1cd433438bbc1fa..39526bd401782b6143aeb9a15e92adf53fc24534 100644 (file)
@@ -59,7 +59,7 @@ bool edp_setup_replay(struct dc_link *link,
                const struct dc_stream_state *stream);
 bool edp_send_replay_cmd(struct dc_link *link,
                        enum replay_FW_Message_type msg,
-                       uint32_t params);
+                       union dmub_replay_cmd_set *cmd_data);
 bool edp_set_coasting_vtotal(struct dc_link *link, uint16_t coasting_vtotal);
 bool edp_replay_residency(const struct dc_link *link,
        unsigned int *residency, const bool is_start, const bool is_alpm);
index 55573083bc31ce0a3a3ac038212aac04e8942637..5f06cf4c663f9468b8c4c0ea88739e38f879c929 100644 (file)
@@ -3143,6 +3143,16 @@ struct dmub_rb_cmd_replay_set_timing_sync {
        struct dmub_cmd_replay_set_timing_sync_data replay_set_timing_sync_data;
 };
 
+/**
+ * Definition union of replay command set
+ */
+union dmub_replay_cmd_set {
+       /**
+        * Definition of DMUB_CMD__REPLAY_SET_TIMING_SYNC_SUPPORTED command data.
+        */
+       struct dmub_cmd_replay_set_timing_sync_data sync_data;
+};
+
 /**
  * Set of HW components that can be locked.
  *