diff options
author | Christian König <christian.koenig@amd.com> | 2017-10-09 17:53:06 +0200 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2017-10-19 15:27:05 -0400 |
commit | 1f7251b73e08395dbf03602a57ca67cf7da7f9db (patch) | |
tree | b38e541c99491379351c214899e30dfcd84d7127 /drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | |
parent | 7a0a48ddf63bc9944b9690c6fa043ea4305f7f79 (diff) | |
download | talos-op-linux-1f7251b73e08395dbf03602a57ca67cf7da7f9db.tar.gz talos-op-linux-1f7251b73e08395dbf03602a57ca67cf7da7f9db.zip |
drm/amdgpu: add VRAM lost query
Allows userspace to figure out if VRAM was lost.
Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@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 | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c index ff1a416a66c9..6f0b26dae3b0 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c @@ -763,6 +763,9 @@ static int amdgpu_info_ioctl(struct drm_device *dev, void *data, struct drm_file } return copy_to_user(out, &ui32, min(size, 4u)) ? -EFAULT : 0; } + case AMDGPU_INFO_VRAM_LOST_COUNTER: + ui32 = atomic_read(&adev->vram_lost_counter); + return copy_to_user(out, &ui32, min(size, 4u)) ? -EFAULT : 0; default: DRM_DEBUG_KMS("Invalid request %d\n", info->query); return -EINVAL; |