drm/amd/display: Introduce deferred Replay coasting vtotal update
authorChunTao Tso <chuntao.tso@amd.com>
Mon, 13 May 2024 05:48:19 +0000 (13:48 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 14 Jun 2024 19:34:02 +0000 (15:34 -0400)
Add functions to defer updating of coasting vtotal after source refresh rate update.

Reviewed-by: Robin Chen <robin.chen@amd.com>
Acked-by: Zaeem Mohamed <zaeem.mohamed@amd.com>
Signed-off-by: ChunTao Tso <chuntao.tso@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/dc_types.h
drivers/gpu/drm/amd/display/modules/power/power_helpers.c
drivers/gpu/drm/amd/display/modules/power/power_helpers.h

index cee012587e6e465dde3a3eebbf985d1b26e245af..21f4af9ab096f2e96da44ab028370e5fb38f636e 100644 (file)
@@ -1091,6 +1091,8 @@ struct replay_settings {
        uint32_t coasting_vtotal;
        /* Coasting vtotal table */
        uint32_t coasting_vtotal_table[PR_COASTING_TYPE_NUM];
+       /* Defer Update Coasting vtotal table */
+       uint32_t defer_update_coasting_vtotal_table[PR_COASTING_TYPE_NUM];
        /* Maximum link off frame count */
        uint32_t link_off_frame_count;
        /* Replay pseudo vtotal for abm + ips on full screen video which can improve ips residency */
index 530379508a696d13ac145123eb743e8d0ba6db34..3cd52e7a9c77c289bb5f234bd0072f2beeb9b59b 100644 (file)
@@ -973,6 +973,20 @@ bool psr_su_set_dsc_slice_height(struct dc *dc, struct dc_link *link,
        return true;
 }
 
+void set_replay_defer_update_coasting_vtotal(struct dc_link *link,
+       enum replay_coasting_vtotal_type type,
+       uint32_t vtotal)
+{
+       link->replay_settings.defer_update_coasting_vtotal_table[type] = vtotal;
+}
+
+void update_replay_coasting_vtotal_from_defer(struct dc_link *link,
+       enum replay_coasting_vtotal_type type)
+{
+       link->replay_settings.coasting_vtotal_table[type] =
+               link->replay_settings.defer_update_coasting_vtotal_table[type];
+}
+
 void set_replay_coasting_vtotal(struct dc_link *link,
        enum replay_coasting_vtotal_type type,
        uint32_t vtotal)
index ff7e6f3cd6be230b95755188043e76b8041db121..cac302e8fa1031cd6473b59ab3ca1b7f483eb612 100644 (file)
@@ -57,6 +57,11 @@ void init_replay_config(struct dc_link *link, struct replay_config *pr_config);
 void set_replay_coasting_vtotal(struct dc_link *link,
        enum replay_coasting_vtotal_type type,
        uint32_t vtotal);
+void set_replay_defer_update_coasting_vtotal(struct dc_link *link,
+       enum replay_coasting_vtotal_type type,
+       uint32_t vtotal);
+void update_replay_coasting_vtotal_from_defer(struct dc_link *link,
+       enum replay_coasting_vtotal_type type);
 void set_replay_ips_full_screen_video_src_vtotal(struct dc_link *link, uint16_t vtotal);
 void calculate_replay_link_off_frame_count(struct dc_link *link,
        uint16_t vtotal, uint16_t htotal);