From: Ilia Levi <ilia.levi@intel.com>
To: intel-xe@lists.freedesktop.org
Cc: ilia.levi@intel.com, dliberman@habana.ai,
niranjana.vishwanathapura@intel.com, michal.wajdeczko@intel.com
Subject: [PATCH v4 09/11] drm/xe/exec: adding msix infra to exec queue
Date: Thu, 25 Jul 2024 13:22:11 +0300 [thread overview]
Message-ID: <20240725102213.2182896-10-ilia.levi@intel.com> (raw)
In-Reply-To: <20240725102213.2182896-1-ilia.levi@intel.com>
From: Dani Liberman <dliberman@habana.ai>
On MSIX platform each exec queue will allocate MSIX.
Signed-off-by: Dani Liberman <dliberman@habana.ai>
---
drivers/gpu/drm/xe/xe_exec_queue.c | 39 ++++++++++++++++++++++++
drivers/gpu/drm/xe/xe_exec_queue_types.h | 2 ++
2 files changed, 41 insertions(+)
diff --git a/drivers/gpu/drm/xe/xe_exec_queue.c b/drivers/gpu/drm/xe/xe_exec_queue.c
index 69867a7b7c77..c519db7a7a6e 100644
--- a/drivers/gpu/drm/xe/xe_exec_queue.c
+++ b/drivers/gpu/drm/xe/xe_exec_queue.c
@@ -22,6 +22,7 @@
#include "xe_ring_ops_types.h"
#include "xe_trace.h"
#include "xe_vm.h"
+#include "xe_irq.h"
enum xe_exec_queue_sched_prop {
XE_EXEC_QUEUE_JOB_TIMEOUT = 0,
@@ -33,8 +34,40 @@ enum xe_exec_queue_sched_prop {
static int exec_queue_user_extensions(struct xe_device *xe, struct xe_exec_queue *q,
u64 extensions, int ext_number);
+static int xe_exec_queue_msix_init(struct xe_device *xe, struct xe_exec_queue *q)
+{
+ u16 msix;
+ int ret = 0;
+
+ if (!xe_device_has_msix(xe))
+ return 0;
+
+ ret = xe_irq_request_irq(xe, xe_irq_msix_hwe_handler, q->hwe, q->hwe->name, true, &msix);
+ if (ret < 0) {
+ drm_dbg(&xe->drm, "Can't allocate unique MSIX to exec queue (%d)\n", ret);
+ return ret;
+ }
+
+ q->msix_number = msix;
+
+ return 0;
+}
+
+static void xe_exec_queue_msix_fini(struct xe_exec_queue *q)
+{
+ struct xe_device *xe = gt_to_xe(q->gt);
+
+ if (!xe_device_has_msix(xe))
+ return;
+
+ if (q->msix_number)
+ xe_irq_free_irq(xe, q->msix_number);
+}
+
static void __xe_exec_queue_free(struct xe_exec_queue *q)
{
+ xe_exec_queue_msix_fini(q);
+
if (q->vm)
xe_vm_put(q->vm);
@@ -85,6 +118,12 @@ static struct xe_exec_queue *__xe_exec_queue_alloc(struct xe_device *xe,
else
q->sched_props.priority = XE_EXEC_QUEUE_PRIORITY_NORMAL;
+ err = xe_exec_queue_msix_init(xe, q);
+ if (err) {
+ kfree(q);
+ return ERR_PTR(err);
+ }
+
if (vm)
q->vm = xe_vm_get(vm);
diff --git a/drivers/gpu/drm/xe/xe_exec_queue_types.h b/drivers/gpu/drm/xe/xe_exec_queue_types.h
index 1408b02eea53..fcfc3878464e 100644
--- a/drivers/gpu/drm/xe/xe_exec_queue_types.h
+++ b/drivers/gpu/drm/xe/xe_exec_queue_types.h
@@ -63,6 +63,8 @@ struct xe_exec_queue {
char name[MAX_FENCE_NAME_LEN];
/** @width: width (number BB submitted per exec) of this exec queue */
u16 width;
+ /** @msix_number: msix number */
+ u16 msix_number;
/** @fence_irq: fence IRQ used to signal job completion */
struct xe_hw_fence_irq *fence_irq;
--
2.43.2
next prev parent reply other threads:[~2024-07-25 10:23 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-25 10:22 [PATCH v4 00/11] Add MSIX functionality to XE Ilia Levi
2024-07-25 10:22 ` [PATCH v4 01/11] drm/xe/irq: refactor irq flows to support also msix Ilia Levi
2024-07-25 10:22 ` [PATCH v4 02/11] drm/xe/irq: add msix allocator Ilia Levi
2024-07-25 10:22 ` [PATCH v4 03/11] drm/xe: add irq offset of engine instance 0 to hw engine properties Ilia Levi
2024-07-25 10:22 ` [PATCH v4 04/11] drm/xe: move memirq out of vf Ilia Levi
2024-07-25 10:22 ` [PATCH v4 05/11] drm/xe: memirq infra changes for msix Ilia Levi
2024-07-25 10:22 ` [PATCH v4 06/11] drm/xe/irq: add hw engine irq handler Ilia Levi
2024-07-25 10:22 ` [PATCH v4 07/11] drm/xe: move the kernel lrc from hwe to execlist port Ilia Levi
2024-07-25 10:22 ` [PATCH v4 08/11] drm/xe: msix support preparations - enable memirq Ilia Levi
2024-07-25 10:22 ` Ilia Levi [this message]
2024-07-25 10:22 ` [PATCH v4 10/11] drm/xe/irq: add default msix Ilia Levi
2024-07-25 10:22 ` [PATCH v4 11/11] drm/xe: msix support for hw engines Ilia Levi
2024-07-25 10:29 ` ✓ CI.Patch_applied: success for Add MSIX functionality to XE (rev6) Patchwork
2024-07-25 10:29 ` ✓ CI.checkpatch: " Patchwork
2024-07-25 10:30 ` ✓ CI.KUnit: " Patchwork
2024-07-25 10:50 ` ✓ CI.Build: " Patchwork
2024-07-25 10:52 ` ✓ CI.Hooks: " Patchwork
2024-07-25 10:53 ` ✓ CI.checksparse: " Patchwork
2024-07-25 11:39 ` ✗ CI.BAT: failure " Patchwork
2024-07-25 13:35 ` ✗ CI.FULL: " Patchwork
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=20240725102213.2182896-10-ilia.levi@intel.com \
--to=ilia.levi@intel.com \
--cc=dliberman@habana.ai \
--cc=intel-xe@lists.freedesktop.org \
--cc=michal.wajdeczko@intel.com \
--cc=niranjana.vishwanathapura@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