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: kamil.kopryk@intel.com, filip.hazubski@intel.com,
	jakub.chaberek@intel.com, effie.yu@intel.com,
	bartosz.dunajski@intel.com, Rodrigo Vivi <rodrigo.vivi@intel.com>,
	carl.zhang@intel.com
Subject: [Intel-xe] [PATCH 08/17] drm/xe: Deprecate XE_EXEC_QUEUE_SET_PROPERTY_COMPUTE_MODE implementation
Date: Tue, 19 Sep 2023 10:24:55 -0400	[thread overview]
Message-ID: <20230919142504.91652-9-rodrigo.vivi@intel.com> (raw)
In-Reply-To: <20230919142504.91652-1-rodrigo.vivi@intel.com>

From: Matthew Brost <matthew.brost@intel.com>

We are going to remove XE_EXEC_QUEUE_SET_PROPERTY_COMPUTE_MODE from the
uAPI, deprecate the implementation first by making
XE_EXEC_QUEUE_SET_PROPERTY_COMPUTE_MODE a NOP. After removal of
XE_EXEC_QUEUE_SET_PROPERTY_COMPUTE_MODE the proper is simply inherented
from the VM.

v2:
 - Update commit message with explaination of removal (Niranjana)

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       | 57 ++++++------------------
 drivers/gpu/drm/xe/xe_exec_queue_types.h |  6 +--
 2 files changed, 16 insertions(+), 47 deletions(-)

diff --git a/drivers/gpu/drm/xe/xe_exec_queue.c b/drivers/gpu/drm/xe/xe_exec_queue.c
index 6f1e64896a2d..68cd2234acf5 100644
--- a/drivers/gpu/drm/xe/xe_exec_queue.c
+++ b/drivers/gpu/drm/xe/xe_exec_queue.c
@@ -323,39 +323,6 @@ static int exec_queue_set_preemption_timeout(struct xe_device *xe,
 static int exec_queue_set_compute_mode(struct xe_device *xe, struct xe_exec_queue *q,
 				       u64 value, bool create)
 {
-	if (XE_IOCTL_DBG(xe, !create))
-		return -EINVAL;
-
-	if (XE_IOCTL_DBG(xe, q->flags & EXEC_QUEUE_FLAG_COMPUTE_MODE))
-		return -EINVAL;
-
-	if (XE_IOCTL_DBG(xe, q->flags & EXEC_QUEUE_FLAG_VM))
-		return -EINVAL;
-
-	if (value) {
-		struct xe_vm *vm = q->vm;
-		int err;
-
-		if (XE_IOCTL_DBG(xe, xe_vm_in_fault_mode(vm)))
-			return -EOPNOTSUPP;
-
-		if (XE_IOCTL_DBG(xe, !xe_vm_in_compute_mode(vm)))
-			return -EOPNOTSUPP;
-
-		if (XE_IOCTL_DBG(xe, q->width != 1))
-			return -EINVAL;
-
-		q->compute.context = dma_fence_context_alloc(1);
-		spin_lock_init(&q->compute.lock);
-
-		err = xe_vm_add_compute_exec_queue(vm, q);
-		if (XE_IOCTL_DBG(xe, err))
-			return err;
-
-		q->flags |= EXEC_QUEUE_FLAG_COMPUTE_MODE;
-		q->flags &= ~EXEC_QUEUE_FLAG_PERSISTENT;
-	}
-
 	return 0;
 }
 
@@ -365,7 +332,7 @@ static int exec_queue_set_persistence(struct xe_device *xe, struct xe_exec_queue
 	if (XE_IOCTL_DBG(xe, !create))
 		return -EINVAL;
 
-	if (XE_IOCTL_DBG(xe, q->flags & EXEC_QUEUE_FLAG_COMPUTE_MODE))
+	if (XE_IOCTL_DBG(xe, xe_vm_in_compute_mode(q->vm)))
 		return -EINVAL;
 
 	if (value)
@@ -742,18 +709,21 @@ int xe_exec_queue_create_ioctl(struct drm_device *dev, void *data,
 		xe_vm_put(vm);
 		if (IS_ERR(q))
 			return PTR_ERR(q);
+
+		if (xe_vm_in_compute_mode(vm)) {
+			q->compute.context = dma_fence_context_alloc(1);
+			spin_lock_init(&q->compute.lock);
+
+			err = xe_vm_add_compute_exec_queue(vm, q);
+			if (XE_IOCTL_DBG(xe, err))
+				goto put_exec_queue;
+		}
 	}
 
 	if (args->extensions) {
 		err = exec_queue_user_extensions(xe, q, args->extensions, 0, true);
 		if (XE_IOCTL_DBG(xe, err))
-			goto put_exec_queue;
-	}
-
-	if (XE_IOCTL_DBG(xe, q->vm && xe_vm_in_compute_mode(q->vm) !=
-			 !!(q->flags & EXEC_QUEUE_FLAG_COMPUTE_MODE))) {
-		err = -EOPNOTSUPP;
-		goto put_exec_queue;
+			goto kill_exec_queue;
 	}
 
 	q->persistent.xef = xef;
@@ -762,14 +732,15 @@ int xe_exec_queue_create_ioctl(struct drm_device *dev, void *data,
 	err = xa_alloc(&xef->exec_queue.xa, &id, q, xa_limit_32b, GFP_KERNEL);
 	mutex_unlock(&xef->exec_queue.lock);
 	if (err)
-		goto put_exec_queue;
+		goto kill_exec_queue;
 
 	args->exec_queue_id = id;
 
 	return 0;
 
-put_exec_queue:
+kill_exec_queue:
 	xe_exec_queue_kill(q);
+put_exec_queue:
 	xe_exec_queue_put(q);
 	return err;
 }
diff --git a/drivers/gpu/drm/xe/xe_exec_queue_types.h b/drivers/gpu/drm/xe/xe_exec_queue_types.h
index 347d28442701..f73b9e80b25a 100644
--- a/drivers/gpu/drm/xe/xe_exec_queue_types.h
+++ b/drivers/gpu/drm/xe/xe_exec_queue_types.h
@@ -60,12 +60,10 @@ struct xe_exec_queue {
 #define EXEC_QUEUE_FLAG_PERMANENT		BIT(2)
 /* queue keeps running pending jobs after destroy ioctl */
 #define EXEC_QUEUE_FLAG_PERSISTENT		BIT(3)
-/* queue for use with compute VMs */
-#define EXEC_QUEUE_FLAG_COMPUTE_MODE		BIT(4)
 /* for VM jobs. Caller needs to hold rpm ref when creating queue with this flag */
-#define EXEC_QUEUE_FLAG_VM			BIT(5)
+#define EXEC_QUEUE_FLAG_VM			BIT(4)
 /* child of VM queue for multi-tile VM jobs */
-#define EXEC_QUEUE_FLAG_BIND_ENGINE_CHILD	BIT(6)
+#define EXEC_QUEUE_FLAG_BIND_ENGINE_CHILD	BIT(5)
 
 	/**
 	 * @flags: flags for this exec queue, should statically setup aside from ban
-- 
2.41.0


  parent reply	other threads:[~2023-09-19 14:29 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-19 14:24 [Intel-xe] [PATCH 00/17] uAPI Alignment - take 1 Rodrigo Vivi
2023-09-19 14:24 ` [Intel-xe] [PATCH 01/17] drm/xe: Fix array bounds check for queries Rodrigo Vivi
2023-09-19 14:24 ` [Intel-xe] [PATCH 02/17] drm/xe: Set the correct type for xe_to_user_engine_class Rodrigo Vivi
2023-09-19 14:24 ` [Intel-xe] [PATCH 03/17] drm/xe: Correlate engine and cpu timestamps with better accuracy Rodrigo Vivi
2023-09-19 14:24 ` [Intel-xe] [PATCH 04/17] drm/xe/uapi: Separate VM_BIND's operation and flag Rodrigo Vivi
2023-09-19 20:39   ` Matthew Brost
2023-09-19 14:24 ` [Intel-xe] [PATCH 05/17] drm/xe/vm: Remove VM_BIND_OP macro Rodrigo Vivi
2023-09-19 14:41   ` Matthew Brost
2023-09-19 14:24 ` [Intel-xe] [PATCH 06/17] drm/xe/uapi: Remove MMIO ioctl Rodrigo Vivi
2023-09-19 14:24 ` [Intel-xe] [PATCH 07/17] drm/xe: Fix xe_exec_queue_is_idle for parallel exec queues Rodrigo Vivi
2023-09-19 14:24 ` Rodrigo Vivi [this message]
2023-09-19 14:24 ` [Intel-xe] [PATCH 09/17] drm/xe: Rename exec_queue_kill_compute to xe_vm_remove_compute_exec_queue Rodrigo Vivi
2023-09-19 14:24 ` [Intel-xe] [PATCH 10/17] drm/xe: Remove XE_EXEC_QUEUE_SET_PROPERTY_COMPUTE_MODE from uAPI Rodrigo Vivi
2023-10-07  8:20   ` Zhang, Carl
2023-10-09 17:43     ` Francois Dugast
2023-09-19 14:24 ` [Intel-xe] [PATCH 11/17] drm/xe/uapi: Use common drm_xe_ext_set_property extension Rodrigo Vivi
2023-09-19 20:41   ` Matthew Brost
2023-09-19 14:24 ` [Intel-xe] [PATCH 12/17] drm/xe: Kill XE_VM_PROPERTY_BIND_OP_ERROR_CAPTURE_ADDRESS extension Rodrigo Vivi
2023-10-07  8:35   ` Zhang, Carl
2023-09-19 14:25 ` [Intel-xe] [PATCH 13/17] drm/xe/uapi: Document drm_xe_query_gt Rodrigo Vivi
2023-09-19 14:48   ` Matthew Brost
2023-09-19 14:25 ` [Intel-xe] [PATCH 14/17] drm/xe/uapi: Replace useless 'instance' per unique gt_id Rodrigo Vivi
2023-09-19 20:44   ` Matthew Brost
2023-09-19 14:25 ` [Intel-xe] [PATCH 15/17] drm/xe/uapi: Remove unused field of drm_xe_query_gt Rodrigo Vivi
2023-09-19 20:52   ` Matthew Brost
2023-09-19 14:25 ` [Intel-xe] [PATCH 16/17] drm/xe/uapi: Rename gts to gt_list Rodrigo Vivi
2023-09-19 14:25 ` [Intel-xe] [PATCH 17/17] drm/xe/uapi: Fix naming of XE_QUERY_CONFIG_MAX_EXEC_QUEUE_PRIORITY Rodrigo Vivi
2023-09-19 14:44   ` Matthew Brost
2023-09-19 14:32 ` [Intel-xe] ✓ CI.Patch_applied: success for uAPI Alignment - take 1 Patchwork
2023-09-19 14:32 ` [Intel-xe] ✗ CI.checkpatch: warning " Patchwork
2023-09-19 14:33 ` [Intel-xe] ✓ CI.KUnit: success " Patchwork
2023-09-19 14:42 ` [Intel-xe] ✗ CI.Build: failure " Patchwork
2023-09-19 17:19 ` [Intel-xe] [PATCH 00/17] " Souza, Jose
2023-09-21 15:06 ` Zhang, Carl
2023-09-22 18:56   ` Rodrigo Vivi
2023-10-08  8:06     ` Zhang, Carl

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=20230919142504.91652-9-rodrigo.vivi@intel.com \
    --to=rodrigo.vivi@intel.com \
    --cc=bartosz.dunajski@intel.com \
    --cc=carl.zhang@intel.com \
    --cc=effie.yu@intel.com \
    --cc=filip.hazubski@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=jakub.chaberek@intel.com \
    --cc=kamil.kopryk@intel.com \
    /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