anv_bo_finish(struct anv_device *device, struct anv_bo *bo)
{
/* Not releasing vma in case unbind fails */
- if (device->kmd_backend->gem_vm_unbind(device, bo) == 0)
+ if (device->kmd_backend->vm_unbind_bo(device, bo) == 0)
anv_bo_vma_free(device, bo);
anv_bo_unmap_close(device, bo);
if (result != VK_SUCCESS)
return result;
- if (device->kmd_backend->gem_vm_bind(device, &new_bo)) {
+ if (device->kmd_backend->vm_bind_bo(device, &new_bo)) {
anv_bo_vma_free(device, &new_bo);
anv_bo_unmap_close(device, &new_bo);
return vk_errorf(device, VK_ERROR_UNKNOWN, "vm bind failed");
return result;
}
- if (device->kmd_backend->gem_vm_bind(device, &new_bo)) {
+ if (device->kmd_backend->vm_bind_bo(device, &new_bo)) {
VkResult res = vk_errorf(device, VK_ERROR_UNKNOWN, "vm bind failed: %m");
anv_bo_vma_free(device, &new_bo);
pthread_mutex_unlock(&cache->mutex);
return result;
}
- if (device->kmd_backend->gem_vm_bind(device, &new_bo)) {
+ if (device->kmd_backend->vm_bind_bo(device, &new_bo)) {
anv_bo_vma_free(device, &new_bo);
pthread_mutex_unlock(&cache->mutex);
return vk_errorf(device, VK_ERROR_UNKNOWN, "vm bind failed");
}
static int
-stub_gem_vm_bind(struct anv_device *device, struct anv_bo *bo)
-{
- return 0;
-}
-
-static int
-stub_gem_vm_unbind(struct anv_device *device, struct anv_bo *bo)
+stub_vm_bind_bo(struct anv_device *device, struct anv_bo *bo)
{
return 0;
}
.gem_create_userptr = stub_gem_create_userptr,
.gem_close = stub_gem_close,
.gem_mmap = stub_gem_mmap,
- .gem_vm_bind = stub_gem_vm_bind,
- .gem_vm_unbind = stub_gem_vm_unbind,
+ .vm_bind_bo = stub_vm_bind_bo,
+ .vm_unbind_bo = stub_vm_bind_bo,
.execute_simple_batch = stub_execute_simple_batch,
.queue_exec_locked = stub_queue_exec_locked,
};
void *(*gem_mmap)(struct anv_device *device, struct anv_bo *bo,
uint64_t offset, uint64_t size,
VkMemoryPropertyFlags property_flags);
- int (*gem_vm_bind)(struct anv_device *device, struct anv_bo *bo);
- int (*gem_vm_unbind)(struct anv_device *device, struct anv_bo *bo);
+ /* Fully bind or unbind a BO. */
+ int (*vm_bind_bo)(struct anv_device *device, struct anv_bo *bo);
+ int (*vm_unbind_bo)(struct anv_device *device, struct anv_bo *bo);
VkResult (*execute_simple_batch)(struct anv_queue *queue,
struct anv_bo *batch_bo,
uint32_t batch_bo_size,
}
static int
-i915_gem_vm_bind(struct anv_device *device, struct anv_bo *bo)
-{
- return 0;
-}
-
-static int
-i915_gem_vm_unbind(struct anv_device *device, struct anv_bo *bo)
+i915_vm_bind_bo(struct anv_device *device, struct anv_bo *bo)
{
return 0;
}
.gem_create_userptr = i915_gem_create_userptr,
.gem_close = i915_gem_close,
.gem_mmap = i915_gem_mmap,
- .gem_vm_bind = i915_gem_vm_bind,
- .gem_vm_unbind = i915_gem_vm_unbind,
+ .vm_bind_bo = i915_vm_bind_bo,
+ .vm_unbind_bo = i915_vm_bind_bo,
.execute_simple_batch = i915_execute_simple_batch,
.queue_exec_locked = i915_queue_exec_locked,
.queue_exec_trace = i915_queue_exec_trace,
}
static inline int
-xe_gem_vm_bind_op(struct anv_device *device, struct anv_bo *bo, uint32_t op)
+xe_vm_bind_op(struct anv_device *device, struct anv_bo *bo, uint32_t op)
{
uint32_t syncobj_handle;
int ret = drmSyncobjCreate(device->fd, 0, &syncobj_handle);
return ret;
}
-static int xe_gem_vm_bind(struct anv_device *device, struct anv_bo *bo)
+static int xe_vm_bind_bo(struct anv_device *device, struct anv_bo *bo)
{
- return xe_gem_vm_bind_op(device, bo, XE_VM_BIND_OP_MAP);
+ return xe_vm_bind_op(device, bo, XE_VM_BIND_OP_MAP);
}
-static int xe_gem_vm_unbind(struct anv_device *device, struct anv_bo *bo)
+static int xe_vm_unbind_bo(struct anv_device *device, struct anv_bo *bo)
{
- return xe_gem_vm_bind_op(device, bo, XE_VM_BIND_OP_UNMAP);
+ return xe_vm_bind_op(device, bo, XE_VM_BIND_OP_UNMAP);
}
static uint32_t
.gem_create_userptr = xe_gem_create_userptr,
.gem_close = xe_gem_close,
.gem_mmap = xe_gem_mmap,
- .gem_vm_bind = xe_gem_vm_bind,
- .gem_vm_unbind = xe_gem_vm_unbind,
+ .vm_bind_bo = xe_vm_bind_bo,
+ .vm_unbind_bo = xe_vm_unbind_bo,
.execute_simple_batch = xe_execute_simple_batch,
.queue_exec_locked = xe_queue_exec_locked,
.queue_exec_trace = xe_queue_exec_utrace_locked,