Skip to content

Commit abce4e4

Browse files
mbrost05rodrigovivi
authored andcommitted
drm/xe: Rename exec_queue_kill_compute to xe_vm_remove_compute_exec_queue
Much better name and aligns with xe_vm_add_compute_exec_queue. As part of the rename, move the implementation from xe_exec_queue.c to xe_vm.c. Suggested-by: Niranjana Vishwanathapura <niranjana.vishwanathapura@intel.com> Signed-off-by: Matthew Brost <matthew.brost@intel.com> Reviewed-by: Niranjana Vishwanathapura <niranjana.vishwanathapura@intel.com> Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
1 parent e05c6c9 commit abce4e4

File tree

3 files changed

+24
-18
lines changed

3 files changed

+24
-18
lines changed

drivers/gpu/drm/xe/xe_exec_queue.c

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -775,22 +775,6 @@ int xe_exec_queue_get_property_ioctl(struct drm_device *dev, void *data,
775775
return ret;
776776
}
777777

778-
static void exec_queue_kill_compute(struct xe_exec_queue *q)
779-
{
780-
if (!xe_vm_in_compute_mode(q->vm))
781-
return;
782-
783-
down_write(&q->vm->lock);
784-
list_del(&q->compute.link);
785-
--q->vm->preempt.num_exec_queues;
786-
if (q->compute.pfence) {
787-
dma_fence_enable_sw_signaling(q->compute.pfence);
788-
dma_fence_put(q->compute.pfence);
789-
q->compute.pfence = NULL;
790-
}
791-
up_write(&q->vm->lock);
792-
}
793-
794778
/**
795779
* xe_exec_queue_is_lr() - Whether an exec_queue is long-running
796780
* @q: The exec_queue
@@ -861,11 +845,11 @@ void xe_exec_queue_kill(struct xe_exec_queue *q)
861845
list_for_each_entry_safe(eq, next, &eq->multi_gt_list,
862846
multi_gt_link) {
863847
q->ops->kill(eq);
864-
exec_queue_kill_compute(eq);
848+
xe_vm_remove_compute_exec_queue(q->vm, eq);
865849
}
866850

867851
q->ops->kill(q);
868-
exec_queue_kill_compute(q);
852+
xe_vm_remove_compute_exec_queue(q->vm, q);
869853
}
870854

871855
int xe_exec_queue_destroy_ioctl(struct drm_device *dev, void *data,

drivers/gpu/drm/xe/xe_vm.c

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -387,6 +387,27 @@ int xe_vm_add_compute_exec_queue(struct xe_vm *vm, struct xe_exec_queue *q)
387387
return err;
388388
}
389389

390+
/**
391+
* xe_vm_remove_compute_exec_queue() - Remove compute exec queue from VM
392+
* @vm: The VM.
393+
* @q: The exec_queue
394+
*/
395+
void xe_vm_remove_compute_exec_queue(struct xe_vm *vm, struct xe_exec_queue *q)
396+
{
397+
if (!xe_vm_in_compute_mode(vm))
398+
return;
399+
400+
down_write(&vm->lock);
401+
list_del(&q->compute.link);
402+
--vm->preempt.num_exec_queues;
403+
if (q->compute.pfence) {
404+
dma_fence_enable_sw_signaling(q->compute.pfence);
405+
dma_fence_put(q->compute.pfence);
406+
q->compute.pfence = NULL;
407+
}
408+
up_write(&vm->lock);
409+
}
410+
390411
/**
391412
* __xe_vm_userptr_needs_repin() - Check whether the VM does have userptrs
392413
* that need repinning.

drivers/gpu/drm/xe/xe_vm.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,7 @@ static inline bool xe_vm_no_dma_fences(struct xe_vm *vm)
165165
}
166166

167167
int xe_vm_add_compute_exec_queue(struct xe_vm *vm, struct xe_exec_queue *q);
168+
void xe_vm_remove_compute_exec_queue(struct xe_vm *vm, struct xe_exec_queue *q);
168169

169170
int xe_vm_userptr_pin(struct xe_vm *vm);
170171

0 commit comments

Comments
 (0)