mirror of
https://github.com/torvalds/linux.git
synced 2026-06-01 19:13:47 +02:00
drm/amd/pm: Use cached gpu metrics table
If cached gpu metrics table is available, return it directly. Also, deprecate gpu_metrics_table variables as they are no longer used. Signed-off-by: Lijo Lazar <lijo.lazar@amd.com> Reviewed-by: Asad Kamal <asad.kamal@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
parent
618c144145
commit
34d6599748
|
|
@ -3659,6 +3659,9 @@ static int smu_get_dpm_clock_table(void *handle,
|
|||
static ssize_t smu_sys_get_gpu_metrics(void *handle, void **table)
|
||||
{
|
||||
struct smu_context *smu = handle;
|
||||
struct smu_table_context *smu_table = &smu->smu_table;
|
||||
struct smu_driver_table *driver_tables = smu_table->driver_tables;
|
||||
struct smu_driver_table *gpu_metrics_table;
|
||||
|
||||
if (!smu->pm_enabled || !smu->adev->pm.dpm_enabled)
|
||||
return -EOPNOTSUPP;
|
||||
|
|
@ -3666,6 +3669,14 @@ static ssize_t smu_sys_get_gpu_metrics(void *handle, void **table)
|
|||
if (!smu->ppt_funcs->get_gpu_metrics)
|
||||
return -EOPNOTSUPP;
|
||||
|
||||
gpu_metrics_table = &driver_tables[SMU_DRIVER_TABLE_GPU_METRICS];
|
||||
|
||||
/* If cached table is valid, return it */
|
||||
if (smu_driver_table_is_valid(gpu_metrics_table)) {
|
||||
*table = gpu_metrics_table->cache.buffer;
|
||||
return gpu_metrics_table->cache.size;
|
||||
}
|
||||
|
||||
return smu->ppt_funcs->get_gpu_metrics(smu, table);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -414,9 +414,6 @@ struct smu_table_context {
|
|||
void *boot_overdrive_table;
|
||||
void *user_overdrive_table;
|
||||
|
||||
uint32_t gpu_metrics_table_size;
|
||||
void *gpu_metrics_table;
|
||||
|
||||
struct smu_driver_table driver_tables[SMU_DRIVER_TABLE_COUNT];
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user