aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu
diff options
context:
space:
mode:
authorChunming Zhou <David1.Zhou@amd.com>2017-04-23 23:09:04 -0400
committerAlex Deucher <alexander.deucher@amd.com>2017-05-24 17:40:07 -0400
commitcfbcacf42803a690be40068325d20d74b6093c8c (patch)
tree4d48cd92c048b3ecf74b52d3afb23d6ae388f110 /drivers/gpu/drm/amd/amdgpu
parent63a7c7487fb20422a4a71d0bfef5ac2a69caaf68 (diff)
drm/amdgpu: add vm ioctl
It will be used for reserving vmid for shader debugging that requires a fixed vmid. v2: fix warning (Alex) Signed-off-by: Chunming Zhou <David1.Zhou@amd.com> Reviewed-by: Junwei Zhang <Jerry.Zhang@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')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c1
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c16
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h1
3 files changed, 18 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
index dca4be970d13..1dbe76c3c366 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
@@ -948,6 +948,7 @@ void amdgpu_disable_vblank_kms(struct drm_device *dev, unsigned int pipe)
948const struct drm_ioctl_desc amdgpu_ioctls_kms[] = { 948const struct drm_ioctl_desc amdgpu_ioctls_kms[] = {
949 DRM_IOCTL_DEF_DRV(AMDGPU_GEM_CREATE, amdgpu_gem_create_ioctl, DRM_AUTH|DRM_RENDER_ALLOW), 949 DRM_IOCTL_DEF_DRV(AMDGPU_GEM_CREATE, amdgpu_gem_create_ioctl, DRM_AUTH|DRM_RENDER_ALLOW),
950 DRM_IOCTL_DEF_DRV(AMDGPU_CTX, amdgpu_ctx_ioctl, DRM_AUTH|DRM_RENDER_ALLOW), 950 DRM_IOCTL_DEF_DRV(AMDGPU_CTX, amdgpu_ctx_ioctl, DRM_AUTH|DRM_RENDER_ALLOW),
951 DRM_IOCTL_DEF_DRV(AMDGPU_VM, amdgpu_vm_ioctl, DRM_AUTH|DRM_RENDER_ALLOW),
951 DRM_IOCTL_DEF_DRV(AMDGPU_BO_LIST, amdgpu_bo_list_ioctl, DRM_AUTH|DRM_RENDER_ALLOW), 952 DRM_IOCTL_DEF_DRV(AMDGPU_BO_LIST, amdgpu_bo_list_ioctl, DRM_AUTH|DRM_RENDER_ALLOW),
952 /* KMS */ 953 /* KMS */
953 DRM_IOCTL_DEF_DRV(AMDGPU_GEM_MMAP, amdgpu_gem_mmap_ioctl, DRM_AUTH|DRM_RENDER_ALLOW), 954 DRM_IOCTL_DEF_DRV(AMDGPU_GEM_MMAP, amdgpu_gem_mmap_ioctl, DRM_AUTH|DRM_RENDER_ALLOW),
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
index 8ecf82c5fe74..e4e2bacdb230 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
@@ -2322,3 +2322,19 @@ void amdgpu_vm_manager_fini(struct amdgpu_device *adev)
2322 } 2322 }
2323 } 2323 }
2324} 2324}
2325
2326int amdgpu_vm_ioctl(struct drm_device *dev, void *data, struct drm_file *filp)
2327{
2328 union drm_amdgpu_vm *args = data;
2329
2330 switch (args->in.op) {
2331 case AMDGPU_VM_OP_RESERVE_VMID:
2332 case AMDGPU_VM_OP_UNRESERVE_VMID:
2333 return -EINVAL;
2334 break;
2335 default:
2336 return -EINVAL;
2337 }
2338
2339 return 0;
2340}
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h
index e1d951ece433..b10ce2d08685 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h
@@ -239,5 +239,6 @@ int amdgpu_vm_bo_clear_mappings(struct amdgpu_device *adev,
239void amdgpu_vm_bo_rmv(struct amdgpu_device *adev, 239void amdgpu_vm_bo_rmv(struct amdgpu_device *adev,
240 struct amdgpu_bo_va *bo_va); 240 struct amdgpu_bo_va *bo_va);
241void amdgpu_vm_adjust_size(struct amdgpu_device *adev, uint64_t vm_size); 241void amdgpu_vm_adjust_size(struct amdgpu_device *adev, uint64_t vm_size);
242int amdgpu_vm_ioctl(struct drm_device *dev, void *data, struct drm_file *filp);
242 243
243#endif 244#endif