drm/amd/powerplay: change smu_read_sensor sequence in smu
Subsystems (2)
PATCH 1/1 drm/amd/powerplay: change smu_read_sensor sequence in smu
change the smu_read_sensor sequence to:
asic specific sensor read -> smu v11 specific sensor read -> smu v11 common sensor read
--- drivers/gpu/drm/amd/powerplay/amdgpu_smu.c | 3 +++ drivers/gpu/drm/amd/powerplay/inc/amdgpu_smu.h | 4 ++-- drivers/gpu/drm/amd/powerplay/navi10_ppt.c | 5 ++++- drivers/gpu/drm/amd/powerplay/smu_v11_0.c | 8 ++++---- drivers/gpu/drm/amd/powerplay/vega20_ppt.c | 5 ++++- 5 files changed, 17 insertions(+), 8 deletions(-)
drivers/gpu/drm/amd/powerplay/amdgpu_smu.c +3 -0
@@ -315,6 +315,9 @@ int smu_common_read_sensor(struct smu_context *smu, enum amd_pp_sensors sensor, {int ret =0 ; +if (!data || !size) +return -EINVAL ; +switch (sensor) {case AMDGPU_PP_SENSOR_STABLE_PSTATE_SCLK : *((uint32_t *)data) = smu->pstate_sclk;
drivers/gpu/drm/amd/powerplay/inc/amdgpu_smu.h +2 -2
@@ -819,9 +819,9 @@ struct smu_funcs#define smu_start_thermal_control (smu) \ ((smu)->funcs->start_thermal_control? (smu)->funcs->start_thermal_control((smu)) : 0)#define smu_read_sensor (smu, sensor, data, size) \ - ((smu)->funcs->read_sensor? (smu)->funcs->read_sensor((smu), (sensor), (data), (size)) : 0) -#define smu_asic_read_sensor (smu, sensor, data, size) \ ((smu)->ppt_funcs->read_sensor? (smu)->ppt_funcs->read_sensor((smu), (sensor), (data), (size)) : 0) +#define smu_smc_read_sensor (smu, sensor, data, size) \ + ((smu)->funcs->read_sensor? (smu)->funcs->read_sensor((smu), (sensor), (data), (size)) : -EINVAL)#define smu_get_power_profile_mode (smu, buf) \ ((smu)->ppt_funcs->get_power_profile_mode ? (smu)->ppt_funcs->get_power_profile_mode((smu), buf) : 0)#define smu_set_power_profile_mode (smu, param, param_size) \
drivers/gpu/drm/amd/powerplay/navi10_ppt.c +4 -1
@@ -1366,6 +1366,9 @@ static int navi10_read_sensor(struct smu_context *smu,struct smu_table_context *table_context = &smu->smu_table;PPTable_t *pptable = table_context->driver_pptable; +if (!data || !size) +return -EINVAL ; +switch (sensor) {case AMDGPU_PP_SENSOR_MAX_FAN_RPM : *(uint32_t *)data = pptable->FanMaximumRpm;
@@ -1387,7 +1390,7 @@ static int navi10_read_sensor(struct smu_context *smu, *size =4 ;break ;default : -return -EINVAL ; + ret =smu_smc_read_sensor (smu, sensor, data, size); }return ret;
drivers/gpu/drm/amd/powerplay/smu_v11_0.c +4 -4
@@ -1267,6 +1267,10 @@ static int smu_v11_0_read_sensor(struct smu_context *smu, void *data, uint32_t *size) { int ret = 0; + +if (!data || !size) +return -EINVAL ; +switch (sensor) {case AMDGPU_PP_SENSOR_GFX_MCLK : ret =smu_get_current_clk_freq (smu,SMU_UCLK , (uint32_t *)data);
@@ -1289,10 +1293,6 @@ static int smu_v11_0_read_sensor(struct smu_context *smu,break ; } -/* try get sensor data by asic */ -if (ret) - ret =smu_asic_read_sensor (smu, sensor, data, size); -if (ret) *size =0 ;
drivers/gpu/drm/amd/powerplay/vega20_ppt.c +4 -1
@@ -3163,6 +3163,9 @@ static int vega20_read_sensor(struct smu_context *smu,struct smu_table_context *table_context = &smu->smu_table;PPTable_t *pptable = table_context->driver_pptable; +if (!data || !size) +return -EINVAL ; +switch (sensor) {case AMDGPU_PP_SENSOR_MAX_FAN_RPM : *(uint32_t *)data = pptable->FanMaximumRpm;
@@ -3186,7 +3189,7 @@ static int vega20_read_sensor(struct smu_context *smu, *size =4 ;break ;default : -return -EINVAL ; + ret =smu_smc_read_sensor (smu, sensor, data, size); }return ret;
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): 1563874746-6318-1-git-send-email-kenneth.feng-5C7GfCeVMHo@public.gmane.org
Wang, Kevin(Yang)
Reviewed-byit looks fine for me,
please @Deucher, Alexander<mailto:[email protected]> double check confirm.
Best Regards,
Kevin
________________________________
From: amd-gfx <amd-gfx-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org> on behalf of Kenneth Feng <[email protected]>
Sent: Tuesday, July 23, 2019 5:39 PM
To: [email protected] <[email protected]>
Cc: Feng, Kenneth <[email protected]>
Subject: [PATCH] drm/amd/powerplay: change smu_read_sensor sequence in smu
change the smu_read_sensor sequence to:
asic specific sensor read -> smu v11 specific sensor read -> smu v11 common sensor read
--- drivers/gpu/drm/amd/powerplay/amdgpu_smu.c | 3 +++ drivers/gpu/drm/amd/powerplay/inc/amdgpu_smu.h | 4 ++-- drivers/gpu/drm/amd/powerplay/navi10_ppt.c | 5 ++++- drivers/gpu/drm/amd/powerplay/smu_v11_0.c | 8 ++++---- drivers/gpu/drm/amd/powerplay/vega20_ppt.c | 5 ++++- 5 files changed, 17 insertions(+), 8 deletions(-)
drivers/gpu/drm/amd/powerplay/amdgpu_smu.c +3 -0
@@ -315,6 +315,9 @@ int smu_common_read_sensor(struct smu_context *smu, enum amd_pp_sensors sensor, {int ret =0 ; +if (!data || !size) +return -EINVAL ; +switch (sensor) {case AMDGPU_PP_SENSOR_STABLE_PSTATE_SCLK : *((uint32_t *)data) = smu->pstate_sclk;
drivers/gpu/drm/amd/powerplay/inc/amdgpu_smu.h +2 -2
@@ -819,9 +819,9 @@ struct smu_funcs#define smu_start_thermal_control (smu) \ ((smu)->funcs->start_thermal_control? (smu)->funcs->start_thermal_control((smu)) : 0)#define smu_read_sensor (smu, sensor, data, size) \ - ((smu)->funcs->read_sensor? (smu)->funcs->read_sensor((smu), (sensor), (data), (size)) : 0) -#define smu_asic_read_sensor (smu, sensor, data, size) \ ((smu)->ppt_funcs->read_sensor? (smu)->ppt_funcs->read_sensor((smu), (sensor), (data), (size)) : 0) +#define smu_smc_read_sensor (smu, sensor, data, size) \ + ((smu)->funcs->read_sensor? (smu)->funcs->read_sensor((smu), (sensor), (data), (size)) : -EINVAL)#define smu_get_power_profile_mode (smu, buf) \ ((smu)->ppt_funcs->get_power_profile_mode ? (smu)->ppt_funcs->get_power_profile_mode((smu), buf) : 0)#define smu_set_power_profile_mode (smu, param, param_size) \
drivers/gpu/drm/amd/powerplay/navi10_ppt.c +4 -1
@@ -1366,6 +1366,9 @@ static int navi10_read_sensor(struct smu_context *smu,struct smu_table_context *table_context = &smu->smu_table;PPTable_t *pptable = table_context->driver_pptable; +if (!data || !size) +return -EINVAL ; +switch (sensor) {case AMDGPU_PP_SENSOR_MAX_FAN_RPM : *(uint32_t *)data = pptable->FanMaximumRpm;
@@ -1387,7 +1390,7 @@ static int navi10_read_sensor(struct smu_context *smu, *size =4 ;break ;default : -return -EINVAL ; + ret =smu_smc_read_sensor (smu, sensor, data, size); }return ret;
drivers/gpu/drm/amd/powerplay/smu_v11_0.c +4 -4
@@ -1267,6 +1267,10 @@ static int smu_v11_0_read_sensor(struct smu_context *smu, void *data, uint32_t *size) { int ret = 0; + +if (!data || !size) +return -EINVAL ; +switch (sensor) {case AMDGPU_PP_SENSOR_GFX_MCLK : ret =smu_get_current_clk_freq (smu,SMU_UCLK , (uint32_t *)data);
@@ -1289,10 +1293,6 @@ static int smu_v11_0_read_sensor(struct smu_context *smu,break ; } -/* try get sensor data by asic */ -if (ret) - ret =smu_asic_read_sensor (smu, sensor, data, size); -if (ret) *size =0 ;
drivers/gpu/drm/amd/powerplay/vega20_ppt.c +4 -1
@@ -3163,6 +3163,9 @@ static int vega20_read_sensor(struct smu_context *smu,struct smu_table_context *table_context = &smu->smu_table;PPTable_t *pptable = table_context->driver_pptable; +if (!data || !size) +return -EINVAL ; +switch (sensor) {case AMDGPU_PP_SENSOR_MAX_FAN_RPM : *(uint32_t *)data = pptable->FanMaximumRpm;
@@ -3186,7 +3189,7 @@ static int vega20_read_sensor(struct smu_context *smu, *size =4 ;break ;default : -return -EINVAL ; + ret =smu_smc_read_sensor (smu, sensor, data, size); }return ret;
--
2.7.4
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
amd-gfx Info Page - freedesktop.org<https://lists.freedesktop.org/mailman/listinfo/amd-gfx>
lists.freedesktop.org
To see the collection of prior postings to the list, visit the amd-gfx Archives.. Using amd-gfx: To post a message to all the list members, send email to [email protected] You can subscribe to the list, or change your existing subscription, in the sections below.
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): MN2PR12MB3296043F281A9E7345179AE1A2C70-rweVpJHSKTqAm9ToKNQgFgdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org
Looks good to me.
________________________________
From: Wang, Kevin(Yang) <[email protected]>
Sent: Tuesday, July 23, 2019 5:43 AM
To: Feng, Kenneth <[email protected]>; [email protected] <[email protected]>; Deucher, Alexander <[email protected]>
Subject: Re: [PATCH] drm/amd/powerplay: change smu_read_sensor sequence in smu
it looks fine for me,
please @Deucher, Alexander<mailto:[email protected]> double check confirm.
Best Regards,
Kevin
________________________________
From: amd-gfx <amd-gfx-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org> on behalf of Kenneth Feng <[email protected]>
Sent: Tuesday, July 23, 2019 5:39 PM
To: [email protected] <[email protected]>
Cc: Feng, Kenneth <[email protected]>
Subject: [PATCH] drm/amd/powerplay: change smu_read_sensor sequence in smu
change the smu_read_sensor sequence to:
asic specific sensor read -> smu v11 specific sensor read -> smu v11 common sensor read
--- drivers/gpu/drm/amd/powerplay/amdgpu_smu.c | 3 +++ drivers/gpu/drm/amd/powerplay/inc/amdgpu_smu.h | 4 ++-- drivers/gpu/drm/amd/powerplay/navi10_ppt.c | 5 ++++- drivers/gpu/drm/amd/powerplay/smu_v11_0.c | 8 ++++---- drivers/gpu/drm/amd/powerplay/vega20_ppt.c | 5 ++++- 5 files changed, 17 insertions(+), 8 deletions(-)
drivers/gpu/drm/amd/powerplay/amdgpu_smu.c +3 -0
@@ -315,6 +315,9 @@ int smu_common_read_sensor(struct smu_context *smu, enum amd_pp_sensors sensor, {int ret =0 ; +if (!data || !size) +return -EINVAL ; +switch (sensor) {case AMDGPU_PP_SENSOR_STABLE_PSTATE_SCLK : *((uint32_t *)data) = smu->pstate_sclk;
drivers/gpu/drm/amd/powerplay/inc/amdgpu_smu.h +2 -2
@@ -819,9 +819,9 @@ struct smu_funcs#define smu_start_thermal_control (smu) \ ((smu)->funcs->start_thermal_control? (smu)->funcs->start_thermal_control((smu)) : 0)#define smu_read_sensor (smu, sensor, data, size) \ - ((smu)->funcs->read_sensor? (smu)->funcs->read_sensor((smu), (sensor), (data), (size)) : 0) -#define smu_asic_read_sensor (smu, sensor, data, size) \ ((smu)->ppt_funcs->read_sensor? (smu)->ppt_funcs->read_sensor((smu), (sensor), (data), (size)) : 0) +#define smu_smc_read_sensor (smu, sensor, data, size) \ + ((smu)->funcs->read_sensor? (smu)->funcs->read_sensor((smu), (sensor), (data), (size)) : -EINVAL)#define smu_get_power_profile_mode (smu, buf) \ ((smu)->ppt_funcs->get_power_profile_mode ? (smu)->ppt_funcs->get_power_profile_mode((smu), buf) : 0)#define smu_set_power_profile_mode (smu, param, param_size) \
drivers/gpu/drm/amd/powerplay/navi10_ppt.c +4 -1
@@ -1366,6 +1366,9 @@ static int navi10_read_sensor(struct smu_context *smu,struct smu_table_context *table_context = &smu->smu_table;PPTable_t *pptable = table_context->driver_pptable; +if (!data || !size) +return -EINVAL ; +switch (sensor) {case AMDGPU_PP_SENSOR_MAX_FAN_RPM : *(uint32_t *)data = pptable->FanMaximumRpm;
@@ -1387,7 +1390,7 @@ static int navi10_read_sensor(struct smu_context *smu, *size =4 ;break ;default : -return -EINVAL ; + ret =smu_smc_read_sensor (smu, sensor, data, size); }return ret;
drivers/gpu/drm/amd/powerplay/smu_v11_0.c +4 -4
@@ -1267,6 +1267,10 @@ static int smu_v11_0_read_sensor(struct smu_context *smu, void *data, uint32_t *size) { int ret = 0; + +if (!data || !size) +return -EINVAL ; +switch (sensor) {case AMDGPU_PP_SENSOR_GFX_MCLK : ret =smu_get_current_clk_freq (smu,SMU_UCLK , (uint32_t *)data);
@@ -1289,10 +1293,6 @@ static int smu_v11_0_read_sensor(struct smu_context *smu,break ; } -/* try get sensor data by asic */ -if (ret) - ret =smu_asic_read_sensor (smu, sensor, data, size); -if (ret) *size =0 ;
drivers/gpu/drm/amd/powerplay/vega20_ppt.c +4 -1
@@ -3163,6 +3163,9 @@ static int vega20_read_sensor(struct smu_context *smu,struct smu_table_context *table_context = &smu->smu_table;PPTable_t *pptable = table_context->driver_pptable; +if (!data || !size) +return -EINVAL ; +switch (sensor) {case AMDGPU_PP_SENSOR_MAX_FAN_RPM : *(uint32_t *)data = pptable->FanMaximumRpm;
@@ -3186,7 +3189,7 @@ static int vega20_read_sensor(struct smu_context *smu, *size =4 ;break ;default : -return -EINVAL ; + ret =smu_smc_read_sensor (smu, sensor, data, size); }return ret;
--
2.7.4
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
amd-gfx Info Page - freedesktop.org<https://lists.freedesktop.org/mailman/listinfo/amd-gfx>
lists.freedesktop.org
To see the collection of prior postings to the list, visit the amd-gfx Archives.. Using amd-gfx: To post a message to all the list members, send email to [email protected] You can subscribe to the list, or change your existing subscription, in the sections below.
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx