diff options
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/drm/amd/powerplay/amdgpu_smu.c | 21 | ||||
-rw-r--r-- | drivers/gpu/drm/amd/powerplay/inc/amdgpu_smu.h | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/amd/powerplay/smu_v11_0.c | 2 |
3 files changed, 24 insertions, 1 deletions
diff --git a/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c b/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c index f17c85fc61e9..012d2790da8a 100644 --- a/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c +++ b/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c | |||
@@ -29,6 +29,27 @@ | |||
29 | #include "smu_v11_0.h" | 29 | #include "smu_v11_0.h" |
30 | #include "atom.h" | 30 | #include "atom.h" |
31 | 31 | ||
32 | int smu_common_read_sensor(struct smu_context *smu, enum amd_pp_sensors sensor, | ||
33 | void *data, uint32_t *size) | ||
34 | { | ||
35 | int ret = 0; | ||
36 | |||
37 | switch (sensor) { | ||
38 | case AMDGPU_PP_SENSOR_ENABLED_SMC_FEATURES_MASK: | ||
39 | ret = smu_feature_get_enabled_mask(smu, (uint32_t *)data, 2); | ||
40 | *size = 8; | ||
41 | break; | ||
42 | default: | ||
43 | ret = -EINVAL; | ||
44 | break; | ||
45 | } | ||
46 | |||
47 | if (ret) | ||
48 | *size = 0; | ||
49 | |||
50 | return ret; | ||
51 | } | ||
52 | |||
32 | int smu_update_table(struct smu_context *smu, uint32_t table_id, | 53 | int smu_update_table(struct smu_context *smu, uint32_t table_id, |
33 | void *table_data, bool drv2smu) | 54 | void *table_data, bool drv2smu) |
34 | { | 55 | { |
diff --git a/drivers/gpu/drm/amd/powerplay/inc/amdgpu_smu.h b/drivers/gpu/drm/amd/powerplay/inc/amdgpu_smu.h index 99700a045d2f..2e89a59ed06c 100644 --- a/drivers/gpu/drm/amd/powerplay/inc/amdgpu_smu.h +++ b/drivers/gpu/drm/amd/powerplay/inc/amdgpu_smu.h | |||
@@ -377,6 +377,8 @@ int smu_update_table(struct smu_context *smu, uint32_t table_id, | |||
377 | void *table_data, bool drv2smu); | 377 | void *table_data, bool drv2smu); |
378 | bool is_support_sw_smu(struct amdgpu_device *adev); | 378 | bool is_support_sw_smu(struct amdgpu_device *adev); |
379 | int smu_reset(struct smu_context *smu); | 379 | int smu_reset(struct smu_context *smu); |
380 | int smu_common_read_sensor(struct smu_context *smu, enum amd_pp_sensors sensor, | ||
381 | void *data, uint32_t *size); | ||
380 | int smu_sys_get_pp_table(struct smu_context *smu, void **table); | 382 | int smu_sys_get_pp_table(struct smu_context *smu, void **table); |
381 | int smu_sys_set_pp_table(struct smu_context *smu, void *buf, size_t size); | 383 | int smu_sys_set_pp_table(struct smu_context *smu, void *buf, size_t size); |
382 | 384 | ||
diff --git a/drivers/gpu/drm/amd/powerplay/smu_v11_0.c b/drivers/gpu/drm/amd/powerplay/smu_v11_0.c index 7c64509df8ab..1f9459c4ff51 100644 --- a/drivers/gpu/drm/amd/powerplay/smu_v11_0.c +++ b/drivers/gpu/drm/amd/powerplay/smu_v11_0.c | |||
@@ -1108,7 +1108,7 @@ static int smu_v11_0_read_sensor(struct smu_context *smu, | |||
1108 | *size = 4; | 1108 | *size = 4; |
1109 | break; | 1109 | break; |
1110 | default: | 1110 | default: |
1111 | ret = -EINVAL; | 1111 | ret = smu_common_read_sensor(smu, sensor, data, size); |
1112 | break; | 1112 | break; |
1113 | } | 1113 | } |
1114 | 1114 | ||