]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
drm/amd/display: Add replay desync error count tracking and reset functionality
authorJack Chang <jack.chang@amd.com>
Mon, 16 Dec 2024 07:02:08 +0000 (15:02 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 10 Jan 2025 16:59:37 +0000 (11:59 -0500)
[Why & How]
Build-up get/reset desync error count interface and implement the functions.

Reviewed-by: ChunTao Tso <chuntao.tso@amd.com>
Reviewed-by: Robin Chen <robin.chen@amd.com>
Signed-off-by: Jack Chang <jack.chang@amd.com>
Signed-off-by: Tom Chung <chiahsuan.chung@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/dc/link/protocols/link_dp_irq_handler.c
drivers/gpu/drm/amd/display/modules/power/power_helpers.c
drivers/gpu/drm/amd/display/modules/power/power_helpers.h

index ff5b162f3916988681f535d6a0df640ed36e2668..0aef2d84c3a43d9033d062e1f91477c24a8a6b70 100644 (file)
@@ -1147,6 +1147,8 @@ struct replay_settings {
        uint16_t abm_with_ips_on_full_screen_video_pseudo_vtotal;
        /* Replay last pseudo vtotal set to DMUB */
        uint16_t last_pseudo_vtotal;
+       /* Replay desync error */
+       uint32_t replay_desync_error_fail_count;
 };
 
 /* To split out "global" and "per-panel" config settings.
index ae47bb5975af8b094ac36db7c5106287bae9ce33..a08403c022eae2e30b274ad6f965d62b55f703b8 100644 (file)
@@ -239,6 +239,9 @@ static void handle_hpd_irq_replay_sink(struct dc_link *link)
                        &replay_configuration.raw,
                        sizeof(replay_configuration.raw));
 
+               /* Update desync error counter */
+               link->replay_settings.replay_desync_error_fail_count++;
+
                /* Acknowledge and clear error bits */
                dm_helpers_dp_write_dpcd(
                        link->ctx,
index 95838c7ab05431277075d5788307e0ea6f3b3492..f4b86a63f25d95cdb6a2dcddf10e5408ae168880 100644 (file)
@@ -1039,3 +1039,8 @@ bool fill_custom_backlight_caps(unsigned int config_no, struct dm_acpi_atif_back
        memcpy(caps->data_points, custom_backlight_profiles[config_no].data_points, data_points_size);
        return true;
 }
+
+void reset_replay_dsync_error_count(struct dc_link *link)
+{
+       link->replay_settings.replay_desync_error_fail_count = 0;
+}
index cac302e8fa1031cd6473b59ab3ca1b7f483eb612..94ade0ef18a3af46a6b66f2b6d771329bc6607fa 100644 (file)
@@ -78,4 +78,5 @@ bool psr_su_set_dsc_slice_height(struct dc *dc, struct dc_link *link,
 
 bool fill_custom_backlight_caps(unsigned int config_no,
                struct dm_acpi_atif_backlight_caps *caps);
+void reset_replay_dsync_error_count(struct dc_link *link);
 #endif /* MODULES_POWER_POWER_HELPERS_H_ */