]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
drm/amd/pm: Update energy_accumulator in gpu metrics
authorHarish Kasiviswanathan <Harish.Kasiviswanathan@amd.com>
Fri, 23 Apr 2021 18:57:55 +0000 (14:57 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 29 Apr 2021 03:35:49 +0000 (23:35 -0400)
Now that it is available.

v2: squash in typecast fix (Alex)

Signed-off-by: Harish Kasiviswanathan <Harish.Kasiviswanathan@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c

index dcbe3a72da093a19322396e4746abee5d61ad228..771e2f0acdd34d04c8cc42ec757e0718c14b19f3 100644 (file)
@@ -1657,7 +1657,9 @@ static ssize_t aldebaran_get_gpu_metrics(struct smu_context *smu,
        gpu_metrics->average_mm_activity = 0;
 
        gpu_metrics->average_socket_power = metrics.AverageSocketPower;
-       gpu_metrics->energy_accumulator = 0;
+       gpu_metrics->energy_accumulator =
+                       (uint64_t)metrics.EnergyAcc64bitHigh << 32 |
+                       metrics.EnergyAcc64bitLow;
 
        gpu_metrics->average_gfxclk_frequency = metrics.AverageGfxclkFrequency;
        gpu_metrics->average_socclk_frequency = metrics.AverageSocclkFrequency;