Commit 143c75d6 authored by Kevin Wang's avatar Kevin Wang Committed by Alex Deucher

drm/amd/powerplay: implement sensor of get feature mask

add sensor interface of feature mask for debugfs.
this interface is not ip related function, so need move high level
file to implement (amdgpu_smu)
Signed-off-by: default avatarKevin Wang <Kevin1.Wang@amd.com>
Reviewed-by: default avatarHuang Rui <ray.huang@amd.com>
Reviewed-by: default avatarEvan Quan <evan.quan@amd.com>
Acked-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 77d1eef4
...@@ -29,6 +29,27 @@ ...@@ -29,6 +29,27 @@
#include "smu_v11_0.h" #include "smu_v11_0.h"
#include "atom.h" #include "atom.h"
int smu_common_read_sensor(struct smu_context *smu, enum amd_pp_sensors sensor,
void *data, uint32_t *size)
{
int ret = 0;
switch (sensor) {
case AMDGPU_PP_SENSOR_ENABLED_SMC_FEATURES_MASK:
ret = smu_feature_get_enabled_mask(smu, (uint32_t *)data, 2);
*size = 8;
break;
default:
ret = -EINVAL;
break;
}
if (ret)
*size = 0;
return ret;
}
int smu_update_table(struct smu_context *smu, uint32_t table_id, int smu_update_table(struct smu_context *smu, uint32_t table_id,
void *table_data, bool drv2smu) void *table_data, bool drv2smu)
{ {
......
...@@ -377,6 +377,8 @@ int smu_update_table(struct smu_context *smu, uint32_t table_id, ...@@ -377,6 +377,8 @@ int smu_update_table(struct smu_context *smu, uint32_t table_id,
void *table_data, bool drv2smu); void *table_data, bool drv2smu);
bool is_support_sw_smu(struct amdgpu_device *adev); bool is_support_sw_smu(struct amdgpu_device *adev);
int smu_reset(struct smu_context *smu); int smu_reset(struct smu_context *smu);
int smu_common_read_sensor(struct smu_context *smu, enum amd_pp_sensors sensor,
void *data, uint32_t *size);
int smu_sys_get_pp_table(struct smu_context *smu, void **table); int smu_sys_get_pp_table(struct smu_context *smu, void **table);
int smu_sys_set_pp_table(struct smu_context *smu, void *buf, size_t size); int smu_sys_set_pp_table(struct smu_context *smu, void *buf, size_t size);
......
...@@ -1108,7 +1108,7 @@ static int smu_v11_0_read_sensor(struct smu_context *smu, ...@@ -1108,7 +1108,7 @@ static int smu_v11_0_read_sensor(struct smu_context *smu,
*size = 4; *size = 4;
break; break;
default: default:
ret = -EINVAL; ret = smu_common_read_sensor(smu, sensor, data, size);
break; break;
} }
......
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