Commit 152bb95c authored by Evan Quan's avatar Evan Quan Committed by Alex Deucher

drm/amd/pm: update existing gpu_metrics interfaces V2

Update the gpu_metrics interface implementations to use the latest
upgraded data structures.

V2: fit the data type change of energy_accumulator
Signed-off-by: default avatarEvan Quan <evan.quan@amd.com>
Reviewed-by: default avatarLijo Lazar <lijo.lazar@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 2ce13b01
...@@ -61,8 +61,8 @@ ...@@ -61,8 +61,8 @@
#define LINK_WIDTH_MAX 6 #define LINK_WIDTH_MAX 6
#define LINK_SPEED_MAX 3 #define LINK_SPEED_MAX 3
static __maybe_unused uint8_t link_width[] = {0, 1, 2, 4, 8, 12, 16}; static __maybe_unused uint16_t link_width[] = {0, 1, 2, 4, 8, 12, 16};
static __maybe_unused uint8_t link_speed[] = {25, 50, 80, 160}; static __maybe_unused uint16_t link_speed[] = {25, 50, 80, 160};
static const static const
struct smu_temperature_range __maybe_unused smu11_thermal_policy[] = struct smu_temperature_range __maybe_unused smu11_thermal_policy[] =
...@@ -281,11 +281,11 @@ int smu_v11_0_get_dpm_level_range(struct smu_context *smu, ...@@ -281,11 +281,11 @@ int smu_v11_0_get_dpm_level_range(struct smu_context *smu,
int smu_v11_0_get_current_pcie_link_width_level(struct smu_context *smu); int smu_v11_0_get_current_pcie_link_width_level(struct smu_context *smu);
uint8_t smu_v11_0_get_current_pcie_link_width(struct smu_context *smu); uint16_t smu_v11_0_get_current_pcie_link_width(struct smu_context *smu);
int smu_v11_0_get_current_pcie_link_speed_level(struct smu_context *smu); int smu_v11_0_get_current_pcie_link_speed_level(struct smu_context *smu);
uint8_t smu_v11_0_get_current_pcie_link_speed(struct smu_context *smu); uint16_t smu_v11_0_get_current_pcie_link_speed(struct smu_context *smu);
int smu_v11_0_gfx_ulv_control(struct smu_context *smu, int smu_v11_0_gfx_ulv_control(struct smu_context *smu,
bool enablement); bool enablement);
......
...@@ -236,7 +236,7 @@ static int arcturus_tables_init(struct smu_context *smu) ...@@ -236,7 +236,7 @@ static int arcturus_tables_init(struct smu_context *smu)
return -ENOMEM; return -ENOMEM;
smu_table->metrics_time = 0; smu_table->metrics_time = 0;
smu_table->gpu_metrics_table_size = sizeof(struct gpu_metrics_v1_0); smu_table->gpu_metrics_table_size = sizeof(struct gpu_metrics_v1_1);
smu_table->gpu_metrics_table = kzalloc(smu_table->gpu_metrics_table_size, GFP_KERNEL); smu_table->gpu_metrics_table = kzalloc(smu_table->gpu_metrics_table_size, GFP_KERNEL);
if (!smu_table->gpu_metrics_table) { if (!smu_table->gpu_metrics_table) {
kfree(smu_table->metrics_table); kfree(smu_table->metrics_table);
...@@ -2211,7 +2211,7 @@ static void arcturus_log_thermal_throttling_event(struct smu_context *smu) ...@@ -2211,7 +2211,7 @@ static void arcturus_log_thermal_throttling_event(struct smu_context *smu)
kgd2kfd_smi_event_throttle(smu->adev->kfd.dev, throttler_status); kgd2kfd_smi_event_throttle(smu->adev->kfd.dev, throttler_status);
} }
static int arcturus_get_current_pcie_link_speed(struct smu_context *smu) static uint16_t arcturus_get_current_pcie_link_speed(struct smu_context *smu)
{ {
struct amdgpu_device *adev = smu->adev; struct amdgpu_device *adev = smu->adev;
uint32_t esm_ctrl; uint32_t esm_ctrl;
...@@ -2219,7 +2219,7 @@ static int arcturus_get_current_pcie_link_speed(struct smu_context *smu) ...@@ -2219,7 +2219,7 @@ static int arcturus_get_current_pcie_link_speed(struct smu_context *smu)
/* TODO: confirm this on real target */ /* TODO: confirm this on real target */
esm_ctrl = RREG32_PCIE(smnPCIE_ESM_CTRL); esm_ctrl = RREG32_PCIE(smnPCIE_ESM_CTRL);
if ((esm_ctrl >> 15) & 0x1FFFF) if ((esm_ctrl >> 15) & 0x1FFFF)
return (((esm_ctrl >> 8) & 0x3F) + 128); return (uint16_t)(((esm_ctrl >> 8) & 0x3F) + 128);
return smu_v11_0_get_current_pcie_link_speed(smu); return smu_v11_0_get_current_pcie_link_speed(smu);
} }
...@@ -2228,8 +2228,8 @@ static ssize_t arcturus_get_gpu_metrics(struct smu_context *smu, ...@@ -2228,8 +2228,8 @@ static ssize_t arcturus_get_gpu_metrics(struct smu_context *smu,
void **table) void **table)
{ {
struct smu_table_context *smu_table = &smu->smu_table; struct smu_table_context *smu_table = &smu->smu_table;
struct gpu_metrics_v1_0 *gpu_metrics = struct gpu_metrics_v1_1 *gpu_metrics =
(struct gpu_metrics_v1_0 *)smu_table->gpu_metrics_table; (struct gpu_metrics_v1_1 *)smu_table->gpu_metrics_table;
SmuMetrics_t metrics; SmuMetrics_t metrics;
int ret = 0; int ret = 0;
...@@ -2239,7 +2239,7 @@ static ssize_t arcturus_get_gpu_metrics(struct smu_context *smu, ...@@ -2239,7 +2239,7 @@ static ssize_t arcturus_get_gpu_metrics(struct smu_context *smu,
if (ret) if (ret)
return ret; return ret;
smu_cmn_init_soft_gpu_metrics(gpu_metrics, 1, 0); smu_cmn_init_soft_gpu_metrics(gpu_metrics, 1, 1);
gpu_metrics->temperature_edge = metrics.TemperatureEdge; gpu_metrics->temperature_edge = metrics.TemperatureEdge;
gpu_metrics->temperature_hotspot = metrics.TemperatureHotspot; gpu_metrics->temperature_hotspot = metrics.TemperatureHotspot;
...@@ -2280,7 +2280,7 @@ static ssize_t arcturus_get_gpu_metrics(struct smu_context *smu, ...@@ -2280,7 +2280,7 @@ static ssize_t arcturus_get_gpu_metrics(struct smu_context *smu,
*table = (void *)gpu_metrics; *table = (void *)gpu_metrics;
return sizeof(struct gpu_metrics_v1_0); return sizeof(struct gpu_metrics_v1_1);
} }
static const struct pptable_funcs arcturus_ppt_funcs = { static const struct pptable_funcs arcturus_ppt_funcs = {
......
...@@ -481,7 +481,7 @@ static int navi10_tables_init(struct smu_context *smu) ...@@ -481,7 +481,7 @@ static int navi10_tables_init(struct smu_context *smu)
goto err0_out; goto err0_out;
smu_table->metrics_time = 0; smu_table->metrics_time = 0;
smu_table->gpu_metrics_table_size = sizeof(struct gpu_metrics_v1_0); smu_table->gpu_metrics_table_size = sizeof(struct gpu_metrics_v1_1);
smu_table->gpu_metrics_table = kzalloc(smu_table->gpu_metrics_table_size, GFP_KERNEL); smu_table->gpu_metrics_table = kzalloc(smu_table->gpu_metrics_table_size, GFP_KERNEL);
if (!smu_table->gpu_metrics_table) if (!smu_table->gpu_metrics_table)
goto err1_out; goto err1_out;
...@@ -2600,8 +2600,8 @@ static ssize_t navi10_get_legacy_gpu_metrics(struct smu_context *smu, ...@@ -2600,8 +2600,8 @@ static ssize_t navi10_get_legacy_gpu_metrics(struct smu_context *smu,
void **table) void **table)
{ {
struct smu_table_context *smu_table = &smu->smu_table; struct smu_table_context *smu_table = &smu->smu_table;
struct gpu_metrics_v1_0 *gpu_metrics = struct gpu_metrics_v1_1 *gpu_metrics =
(struct gpu_metrics_v1_0 *)smu_table->gpu_metrics_table; (struct gpu_metrics_v1_1 *)smu_table->gpu_metrics_table;
SmuMetrics_legacy_t metrics; SmuMetrics_legacy_t metrics;
int ret = 0; int ret = 0;
...@@ -2619,7 +2619,7 @@ static ssize_t navi10_get_legacy_gpu_metrics(struct smu_context *smu, ...@@ -2619,7 +2619,7 @@ static ssize_t navi10_get_legacy_gpu_metrics(struct smu_context *smu,
mutex_unlock(&smu->metrics_lock); mutex_unlock(&smu->metrics_lock);
smu_cmn_init_soft_gpu_metrics(gpu_metrics, 1, 0); smu_cmn_init_soft_gpu_metrics(gpu_metrics, 1, 1);
gpu_metrics->temperature_edge = metrics.TemperatureEdge; gpu_metrics->temperature_edge = metrics.TemperatureEdge;
gpu_metrics->temperature_hotspot = metrics.TemperatureHotspot; gpu_metrics->temperature_hotspot = metrics.TemperatureHotspot;
...@@ -2656,15 +2656,15 @@ static ssize_t navi10_get_legacy_gpu_metrics(struct smu_context *smu, ...@@ -2656,15 +2656,15 @@ static ssize_t navi10_get_legacy_gpu_metrics(struct smu_context *smu,
*table = (void *)gpu_metrics; *table = (void *)gpu_metrics;
return sizeof(struct gpu_metrics_v1_0); return sizeof(struct gpu_metrics_v1_1);
} }
static ssize_t navi10_get_gpu_metrics(struct smu_context *smu, static ssize_t navi10_get_gpu_metrics(struct smu_context *smu,
void **table) void **table)
{ {
struct smu_table_context *smu_table = &smu->smu_table; struct smu_table_context *smu_table = &smu->smu_table;
struct gpu_metrics_v1_0 *gpu_metrics = struct gpu_metrics_v1_1 *gpu_metrics =
(struct gpu_metrics_v1_0 *)smu_table->gpu_metrics_table; (struct gpu_metrics_v1_1 *)smu_table->gpu_metrics_table;
SmuMetrics_t metrics; SmuMetrics_t metrics;
int ret = 0; int ret = 0;
...@@ -2682,7 +2682,7 @@ static ssize_t navi10_get_gpu_metrics(struct smu_context *smu, ...@@ -2682,7 +2682,7 @@ static ssize_t navi10_get_gpu_metrics(struct smu_context *smu,
mutex_unlock(&smu->metrics_lock); mutex_unlock(&smu->metrics_lock);
smu_cmn_init_soft_gpu_metrics(gpu_metrics, 1, 0); smu_cmn_init_soft_gpu_metrics(gpu_metrics, 1, 1);
gpu_metrics->temperature_edge = metrics.TemperatureEdge; gpu_metrics->temperature_edge = metrics.TemperatureEdge;
gpu_metrics->temperature_hotspot = metrics.TemperatureHotspot; gpu_metrics->temperature_hotspot = metrics.TemperatureHotspot;
...@@ -2721,15 +2721,15 @@ static ssize_t navi10_get_gpu_metrics(struct smu_context *smu, ...@@ -2721,15 +2721,15 @@ static ssize_t navi10_get_gpu_metrics(struct smu_context *smu,
*table = (void *)gpu_metrics; *table = (void *)gpu_metrics;
return sizeof(struct gpu_metrics_v1_0); return sizeof(struct gpu_metrics_v1_1);
} }
static ssize_t navi12_get_legacy_gpu_metrics(struct smu_context *smu, static ssize_t navi12_get_legacy_gpu_metrics(struct smu_context *smu,
void **table) void **table)
{ {
struct smu_table_context *smu_table = &smu->smu_table; struct smu_table_context *smu_table = &smu->smu_table;
struct gpu_metrics_v1_0 *gpu_metrics = struct gpu_metrics_v1_1 *gpu_metrics =
(struct gpu_metrics_v1_0 *)smu_table->gpu_metrics_table; (struct gpu_metrics_v1_1 *)smu_table->gpu_metrics_table;
SmuMetrics_NV12_legacy_t metrics; SmuMetrics_NV12_legacy_t metrics;
int ret = 0; int ret = 0;
...@@ -2747,7 +2747,7 @@ static ssize_t navi12_get_legacy_gpu_metrics(struct smu_context *smu, ...@@ -2747,7 +2747,7 @@ static ssize_t navi12_get_legacy_gpu_metrics(struct smu_context *smu,
mutex_unlock(&smu->metrics_lock); mutex_unlock(&smu->metrics_lock);
smu_cmn_init_soft_gpu_metrics(gpu_metrics, 1, 0); smu_cmn_init_soft_gpu_metrics(gpu_metrics, 1, 1);
gpu_metrics->temperature_edge = metrics.TemperatureEdge; gpu_metrics->temperature_edge = metrics.TemperatureEdge;
gpu_metrics->temperature_hotspot = metrics.TemperatureHotspot; gpu_metrics->temperature_hotspot = metrics.TemperatureHotspot;
...@@ -2789,15 +2789,15 @@ static ssize_t navi12_get_legacy_gpu_metrics(struct smu_context *smu, ...@@ -2789,15 +2789,15 @@ static ssize_t navi12_get_legacy_gpu_metrics(struct smu_context *smu,
*table = (void *)gpu_metrics; *table = (void *)gpu_metrics;
return sizeof(struct gpu_metrics_v1_0); return sizeof(struct gpu_metrics_v1_1);
} }
static ssize_t navi12_get_gpu_metrics(struct smu_context *smu, static ssize_t navi12_get_gpu_metrics(struct smu_context *smu,
void **table) void **table)
{ {
struct smu_table_context *smu_table = &smu->smu_table; struct smu_table_context *smu_table = &smu->smu_table;
struct gpu_metrics_v1_0 *gpu_metrics = struct gpu_metrics_v1_1 *gpu_metrics =
(struct gpu_metrics_v1_0 *)smu_table->gpu_metrics_table; (struct gpu_metrics_v1_1 *)smu_table->gpu_metrics_table;
SmuMetrics_NV12_t metrics; SmuMetrics_NV12_t metrics;
int ret = 0; int ret = 0;
...@@ -2815,7 +2815,7 @@ static ssize_t navi12_get_gpu_metrics(struct smu_context *smu, ...@@ -2815,7 +2815,7 @@ static ssize_t navi12_get_gpu_metrics(struct smu_context *smu,
mutex_unlock(&smu->metrics_lock); mutex_unlock(&smu->metrics_lock);
smu_cmn_init_soft_gpu_metrics(gpu_metrics, 1, 0); smu_cmn_init_soft_gpu_metrics(gpu_metrics, 1, 1);
gpu_metrics->temperature_edge = metrics.TemperatureEdge; gpu_metrics->temperature_edge = metrics.TemperatureEdge;
gpu_metrics->temperature_hotspot = metrics.TemperatureHotspot; gpu_metrics->temperature_hotspot = metrics.TemperatureHotspot;
...@@ -2859,7 +2859,7 @@ static ssize_t navi12_get_gpu_metrics(struct smu_context *smu, ...@@ -2859,7 +2859,7 @@ static ssize_t navi12_get_gpu_metrics(struct smu_context *smu,
*table = (void *)gpu_metrics; *table = (void *)gpu_metrics;
return sizeof(struct gpu_metrics_v1_0); return sizeof(struct gpu_metrics_v1_1);
} }
static ssize_t navi1x_get_gpu_metrics(struct smu_context *smu, static ssize_t navi1x_get_gpu_metrics(struct smu_context *smu,
......
...@@ -416,7 +416,7 @@ static int sienna_cichlid_tables_init(struct smu_context *smu) ...@@ -416,7 +416,7 @@ static int sienna_cichlid_tables_init(struct smu_context *smu)
goto err0_out; goto err0_out;
smu_table->metrics_time = 0; smu_table->metrics_time = 0;
smu_table->gpu_metrics_table_size = sizeof(struct gpu_metrics_v1_0); smu_table->gpu_metrics_table_size = sizeof(struct gpu_metrics_v1_1);
smu_table->gpu_metrics_table = kzalloc(smu_table->gpu_metrics_table_size, GFP_KERNEL); smu_table->gpu_metrics_table = kzalloc(smu_table->gpu_metrics_table_size, GFP_KERNEL);
if (!smu_table->gpu_metrics_table) if (!smu_table->gpu_metrics_table)
goto err1_out; goto err1_out;
...@@ -2948,8 +2948,8 @@ static ssize_t sienna_cichlid_get_gpu_metrics(struct smu_context *smu, ...@@ -2948,8 +2948,8 @@ static ssize_t sienna_cichlid_get_gpu_metrics(struct smu_context *smu,
void **table) void **table)
{ {
struct smu_table_context *smu_table = &smu->smu_table; struct smu_table_context *smu_table = &smu->smu_table;
struct gpu_metrics_v1_0 *gpu_metrics = struct gpu_metrics_v1_1 *gpu_metrics =
(struct gpu_metrics_v1_0 *)smu_table->gpu_metrics_table; (struct gpu_metrics_v1_1 *)smu_table->gpu_metrics_table;
SmuMetricsExternal_t metrics_external; SmuMetricsExternal_t metrics_external;
SmuMetrics_t *metrics = SmuMetrics_t *metrics =
&(metrics_external.SmuMetrics); &(metrics_external.SmuMetrics);
...@@ -2963,7 +2963,7 @@ static ssize_t sienna_cichlid_get_gpu_metrics(struct smu_context *smu, ...@@ -2963,7 +2963,7 @@ static ssize_t sienna_cichlid_get_gpu_metrics(struct smu_context *smu,
if (ret) if (ret)
return ret; return ret;
smu_cmn_init_soft_gpu_metrics(gpu_metrics, 1, 0); smu_cmn_init_soft_gpu_metrics(gpu_metrics, 1, 1);
gpu_metrics->temperature_edge = metrics->TemperatureEdge; gpu_metrics->temperature_edge = metrics->TemperatureEdge;
gpu_metrics->temperature_hotspot = metrics->TemperatureHotspot; gpu_metrics->temperature_hotspot = metrics->TemperatureHotspot;
...@@ -3020,7 +3020,7 @@ static ssize_t sienna_cichlid_get_gpu_metrics(struct smu_context *smu, ...@@ -3020,7 +3020,7 @@ static ssize_t sienna_cichlid_get_gpu_metrics(struct smu_context *smu,
*table = (void *)gpu_metrics; *table = (void *)gpu_metrics;
return sizeof(struct gpu_metrics_v1_0); return sizeof(struct gpu_metrics_v1_1);
} }
static int sienna_cichlid_enable_mgpu_fan_boost(struct smu_context *smu) static int sienna_cichlid_enable_mgpu_fan_boost(struct smu_context *smu)
......
...@@ -1995,7 +1995,7 @@ int smu_v11_0_get_current_pcie_link_width_level(struct smu_context *smu) ...@@ -1995,7 +1995,7 @@ int smu_v11_0_get_current_pcie_link_width_level(struct smu_context *smu)
>> PCIE_LC_LINK_WIDTH_CNTL__LC_LINK_WIDTH_RD__SHIFT; >> PCIE_LC_LINK_WIDTH_CNTL__LC_LINK_WIDTH_RD__SHIFT;
} }
uint8_t smu_v11_0_get_current_pcie_link_width(struct smu_context *smu) uint16_t smu_v11_0_get_current_pcie_link_width(struct smu_context *smu)
{ {
uint32_t width_level; uint32_t width_level;
...@@ -2015,7 +2015,7 @@ int smu_v11_0_get_current_pcie_link_speed_level(struct smu_context *smu) ...@@ -2015,7 +2015,7 @@ int smu_v11_0_get_current_pcie_link_speed_level(struct smu_context *smu)
>> PCIE_LC_SPEED_CNTL__LC_CURRENT_DATA_RATE__SHIFT; >> PCIE_LC_SPEED_CNTL__LC_CURRENT_DATA_RATE__SHIFT;
} }
uint8_t smu_v11_0_get_current_pcie_link_speed(struct smu_context *smu) uint16_t smu_v11_0_get_current_pcie_link_speed(struct smu_context *smu)
{ {
uint32_t speed_level; uint32_t speed_level;
......
...@@ -210,7 +210,7 @@ static int vangogh_tables_init(struct smu_context *smu) ...@@ -210,7 +210,7 @@ static int vangogh_tables_init(struct smu_context *smu)
goto err0_out; goto err0_out;
smu_table->metrics_time = 0; smu_table->metrics_time = 0;
smu_table->gpu_metrics_table_size = sizeof(struct gpu_metrics_v2_0); smu_table->gpu_metrics_table_size = sizeof(struct gpu_metrics_v2_1);
smu_table->gpu_metrics_table = kzalloc(smu_table->gpu_metrics_table_size, GFP_KERNEL); smu_table->gpu_metrics_table = kzalloc(smu_table->gpu_metrics_table_size, GFP_KERNEL);
if (!smu_table->gpu_metrics_table) if (!smu_table->gpu_metrics_table)
goto err1_out; goto err1_out;
...@@ -1401,8 +1401,8 @@ static ssize_t vangogh_get_gpu_metrics(struct smu_context *smu, ...@@ -1401,8 +1401,8 @@ static ssize_t vangogh_get_gpu_metrics(struct smu_context *smu,
void **table) void **table)
{ {
struct smu_table_context *smu_table = &smu->smu_table; struct smu_table_context *smu_table = &smu->smu_table;
struct gpu_metrics_v2_0 *gpu_metrics = struct gpu_metrics_v2_1 *gpu_metrics =
(struct gpu_metrics_v2_0 *)smu_table->gpu_metrics_table; (struct gpu_metrics_v2_1 *)smu_table->gpu_metrics_table;
SmuMetrics_t metrics; SmuMetrics_t metrics;
int ret = 0; int ret = 0;
...@@ -1410,7 +1410,7 @@ static ssize_t vangogh_get_gpu_metrics(struct smu_context *smu, ...@@ -1410,7 +1410,7 @@ static ssize_t vangogh_get_gpu_metrics(struct smu_context *smu,
if (ret) if (ret)
return ret; return ret;
smu_cmn_init_soft_gpu_metrics(gpu_metrics, 2, 0); smu_cmn_init_soft_gpu_metrics(gpu_metrics, 2, 1);
gpu_metrics->temperature_gfx = metrics.GfxTemperature; gpu_metrics->temperature_gfx = metrics.GfxTemperature;
gpu_metrics->temperature_soc = metrics.SocTemperature; gpu_metrics->temperature_soc = metrics.SocTemperature;
...@@ -1450,7 +1450,7 @@ static ssize_t vangogh_get_gpu_metrics(struct smu_context *smu, ...@@ -1450,7 +1450,7 @@ static ssize_t vangogh_get_gpu_metrics(struct smu_context *smu,
*table = (void *)gpu_metrics; *table = (void *)gpu_metrics;
return sizeof(struct gpu_metrics_v2_0); return sizeof(struct gpu_metrics_v2_1);
} }
static int vangogh_od_edit_dpm_table(struct smu_context *smu, enum PP_OD_DPM_TABLE_COMMAND type, static int vangogh_od_edit_dpm_table(struct smu_context *smu, enum PP_OD_DPM_TABLE_COMMAND type,
......
...@@ -151,7 +151,7 @@ static int renoir_init_smc_tables(struct smu_context *smu) ...@@ -151,7 +151,7 @@ static int renoir_init_smc_tables(struct smu_context *smu)
if (!smu_table->watermarks_table) if (!smu_table->watermarks_table)
goto err2_out; goto err2_out;
smu_table->gpu_metrics_table_size = sizeof(struct gpu_metrics_v2_0); smu_table->gpu_metrics_table_size = sizeof(struct gpu_metrics_v2_1);
smu_table->gpu_metrics_table = kzalloc(smu_table->gpu_metrics_table_size, GFP_KERNEL); smu_table->gpu_metrics_table = kzalloc(smu_table->gpu_metrics_table_size, GFP_KERNEL);
if (!smu_table->gpu_metrics_table) if (!smu_table->gpu_metrics_table)
goto err3_out; goto err3_out;
...@@ -1231,8 +1231,8 @@ static ssize_t renoir_get_gpu_metrics(struct smu_context *smu, ...@@ -1231,8 +1231,8 @@ static ssize_t renoir_get_gpu_metrics(struct smu_context *smu,
void **table) void **table)
{ {
struct smu_table_context *smu_table = &smu->smu_table; struct smu_table_context *smu_table = &smu->smu_table;
struct gpu_metrics_v2_0 *gpu_metrics = struct gpu_metrics_v2_1 *gpu_metrics =
(struct gpu_metrics_v2_0 *)smu_table->gpu_metrics_table; (struct gpu_metrics_v2_1 *)smu_table->gpu_metrics_table;
SmuMetrics_t metrics; SmuMetrics_t metrics;
int ret = 0; int ret = 0;
...@@ -1240,7 +1240,7 @@ static ssize_t renoir_get_gpu_metrics(struct smu_context *smu, ...@@ -1240,7 +1240,7 @@ static ssize_t renoir_get_gpu_metrics(struct smu_context *smu,
if (ret) if (ret)
return ret; return ret;
smu_cmn_init_soft_gpu_metrics(gpu_metrics, 2, 0); smu_cmn_init_soft_gpu_metrics(gpu_metrics, 2, 1);
gpu_metrics->temperature_gfx = metrics.GfxTemperature; gpu_metrics->temperature_gfx = metrics.GfxTemperature;
gpu_metrics->temperature_soc = metrics.SocTemperature; gpu_metrics->temperature_soc = metrics.SocTemperature;
...@@ -1285,7 +1285,7 @@ static ssize_t renoir_get_gpu_metrics(struct smu_context *smu, ...@@ -1285,7 +1285,7 @@ static ssize_t renoir_get_gpu_metrics(struct smu_context *smu,
*table = (void *)gpu_metrics; *table = (void *)gpu_metrics;
return sizeof(struct gpu_metrics_v2_0); return sizeof(struct gpu_metrics_v2_1);
} }
static int renoir_gfx_state_change_set(struct smu_context *smu, uint32_t state) static int renoir_gfx_state_change_set(struct smu_context *smu, uint32_t state)
......
...@@ -758,9 +758,15 @@ void smu_cmn_init_soft_gpu_metrics(void *table, uint8_t frev, uint8_t crev) ...@@ -758,9 +758,15 @@ void smu_cmn_init_soft_gpu_metrics(void *table, uint8_t frev, uint8_t crev)
case METRICS_VERSION(1, 0): case METRICS_VERSION(1, 0):
structure_size = sizeof(struct gpu_metrics_v1_0); structure_size = sizeof(struct gpu_metrics_v1_0);
break; break;
case METRICS_VERSION(1, 1):
structure_size = sizeof(struct gpu_metrics_v1_1);
break;
case METRICS_VERSION(2, 0): case METRICS_VERSION(2, 0):
structure_size = sizeof(struct gpu_metrics_v2_0); structure_size = sizeof(struct gpu_metrics_v2_0);
break; break;
case METRICS_VERSION(2, 1):
structure_size = sizeof(struct gpu_metrics_v2_1);
break;
default: default:
return; return;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment