drm/amd/display: Fix nanosec stat overflow
authorAric Cyr <aric.cyr@amd.com>
Thu, 29 Aug 2019 15:53:52 +0000 (11:53 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 22 Feb 2024 15:26:15 +0000 (10:26 -0500)
[Why]
Nanosec stats can overflow on long running systems potentially causing
statistic logging issues.

[How]
Use 64bit types for nanosec stats to ensure no overflow.

Reviewed-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Aric Cyr <aric.cyr@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/modules/inc/mod_stats.h

index 5960dd760e91c8060c874e11c5a50c83671f05ab..8ce6c22e5d04129c4e49e0c4724bc344142f4afb 100644 (file)
@@ -57,10 +57,10 @@ void mod_stats_update_event(struct mod_stats *mod_stats,
                unsigned int length);
 
 void mod_stats_update_flip(struct mod_stats *mod_stats,
-               unsigned long timestamp_in_ns);
+               unsigned long long timestamp_in_ns);
 
 void mod_stats_update_vupdate(struct mod_stats *mod_stats,
-               unsigned long timestamp_in_ns);
+               unsigned long long timestamp_in_ns);
 
 void mod_stats_update_freesync(struct mod_stats *mod_stats,
                unsigned int v_total_min,