diff options
author | xinhui pan <xinhui.pan@amd.com> | 2018-12-17 02:09:07 -0500 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2019-03-19 16:36:51 -0400 |
commit | 5cb771143ed9552c672b6e1d6a3005a435b54e44 (patch) | |
tree | f1b7aecb82be05c9c803698aba004d737e45f448 /drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | |
parent | ae363a212b145a0d4e0507e26e6c1b937181ec34 (diff) |
drm/amdgpu: add ioctl query for enabled ras features (v2)
Add a query for userspace to check which RAS features
are enabled.
v2: squash in warning fix
Signed-off-by: xinhui pan <xinhui.pan@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c index 4d0ccca891cb..df40f35db89c 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | |||
@@ -39,6 +39,7 @@ | |||
39 | #include "amdgpu_amdkfd.h" | 39 | #include "amdgpu_amdkfd.h" |
40 | #include "amdgpu_gem.h" | 40 | #include "amdgpu_gem.h" |
41 | #include "amdgpu_display.h" | 41 | #include "amdgpu_display.h" |
42 | #include "amdgpu_ras.h" | ||
42 | 43 | ||
43 | static void amdgpu_unregister_gpu_instance(struct amdgpu_device *adev) | 44 | static void amdgpu_unregister_gpu_instance(struct amdgpu_device *adev) |
44 | { | 45 | { |
@@ -919,6 +920,15 @@ static int amdgpu_info_ioctl(struct drm_device *dev, void *data, struct drm_file | |||
919 | case AMDGPU_INFO_VRAM_LOST_COUNTER: | 920 | case AMDGPU_INFO_VRAM_LOST_COUNTER: |
920 | ui32 = atomic_read(&adev->vram_lost_counter); | 921 | ui32 = atomic_read(&adev->vram_lost_counter); |
921 | return copy_to_user(out, &ui32, min(size, 4u)) ? -EFAULT : 0; | 922 | return copy_to_user(out, &ui32, min(size, 4u)) ? -EFAULT : 0; |
923 | case AMDGPU_INFO_RAS_ENABLED_FEATURES: { | ||
924 | struct amdgpu_ras *ras = amdgpu_ras_get_context(adev); | ||
925 | |||
926 | if (!ras) | ||
927 | return -EINVAL; | ||
928 | return copy_to_user(out, &ras->features, | ||
929 | min_t(u32, size, sizeof(ras->features))) ? | ||
930 | -EFAULT : 0; | ||
931 | } | ||
922 | default: | 932 | default: |
923 | DRM_DEBUG_KMS("Invalid request %d\n", info->query); | 933 | DRM_DEBUG_KMS("Invalid request %d\n", info->query); |
924 | return -EINVAL; | 934 | return -EINVAL; |