diff options
author | Chunming Zhou <David1.Zhou@amd.com> | 2017-05-15 04:48:27 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2017-05-24 18:11:52 -0400 |
commit | f1892138abcb6d58359189f3b0a6c95f10613513 (patch) | |
tree | 127e78746b85e17adb9793c4d38f5aadab8e9f92 /drivers/gpu/drm/amd/amdgpu/amdgpu.h | |
parent | 0c49e0b8a43c8addb0498cd32390f4ef08b5dd27 (diff) |
drm/amdgpu: return -ENODEV to user space when vram is lost v2
below ioctl will return -ENODEV:
amdgpu_cs_ioctl
amdgpu_cs_wait_ioctl
amdgpu_cs_wait_fences_ioctl
amdgpu_gem_va_ioctl
amdgpu_info_ioctl
v2: only for map and replace cases in amdgpu_gem_va_ioctl
Signed-off-by: Chunming Zhou <David1.Zhou@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu.h')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h index ec9774c0d1d9..333413f48165 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h | |||
@@ -824,6 +824,7 @@ struct amdgpu_fpriv { | |||
824 | struct mutex bo_list_lock; | 824 | struct mutex bo_list_lock; |
825 | struct idr bo_list_handles; | 825 | struct idr bo_list_handles; |
826 | struct amdgpu_ctx_mgr ctx_mgr; | 826 | struct amdgpu_ctx_mgr ctx_mgr; |
827 | u32 vram_lost_counter; | ||
827 | }; | 828 | }; |
828 | 829 | ||
829 | /* | 830 | /* |
@@ -1528,6 +1529,7 @@ struct amdgpu_device { | |||
1528 | atomic64_t num_bytes_moved; | 1529 | atomic64_t num_bytes_moved; |
1529 | atomic64_t num_evictions; | 1530 | atomic64_t num_evictions; |
1530 | atomic_t gpu_reset_counter; | 1531 | atomic_t gpu_reset_counter; |
1532 | atomic_t vram_lost_counter; | ||
1531 | 1533 | ||
1532 | /* data for buffer migration throttling */ | 1534 | /* data for buffer migration throttling */ |
1533 | struct { | 1535 | struct { |
@@ -1914,6 +1916,8 @@ static inline bool amdgpu_has_atpx(void) { return false; } | |||
1914 | extern const struct drm_ioctl_desc amdgpu_ioctls_kms[]; | 1916 | extern const struct drm_ioctl_desc amdgpu_ioctls_kms[]; |
1915 | extern const int amdgpu_max_kms_ioctl; | 1917 | extern const int amdgpu_max_kms_ioctl; |
1916 | 1918 | ||
1919 | bool amdgpu_kms_vram_lost(struct amdgpu_device *adev, | ||
1920 | struct amdgpu_fpriv *fpriv); | ||
1917 | int amdgpu_driver_load_kms(struct drm_device *dev, unsigned long flags); | 1921 | int amdgpu_driver_load_kms(struct drm_device *dev, unsigned long flags); |
1918 | void amdgpu_driver_unload_kms(struct drm_device *dev); | 1922 | void amdgpu_driver_unload_kms(struct drm_device *dev); |
1919 | void amdgpu_driver_lastclose_kms(struct drm_device *dev); | 1923 | void amdgpu_driver_lastclose_kms(struct drm_device *dev); |