From: Ashutosh Dixit <ashutosh.dixit@intel.com>
To: intel-xe@lists.freedesktop.org
Cc: Umesh Nerlige Ramappa <umesh.nerlige.ramappa@intel.com>
Subject: [PATCH 2/2] drm/xe/oa: Allow subsequent OA streams to be opened on an exec_queue
Date: Fri, 8 Nov 2024 15:06:01 -0800 [thread overview]
Message-ID: <20241108230602.2984959-3-ashutosh.dixit@intel.com> (raw)
In-Reply-To: <20241108230602.2984959-1-ashutosh.dixit@intel.com>
The restriction that OA not be enabled on an active exec queue only applies
to the first OA stream opened on the exec queue. Subsequent OA streams can
be opened on the exec queue since this will not toggle the
OAC_CONTEXT_ENABLE bit.
Fixes: 2f4a730fcd2d ("drm/xe/oa: Add OAR support")
Cc: stable@vger.kernel.org
Signed-off-by: Ashutosh Dixit <ashutosh.dixit@intel.com>
---
drivers/gpu/drm/xe/xe_exec_queue_types.h | 2 ++
drivers/gpu/drm/xe/xe_oa.c | 8 ++++++--
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/xe/xe_exec_queue_types.h b/drivers/gpu/drm/xe/xe_exec_queue_types.h
index 1158b6062a6cd..6e3311c22404e 100644
--- a/drivers/gpu/drm/xe/xe_exec_queue_types.h
+++ b/drivers/gpu/drm/xe/xe_exec_queue_types.h
@@ -142,6 +142,8 @@ struct xe_exec_queue {
u64 tlb_flush_seqno;
/** @hw_engine_group_link: link into exec queues in the same hw engine group */
struct list_head hw_engine_group_link;
+ /** @oa: this exec_queue is used for OA (OAR/OAC) */
+ bool oa;
/** @lrc: logical ring context for this exec queue */
struct xe_lrc *lrc[] __counted_by(width);
};
diff --git a/drivers/gpu/drm/xe/xe_oa.c b/drivers/gpu/drm/xe/xe_oa.c
index b0692b8ca0a3d..53d2946ea3052 100644
--- a/drivers/gpu/drm/xe/xe_oa.c
+++ b/drivers/gpu/drm/xe/xe_oa.c
@@ -1915,6 +1915,9 @@ static int xe_oa_stream_open_ioctl_locked(struct xe_oa *oa,
goto err_disable;
}
+ if (stream->exec_q && !stream->exec_q->oa)
+ stream->exec_q->oa = true;
+
/* Hold a reference on the drm device till stream_fd is released */
drm_dev_get(&stream->oa->xe->drm);
@@ -2068,9 +2071,10 @@ int xe_oa_stream_open_ioctl(struct drm_device *dev, u64 data, struct drm_file *f
/*
* Disallow OA from being enabled on active exec_queue's. Enabling OA toggles
* the OAC_CONTEXT_ENABLE bit in CTXT_SR_CTL register, which changes the size
- * and layout of the underlying HW context image and can cause hangs.
+ * and layout of the underlying HW context image and can cause hangs. This
+ * restriction holds only for the first OA stream opened on the exec queue.
*/
- if (XE_IOCTL_DBG(oa->xe, exec_queue_enabled(param.exec_q))) {
+ if (XE_IOCTL_DBG(oa->xe, !param.exec_q->oa && exec_queue_enabled(param.exec_q))) {
ret = -EADDRINUSE;
goto err_exec_q;
}
--
2.41.0
next prev parent reply other threads:[~2024-11-08 23:06 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-08 23:05 [PATCH 0/2] Disallow OA from being enabled on active exec_queue's Ashutosh Dixit
2024-11-08 23:06 ` [PATCH 1/2] drm/xe/oa: " Ashutosh Dixit
2024-11-08 23:14 ` Matthew Brost
2024-11-19 1:35 ` Dixit, Ashutosh
2024-11-08 23:38 ` Cavitt, Jonathan
2024-11-08 23:06 ` Ashutosh Dixit [this message]
2024-11-08 23:42 ` [PATCH 2/2] drm/xe/oa: Allow subsequent OA streams to be opened on an exec_queue Cavitt, Jonathan
2024-11-19 1:36 ` Dixit, Ashutosh
2024-11-08 23:11 ` ✓ CI.Patch_applied: success for Disallow OA from being enabled on active exec_queue's Patchwork
2024-11-08 23:11 ` ✓ CI.checkpatch: " Patchwork
2024-11-08 23:12 ` ✓ CI.KUnit: " Patchwork
2024-11-08 23:24 ` ✓ CI.Build: " Patchwork
2024-11-08 23:26 ` ✓ CI.Hooks: " Patchwork
2024-11-08 23:28 ` ✓ CI.checksparse: " Patchwork
2024-11-08 23:45 ` ✓ CI.BAT: " Patchwork
2024-11-10 2:29 ` ✗ CI.FULL: failure " Patchwork
2024-11-11 14:31 ` [PATCH 0/2] " Souza, Jose
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=20241108230602.2984959-3-ashutosh.dixit@intel.com \
--to=ashutosh.dixit@intel.com \
--cc=intel-xe@lists.freedesktop.org \
--cc=umesh.nerlige.ramappa@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