aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu.h
diff options
context:
space:
mode:
authorChunming Zhou <David1.Zhou@amd.com>2017-05-15 04:48:27 -0400
committerAlex Deucher <alexander.deucher@amd.com>2017-05-24 18:11:52 -0400
commitf1892138abcb6d58359189f3b0a6c95f10613513 (patch)
tree127e78746b85e17adb9793c4d38f5aadab8e9f92 /drivers/gpu/drm/amd/amdgpu/amdgpu.h
parent0c49e0b8a43c8addb0498cd32390f4ef08b5dd27 (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.h4
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; }
1914extern const struct drm_ioctl_desc amdgpu_ioctls_kms[]; 1916extern const struct drm_ioctl_desc amdgpu_ioctls_kms[];
1915extern const int amdgpu_max_kms_ioctl; 1917extern const int amdgpu_max_kms_ioctl;
1916 1918
1919bool amdgpu_kms_vram_lost(struct amdgpu_device *adev,
1920 struct amdgpu_fpriv *fpriv);
1917int amdgpu_driver_load_kms(struct drm_device *dev, unsigned long flags); 1921int amdgpu_driver_load_kms(struct drm_device *dev, unsigned long flags);
1918void amdgpu_driver_unload_kms(struct drm_device *dev); 1922void amdgpu_driver_unload_kms(struct drm_device *dev);
1919void amdgpu_driver_lastclose_kms(struct drm_device *dev); 1923void amdgpu_driver_lastclose_kms(struct drm_device *dev);