From: janga.rahul.kumar@intel.com
To: igt-dev@lists.freedesktop.org, ramadevi.gandi@intel.com,
janga.rahul.kumar@intel.com
Cc: sai.gowtham.ch@intel.com, kunal1.joshi@intel.com
Subject: [igt-dev] [PATCH i-g-t 3/3] lib/igt_gt: Extend hang library support to XE
Date: Wed, 16 Aug 2023 15:54:31 +0530 [thread overview]
Message-ID: <20230816102431.2014326-4-janga.rahul.kumar@intel.com> (raw)
In-Reply-To: <20230816102431.2014326-1-janga.rahul.kumar@intel.com>
From: Janga Rahul Kumar <janga.rahul.kumar@intel.com>
Extend hang library support to XE driver and update
the documentation.
Cc: Sai Gowtham Ch <sai.gowtham.ch@intel.com>
Cc: Kunal Joshi <kunal1.joshi@intel.com>
Cc: Kamil Konieczny <kamil.konieczny@linux.intel.com>
Cc: Anna Karas <anna.karas@intel.com>
Signed-off-by: Janga Rahul Kumar <janga.rahul.kumar@intel.com>
Tested-by: Kunal Joshi <kunal1.joshi@intel.com>
Reviewed-by: Sai Gowtham Ch <sai.gowtham.ch@intel.com>
---
lib/igt_gt.c | 29 +++++++++++++++++++++++++----
1 file changed, 25 insertions(+), 4 deletions(-)
diff --git a/lib/igt_gt.c b/lib/igt_gt.c
index d4a825e66..7cf0e468e 100644
--- a/lib/igt_gt.c
+++ b/lib/igt_gt.c
@@ -44,6 +44,7 @@
#include "intel_reg.h"
#include "intel_chipset.h"
#include "igt_dummyload.h"
+#include "xe/xe_gt.h"
/**
* SECTION:igt_gt
@@ -179,6 +180,12 @@ igt_hang_t igt_allow_hang(int fd, unsigned ctx, unsigned flags)
*/
if (!igt_check_boolean_env_var("IGT_HANG", true))
igt_skip("hang injection disabled by user [IGT_HANG=0]\n");
+
+ if (is_xe_device(fd)) {
+ igt_require(has_gpu_reset(fd));
+ return (struct igt_hang){ 0, ctx, 0, flags };
+ }
+
gem_context_require_bannable(fd);
if (flags & HANG_WANT_ENGINE_RESET)
@@ -215,6 +222,9 @@ igt_hang_t igt_allow_hang(int fd, unsigned ctx, unsigned flags)
void igt_disallow_hang(int fd, igt_hang_t arg)
{
+ if (is_xe_device(fd))
+ return;
+
context_set_ban(fd, arg.ctx, arg.ban);
if ((arg.flags & HANG_ALLOW_CAPTURE) == 0) {
@@ -269,8 +279,8 @@ static bool has_ctx_exec(int fd, unsigned ring, uint32_t ctx)
/**
* igt_hang_ring_ctx:
- * @fd: open i915 drm file descriptor
- * @ctx: the contxt specifier
+ * @fd: open i915/xe drm file descriptor
+ * @ctx: the context specifier
* @ring: execbuf ring flag
* @flags: set of flags to control execution
* @offset: The resultant gtt offset of the exec obj
@@ -290,6 +300,9 @@ static igt_hang_t __igt_hang_ctx(int fd, uint64_t ahnd, uint32_t ctx, int ring,
igt_spin_t *spin;
unsigned ban;
+ if (is_xe_device(fd))
+ return xe_hang_ring(fd, ahnd, ctx, ring, flags);
+
igt_require_hang_ring(fd, ctx, ring);
/* check if non-default ctx submission is allowed */
@@ -334,7 +347,7 @@ igt_hang_t igt_hang_ctx_with_ahnd(int fd, uint64_t ahnd, uint32_t ctx, int ring,
/**
* igt_hang_ring:
- * @fd: open i915 drm file descriptor
+ * @fd: open i915/xe drm file descriptor
* @ring: execbuf ring flag
*
* This helper function injects a hanging batch into @ring. It returns a
@@ -357,7 +370,7 @@ igt_hang_t igt_hang_ring_with_ahnd(int fd, int ring, uint64_t ahnd)
/**
* igt_post_hang_ring:
- * @fd: open i915 drm file descriptor
+ * @fd: open i915/xe drm file descriptor
* @arg: hang state from igt_hang_ring()
*
* This function does the necessary post-processing after a gpu hang injected
@@ -368,6 +381,11 @@ void igt_post_hang_ring(int fd, igt_hang_t arg)
if (!arg.spin)
return;
+ if (is_xe_device(fd)) {
+ igt_spin_free(fd, arg.spin);
+ xe_post_hang_ring(fd, arg);
+ }
+
gem_sync(fd, arg.spin->handle); /* Wait until it hangs */
igt_spin_free(fd, arg.spin);
@@ -399,6 +417,9 @@ void igt_force_gpu_reset(int drm_fd)
igt_debug("Triggering GPU reset\n");
+ if (is_xe_device(drm_fd))
+ xe_force_gt_reset_all(drm_fd);
+
dir = igt_debugfs_dir(drm_fd);
wedged = 0;
--
2.25.1
next prev parent reply other threads:[~2023-08-16 10:22 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-16 10:24 [igt-dev] [PATCH i-g-t 0/3] Add Xe lib support for hang & GT reset janga.rahul.kumar
2023-08-16 10:24 ` [igt-dev] [PATCH i-g-t 1/3] lib/xe: Add support to reset all GT's janga.rahul.kumar
2023-08-16 10:24 ` [igt-dev] [PATCH i-g-t 2/3] lib/xe: Add hang library support janga.rahul.kumar
2023-08-16 10:24 ` janga.rahul.kumar [this message]
2023-08-16 11:00 ` [igt-dev] ✗ GitLab.Pipeline: warning for Add Xe lib support for hang & GT reset (rev6) Patchwork
2023-08-16 11:37 ` [igt-dev] ✓ Fi.CI.BAT: success " Patchwork
2023-08-16 12:36 ` [igt-dev] ○ CI.xeBAT: info " Patchwork
2023-08-16 16:50 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
2023-08-17 18:08 ` Kamil Konieczny
2023-08-18 12:35 ` Yedireswarapu, SaiX Nandan
-- strict thread matches above, loose matches on Subject: below --
2023-08-14 17:29 [igt-dev] [PATCH i-g-t 0/3] Add Xe lib support for hang & GT reset janga.rahul.kumar
2023-08-14 17:29 ` [igt-dev] [PATCH i-g-t 3/3] lib/igt_gt: Extend hang library support to XE janga.rahul.kumar
2023-08-10 21:25 [igt-dev] [PATCH i-g-t 0/3] Add Xe lib support for hang & GT reset janga.rahul.kumar
2023-08-10 21:25 ` [igt-dev] [PATCH i-g-t 3/3] lib/igt_gt: Extend hang library support to XE janga.rahul.kumar
2023-08-07 3:58 [igt-dev] [PATCH i-g-t 0/3] Add Xe lib support for hang & GT reset janga.rahul.kumar
2023-08-07 3:58 ` [igt-dev] [PATCH i-g-t 3/3] lib/igt_gt: Extend hang library support to XE janga.rahul.kumar
2023-08-10 12:58 ` Ch, Sai Gowtham
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=20230816102431.2014326-4-janga.rahul.kumar@intel.com \
--to=janga.rahul.kumar@intel.com \
--cc=igt-dev@lists.freedesktop.org \
--cc=kunal1.joshi@intel.com \
--cc=ramadevi.gandi@intel.com \
--cc=sai.gowtham.ch@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