Blame amdgpu/amdgpu_vm.c

Packit Service 103f6b
/*
Packit Service 103f6b
 * Copyright 2017 Advanced Micro Devices, Inc.
Packit Service 103f6b
 *
Packit Service 103f6b
 * Permission is hereby granted, free of charge, to any person obtaining a
Packit Service 103f6b
 * copy of this software and associated documentation files (the "Software"),
Packit Service 103f6b
 * to deal in the Software without restriction, including without limitation
Packit Service 103f6b
 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
Packit Service 103f6b
 * and/or sell copies of the Software, and to permit persons to whom the
Packit Service 103f6b
 * Software is furnished to do so, subject to the following conditions:
Packit Service 103f6b
 *
Packit Service 103f6b
 * The above copyright notice and this permission notice shall be included in
Packit Service 103f6b
 * all copies or substantial portions of the Software.
Packit Service 103f6b
 *
Packit Service 103f6b
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
Packit Service 103f6b
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
Packit Service 103f6b
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
Packit Service 103f6b
 * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
Packit Service 103f6b
 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
Packit Service 103f6b
 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
Packit Service 103f6b
 * OTHER DEALINGS IN THE SOFTWARE.
Packit Service 103f6b
 *
Packit Service 103f6b
 */
Packit Service 103f6b
Packit Service 103f6b
#include "amdgpu.h"
Packit Service 103f6b
#include "amdgpu_drm.h"
Packit Service 103f6b
#include "xf86drm.h"
Packit Service 103f6b
#include "amdgpu_internal.h"
Packit Service 103f6b
Packit Service 103f6b
drm_public int amdgpu_vm_reserve_vmid(amdgpu_device_handle dev, uint32_t flags)
Packit Service 103f6b
{
Packit Service 103f6b
	union drm_amdgpu_vm vm;
Packit Service 103f6b
Packit Service 103f6b
	vm.in.op = AMDGPU_VM_OP_RESERVE_VMID;
Packit Service 103f6b
	vm.in.flags = flags;
Packit Service 103f6b
Packit Service 103f6b
	return drmCommandWriteRead(dev->fd, DRM_AMDGPU_VM,
Packit Service 103f6b
				   &vm, sizeof(vm));
Packit Service 103f6b
}
Packit Service 103f6b
Packit Service 103f6b
drm_public int amdgpu_vm_unreserve_vmid(amdgpu_device_handle dev,
Packit Service 103f6b
					uint32_t flags)
Packit Service 103f6b
{
Packit Service 103f6b
	union drm_amdgpu_vm vm;
Packit Service 103f6b
Packit Service 103f6b
	vm.in.op = AMDGPU_VM_OP_UNRESERVE_VMID;
Packit Service 103f6b
	vm.in.flags = flags;
Packit Service 103f6b
Packit Service 103f6b
	return drmCommandWriteRead(dev->fd, DRM_AMDGPU_VM,
Packit Service 103f6b
				   &vm, sizeof(vm));
Packit Service 103f6b
}