Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Rodrigo Vivi <rodrigo.vivi@intel.com>
To: <intel-xe@lists.freedesktop.org>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Subject: [Intel-xe] [PATCH v2 09/20] drm/xe: Rename exec_queue_kill_compute to xe_vm_remove_compute_exec_queue
Date: Wed, 20 Sep 2023 15:29:29 -0400	[thread overview]
Message-ID: <20230920192940.135004-10-rodrigo.vivi@intel.com> (raw)
In-Reply-To: <20230920192940.135004-1-rodrigo.vivi@intel.com>

From: Matthew Brost <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>
Reviewed-by: Niranjana Vishwanathapura <niranjana.vishwanathapura@intel.com>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@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 68cd2234acf5..170d9d9c48d2 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 ab132b88c135..2af331cf2d35 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 f966ed39b711..ceae9c1be697 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.41.0


  parent reply	other threads:[~2023-09-20 19:30 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-20 19:29 [Intel-xe] [PATCH v2 00/20] uAPI Alignment - take 1 v2 Rodrigo Vivi
2023-09-20 19:29 ` [Intel-xe] [PATCH v2 01/20] drm/xe: Fix array bounds check for queries Rodrigo Vivi
2023-09-20 19:29 ` [Intel-xe] [PATCH v2 02/20] drm/xe: Set the correct type for xe_to_user_engine_class Rodrigo Vivi
2023-09-20 19:29 ` [Intel-xe] [PATCH v2 03/20] drm/xe: Correlate engine and cpu timestamps with better accuracy Rodrigo Vivi
2023-09-26  1:37   ` Umesh Nerlige Ramappa
2023-09-26 18:48     ` Rodrigo Vivi
2023-09-26 18:58       ` Umesh Nerlige Ramappa
2023-09-26 19:07         ` Rodrigo Vivi
2023-09-26 19:52           ` Umesh Nerlige Ramappa
2023-09-26 21:42             ` Rodrigo Vivi
2023-09-27  1:05               ` Umesh Nerlige Ramappa
2023-09-20 19:29 ` [Intel-xe] [PATCH v2 04/20] drm/xe/uapi: Separate VM_BIND's operation and flag Rodrigo Vivi
2023-09-20 19:29 ` [Intel-xe] [PATCH v2 05/20] drm/xe/vm: Remove VM_BIND_OP macro Rodrigo Vivi
2023-09-20 19:29 ` [Intel-xe] [PATCH v2 06/20] drm/xe/uapi: Remove MMIO ioctl Rodrigo Vivi
2023-09-20 19:29 ` [Intel-xe] [PATCH v2 07/20] drm/xe: Fix xe_exec_queue_is_idle for parallel exec queues Rodrigo Vivi
2023-09-20 19:29 ` [Intel-xe] [PATCH v2 08/20] drm/xe: Deprecate XE_EXEC_QUEUE_SET_PROPERTY_COMPUTE_MODE implementation Rodrigo Vivi
2023-09-20 19:29 ` Rodrigo Vivi [this message]
2023-09-20 19:29 ` [Intel-xe] [PATCH v2 10/20] drm/xe: Remove XE_EXEC_QUEUE_SET_PROPERTY_COMPUTE_MODE from uAPI Rodrigo Vivi
2023-09-20 19:29 ` [Intel-xe] [PATCH v2 11/20] drm/xe/uapi: Use common drm_xe_ext_set_property extension Rodrigo Vivi
2023-09-20 19:29 ` [Intel-xe] [PATCH v2 12/20] drm/xe: Kill XE_VM_PROPERTY_BIND_OP_ERROR_CAPTURE_ADDRESS extension Rodrigo Vivi
2023-09-20 19:29 ` [Intel-xe] [PATCH v2 13/20] drm/xe/uapi: Document drm_xe_query_gt Rodrigo Vivi
2023-09-20 19:29 ` [Intel-xe] [PATCH v2 14/20] drm/xe/uapi: Replace useless 'instance' per unique gt_id Rodrigo Vivi
2023-09-20 19:29 ` [Intel-xe] [PATCH v2 15/20] drm/xe/uapi: Remove unused field of drm_xe_query_gt Rodrigo Vivi
2023-09-20 19:29 ` [Intel-xe] [PATCH v2 16/20] drm/xe/uapi: Rename gts to gt_list Rodrigo Vivi
2023-09-20 19:29 ` [Intel-xe] [PATCH v2 17/20] drm/xe/uapi: Fix naming of XE_QUERY_CONFIG_MAX_EXEC_QUEUE_PRIORITY Rodrigo Vivi
2023-09-20 19:29 ` [Intel-xe] [PATCH v2 18/20] drm/xe/uapi: Add documentation for query Rodrigo Vivi
2023-09-20 19:29 ` [Intel-xe] [PATCH v2 19/20] drm/xe/uapi: Crystal Reference Clock updates Rodrigo Vivi
2023-09-20 19:56   ` Souza, Jose
2023-09-20 20:09     ` Rodrigo Vivi
2023-09-21 15:50   ` Souza, Jose
2023-09-21 20:49     ` Rodrigo Vivi
2023-09-21 21:04       ` Souza, Jose
2023-09-20 19:29 ` [Intel-xe] [PATCH v2 20/20] drm/xe: Extend drm_xe_vm_bind_op Rodrigo Vivi
2023-09-20 19:52 ` [Intel-xe] ✓ CI.Patch_applied: success for uAPI Alignment - take 1 v2 Patchwork
2023-09-20 19:52 ` [Intel-xe] ✗ CI.checkpatch: warning " Patchwork
2023-09-20 19:53 ` [Intel-xe] ✓ CI.KUnit: success " Patchwork
2023-09-20 20:00 ` [Intel-xe] ✓ CI.Build: " Patchwork
2023-09-20 20:01 ` [Intel-xe] ✗ CI.Hooks: failure " Patchwork
2023-09-20 20:02 ` [Intel-xe] ✓ CI.checksparse: success " Patchwork
2023-09-20 20:36 ` [Intel-xe] ✗ CI.BAT: failure " Patchwork
2023-09-20 21:14 ` [Intel-xe] [PATCH v2 00/20] " Matt Roper
2023-09-20 21:54   ` Matthew Brost
2023-09-20 23:07     ` Matt Roper

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=20230920192940.135004-10-rodrigo.vivi@intel.com \
    --to=rodrigo.vivi@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