[PATCH v3 12/22] drm/xe: Add some members to xe_vma_ops
Matthew Brost
matthew.brost at intel.com
Tue Feb 6 23:37:19 UTC 2024
This will help with moving to single jobs for many bind operations.
Signed-off-by: Matthew Brost <matthew.brost at intel.com>
---
drivers/gpu/drm/xe/xe_vm.c | 13 ++++++++++---
drivers/gpu/drm/xe/xe_vm_types.h | 8 ++++++++
2 files changed, 18 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/xe/xe_vm.c b/drivers/gpu/drm/xe/xe_vm.c
index 72f6faf6f9ef..c66e8cff07f8 100644
--- a/drivers/gpu/drm/xe/xe_vm.c
+++ b/drivers/gpu/drm/xe/xe_vm.c
@@ -1285,9 +1285,16 @@ static void xe_vm_free_scratch(struct xe_vm *vm)
}
}
-static void xe_vma_ops_init(struct xe_vma_ops *vops)
+static void xe_vma_ops_init(struct xe_vma_ops *vops, struct xe_vm *vm,
+ struct xe_exec_queue *q,
+ struct xe_sync_entry *syncs, u32 num_syncs)
{
+ memset(vops, 0, sizeof(*vops));
INIT_LIST_HEAD(&vops->list);
+ vops->vm = vm;
+ vops->q = q;
+ vops->syncs = syncs;
+ vops->num_syncs = num_syncs;
}
struct xe_vm *xe_vm_create(struct xe_device *xe, u32 flags)
@@ -1310,7 +1317,7 @@ struct xe_vm *xe_vm_create(struct xe_device *xe, u32 flags)
init_rwsem(&vm->lock);
- xe_vma_ops_init(&vm->dummy_ops.vops);
+ xe_vma_ops_init(&vm->dummy_ops.vops, vm, NULL, NULL, 0);
INIT_LIST_HEAD(&vm->dummy_ops.op.link);
list_add(&vm->dummy_ops.op.link, &vm->dummy_ops.vops.list);
@@ -3089,7 +3096,7 @@ int xe_vm_bind_ioctl(struct drm_device *dev, void *data, struct drm_file *file)
goto free_syncs;
}
- xe_vma_ops_init(&vops);
+ xe_vma_ops_init(&vops, vm, q, syncs, num_syncs);
for (i = 0; i < args->num_binds; ++i) {
u64 range = bind_ops[i].range;
u64 addr = bind_ops[i].addr;
diff --git a/drivers/gpu/drm/xe/xe_vm_types.h b/drivers/gpu/drm/xe/xe_vm_types.h
index 6655a0645a18..4ba05315476f 100644
--- a/drivers/gpu/drm/xe/xe_vm_types.h
+++ b/drivers/gpu/drm/xe/xe_vm_types.h
@@ -201,6 +201,14 @@ struct xe_vma_op {
struct xe_vma_ops {
/** @list: list of VMA operations */
struct list_head list;
+ /** @vm: VM */
+ struct xe_vm *vm;
+ /** @q: exec queue these operations */
+ struct xe_exec_queue *q;
+ /** @syncs: syncs these operation */
+ struct xe_sync_entry *syncs;
+ /** @num_syncs: number of syncs */
+ u32 num_syncs;
};
struct xe_vm {
--
2.34.1
More information about the Intel-xe
mailing list