[PATCH 4/4] drm/amdgpu: reset fpriv vram_lost_counter
Chunming Zhou
David1.Zhou at amd.com
Tue May 16 09:25:50 UTC 2017
Change-Id: I8eb6d7f558da05510e429d3bf1d48c8cec6c1977
Signed-off-by: Chunming Zhou <David1.Zhou at amd.com>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 3 +++
include/uapi/drm/amdgpu_drm.h | 1 +
2 files changed, 4 insertions(+)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
index bca1fb5..f3e7525 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
@@ -2547,6 +2547,9 @@ int amdgpu_vm_ioctl(struct drm_device *dev, void *data, struct drm_file *filp)
case AMDGPU_VM_OP_UNRESERVE_VMID:
amdgpu_vm_free_reserved_vmid(adev, &fpriv->vm, AMDGPU_GFXHUB);
break;
+ case AMDGPU_VM_OP_RESET:
+ fpriv->vram_lost_counter = atomic_read(&adev->vram_lost_counter);
+ break;
default:
return -EINVAL;
}
diff --git a/include/uapi/drm/amdgpu_drm.h b/include/uapi/drm/amdgpu_drm.h
index 81141e1..ed2ef9b 100644
--- a/include/uapi/drm/amdgpu_drm.h
+++ b/include/uapi/drm/amdgpu_drm.h
@@ -246,6 +246,7 @@ struct drm_amdgpu_sem_in {
/* vm ioctl */
#define AMDGPU_VM_OP_RESERVE_VMID 1
#define AMDGPU_VM_OP_UNRESERVE_VMID 2
+#define AMDGPU_VM_OP_RESET 3
struct drm_amdgpu_vm_in {
/** AMDGPU_VM_OP_* */
--
1.9.1
More information about the amd-gfx
mailing list