*
* \return 0 on success otherwise POSIX Error code
*/
-int amdgpu_vm_reserve_vmid(amdgpu_context_handle context, uint32_t flags);
+int amdgpu_vm_reserve_vmid(amdgpu_device_handle dev, uint32_t flags);
/**
* Free reserved VMID
*
* \return 0 on success otherwise POSIX Error code
*/
-int amdgpu_vm_unreserve_vmid(amdgpu_context_handle context, uint32_t flags);
+int amdgpu_vm_unreserve_vmid(amdgpu_device_handle dev, uint32_t flags);
#ifdef __cplusplus
}
#include "xf86drm.h"
#include "amdgpu_internal.h"
-int amdgpu_vm_reserve_vmid(amdgpu_context_handle context, uint32_t flags)
+int amdgpu_vm_reserve_vmid(amdgpu_device_handle dev, uint32_t flags)
{
union drm_amdgpu_vm vm;
vm.in.op = AMDGPU_VM_OP_RESERVE_VMID;
vm.in.flags = flags;
- return drmCommandWriteRead(context->dev->fd, DRM_AMDGPU_VM,
+ return drmCommandWriteRead(dev->fd, DRM_AMDGPU_VM,
&vm, sizeof(vm));
}
-int amdgpu_vm_unreserve_vmid(amdgpu_context_handle context, uint32_t flags)
+int amdgpu_vm_unreserve_vmid(amdgpu_device_handle dev, uint32_t flags)
{
union drm_amdgpu_vm vm;
vm.in.op = AMDGPU_VM_OP_UNRESERVE_VMID;
vm.in.flags = flags;
- return drmCommandWriteRead(context->dev->fd, DRM_AMDGPU_VM,
+ return drmCommandWriteRead(dev->fd, DRM_AMDGPU_VM,
&vm, sizeof(vm));
}
CU_ASSERT_EQUAL(r, 0);
flags = 0;
- r = amdgpu_vm_reserve_vmid(context_handle, flags);
+ r = amdgpu_vm_reserve_vmid(device_handle, flags);
CU_ASSERT_EQUAL(r, 0);
CU_ASSERT_EQUAL(r, 0);
flags = 0;
- r = amdgpu_vm_unreserve_vmid(context_handle, flags);
+ r = amdgpu_vm_unreserve_vmid(device_handle, flags);
CU_ASSERT_EQUAL(r, 0);