Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Matthew Brost <matthew.brost@intel.com>
To: <intel-xe@lists.freedesktop.org>
Subject: [Intel-xe] [PATCH v2 3/4] drm/xe: Rename exec_queue_kill_compute to xe_vm_remove_compute_exec_queue
Date: Fri, 15 Sep 2023 16:34:44 -0700	[thread overview]
Message-ID: <20230915233445.2241554-4-matthew.brost@intel.com> (raw)
In-Reply-To: <20230915233445.2241554-1-matthew.brost@intel.com>

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>
---
 drivers/gpu/drm/xe/xe_exec_queue.c | 20 ++------------------
 drivers/gpu/drm/xe/xe_vm.c         | 21 +++++++++++++++++++++
 drivers/gpu/drm/xe/xe_vm.h         |  1 +
 3 files changed, 24 insertions(+), 18 deletions(-)

diff --git a/drivers/gpu/drm/xe/xe_exec_queue.c b/drivers/gpu/drm/xe/xe_exec_queue.c
index 93d2f0591c34..b95b62a2538f 100644
--- a/drivers/gpu/drm/xe/xe_exec_queue.c
+++ b/drivers/gpu/drm/xe/xe_exec_queue.c
@@ -775,22 +775,6 @@ int xe_exec_queue_get_property_ioctl(struct drm_device *dev, void *data,
 	return ret;
 }
 
-static void exec_queue_kill_compute(struct xe_exec_queue *q)
-{
-	if (!xe_vm_in_compute_mode(q->vm))
-		return;
-
-	down_write(&q->vm->lock);
-	list_del(&q->compute.link);
-	--q->vm->preempt.num_exec_queues;
-	if (q->compute.pfence) {
-		dma_fence_enable_sw_signaling(q->compute.pfence);
-		dma_fence_put(q->compute.pfence);
-		q->compute.pfence = NULL;
-	}
-	up_write(&q->vm->lock);
-}
-
 /**
  * xe_exec_queue_is_lr() - Whether an exec_queue is long-running
  * @q: The exec_queue
@@ -861,11 +845,11 @@ void xe_exec_queue_kill(struct xe_exec_queue *q)
 	list_for_each_entry_safe(eq, next, &eq->multi_gt_list,
 				 multi_gt_link) {
 		q->ops->kill(eq);
-		exec_queue_kill_compute(eq);
+		xe_vm_remove_compute_exec_queue(q->vm, eq);
 	}
 
 	q->ops->kill(q);
-	exec_queue_kill_compute(q);
+	xe_vm_remove_compute_exec_queue(q->vm, q);
 }
 
 int xe_exec_queue_destroy_ioctl(struct drm_device *dev, void *data,
diff --git a/drivers/gpu/drm/xe/xe_vm.c b/drivers/gpu/drm/xe/xe_vm.c
index 03ee6993e7c7..433bdfae6759 100644
--- a/drivers/gpu/drm/xe/xe_vm.c
+++ b/drivers/gpu/drm/xe/xe_vm.c
@@ -380,6 +380,27 @@ int xe_vm_add_compute_exec_queue(struct xe_vm *vm, struct xe_exec_queue *q)
 	return err;
 }
 
+/**
+ * xe_vm_remove_compute_exec_queue() - Remove compute exec queue from VM
+ * @vm: The VM.
+ * @q: The exec_queue
+ */
+void xe_vm_remove_compute_exec_queue(struct xe_vm *vm, struct xe_exec_queue *q)
+{
+	if (!xe_vm_in_compute_mode(vm))
+		return;
+
+	down_write(&vm->lock);
+	list_del(&q->compute.link);
+	--vm->preempt.num_exec_queues;
+	if (q->compute.pfence) {
+		dma_fence_enable_sw_signaling(q->compute.pfence);
+		dma_fence_put(q->compute.pfence);
+		q->compute.pfence = NULL;
+	}
+	up_write(&vm->lock);
+}
+
 /**
  * __xe_vm_userptr_needs_repin() - Check whether the VM does have userptrs
  * that need repinning.
diff --git a/drivers/gpu/drm/xe/xe_vm.h b/drivers/gpu/drm/xe/xe_vm.h
index 5608e4e33169..813328ad3f7f 100644
--- a/drivers/gpu/drm/xe/xe_vm.h
+++ b/drivers/gpu/drm/xe/xe_vm.h
@@ -168,6 +168,7 @@ static inline bool xe_vm_no_dma_fences(struct xe_vm *vm)
 }
 
 int xe_vm_add_compute_exec_queue(struct xe_vm *vm, struct xe_exec_queue *q);
+void xe_vm_remove_compute_exec_queue(struct xe_vm *vm, struct xe_exec_queue *q);
 
 int xe_vm_userptr_pin(struct xe_vm *vm);
 
-- 
2.34.1


  parent reply	other threads:[~2023-09-15 23:34 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-15 23:34 [Intel-xe] [PATCH v2 0/4] Remove XE_EXEC_QUEUE_SET_PROPERTY_COMPUTE_MODE Matthew Brost
2023-09-15 23:34 ` [Intel-xe] [PATCH v2 1/4] drm/xe: Fix xe_exec_queue_is_idle for parallel exec queues Matthew Brost
2023-09-18  4:54   ` Niranjana Vishwanathapura
2023-09-15 23:34 ` [Intel-xe] [PATCH v2 2/4] drm/xe: Deprecate XE_EXEC_QUEUE_SET_PROPERTY_COMPUTE_MODE implementation Matthew Brost
2023-09-18  4:53   ` Niranjana Vishwanathapura
2023-09-15 23:34 ` Matthew Brost [this message]
2023-09-18  4:53   ` [Intel-xe] [PATCH v2 3/4] drm/xe: Rename exec_queue_kill_compute to xe_vm_remove_compute_exec_queue Niranjana Vishwanathapura
2023-09-18 15:34     ` Matthew Brost
2023-09-15 23:34 ` [Intel-xe] [PATCH v2 4/4] drm/xe: Remove XE_EXEC_QUEUE_SET_PROPERTY_COMPUTE_MODE from uAPI Matthew Brost
2023-09-16  3:10 ` [Intel-xe] ✓ CI.Patch_applied: success for Remove XE_EXEC_QUEUE_SET_PROPERTY_COMPUTE_MODE (rev2) Patchwork
2023-09-16  3:11 ` [Intel-xe] ✓ CI.checkpatch: " Patchwork
2023-09-16  3:12 ` [Intel-xe] ✓ CI.KUnit: " Patchwork
2023-09-16  3:19 ` [Intel-xe] ✓ CI.Build: " Patchwork
2023-09-16  3:19 ` [Intel-xe] ✗ CI.Hooks: failure " Patchwork
2023-09-16  3:21 ` [Intel-xe] ✓ CI.checksparse: success " Patchwork
2023-09-16  3:59 ` [Intel-xe] ✗ CI.BAT: failure " Patchwork
2023-09-19 13:14 ` [Intel-xe] [PATCH v2 0/4] Remove XE_EXEC_QUEUE_SET_PROPERTY_COMPUTE_MODE Rodrigo Vivi
2023-09-19 13:35   ` Rodrigo Vivi
2023-09-19 14:57     ` Matthew Brost

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230915233445.2241554-4-matthew.brost@intel.com \
    --to=matthew.brost@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox