Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: nakshtra.goyal@intel.com
To: igt-dev@lists.freedesktop.org, ramadevi.gandi@intel.com
Cc: matthew.d.roper@intel.com
Subject: [PATCH v5 i-g-t] tests/intel/xe_exec_reset: Add mocs reset test
Date: Mon, 18 Nov 2024 14:31:31 +0530	[thread overview]
Message-ID: <20241118090131.3233488-1-nakshtra.goyal@intel.com> (raw)

From: Nakshtra Goyal <nakshtra.goyal@intel.com>

v3: Correcting documentation for functionality and changing suspend resume
to gt reset,adding required header. (Matt Roper)

Signed-off-by: Nakshtra Goyal <nakshtra.goyal@intel.com>
Reviewed-by: Matt Roper <matthew.d.roper@intel.com>
---
 tests/intel/xe_exec_reset.c | 44 +++++++++++++++++++++++++++++++++++++
 1 file changed, 44 insertions(+)

diff --git a/tests/intel/xe_exec_reset.c b/tests/intel/xe_exec_reset.c
index 43ef1e334..a3eaf8bbf 100644
--- a/tests/intel/xe_exec_reset.c
+++ b/tests/intel/xe_exec_reset.c
@@ -12,6 +12,8 @@
  * Test category: functionality test
  */
 
+#include <fcntl.h>
+
 #include "igt.h"
 #include "lib/igt_syncobj.h"
 #include "lib/intel_reg.h"
@@ -715,6 +717,44 @@ gt_reset(int fd, int n_threads, int n_sec)
 	free(threads);
 }
 
+/**
+ * SUBTEST: gt-mocs-reset
+ * Description: Validate mocs register contents over GT reset
+ * Test category: mocs
+ *
+ */
+static void
+gt_mocs_reset(int fd, int gt)
+{
+	char path[256];
+
+	/* Mocs debugfs contents before and after GT reset.
+	 * Allocate memory to store 10k characters sufficient enough
+	 * to store global mocs and lncf mocs data.
+	 */
+	char *mocs_content_pre = (char *)malloc(10000 * sizeof(char));
+	char *mocs_contents_post = (char *)malloc(10000 * sizeof(char));
+
+	igt_assert(mocs_content_pre);
+	igt_assert(mocs_contents_post);
+
+	sprintf(path, "gt%d/mocs", gt);
+	igt_assert(igt_debugfs_exists(fd, path, O_RDONLY));
+	igt_debugfs_dump(fd, path);
+	igt_debugfs_read(fd, path, mocs_content_pre);
+
+	xe_force_gt_reset_sync(fd, gt);
+
+	igt_assert(igt_debugfs_exists(fd, path, O_RDONLY));
+	igt_debugfs_dump(fd, path);
+	igt_debugfs_read(fd, path, mocs_contents_post);
+
+	igt_assert(strcmp(mocs_content_pre, mocs_contents_post) == 0);
+
+	free(mocs_content_pre);
+	free(mocs_contents_post);
+}
+
 igt_main
 {
 	struct drm_xe_engine_class_instance *hwe;
@@ -820,6 +860,10 @@ igt_main
 	igt_subtest("gt-reset-stress")
 		gt_reset(fd, 4, 1);
 
+	igt_subtest("gt-mocs-reset")
+		xe_for_each_gt(fd, gt)
+			gt_mocs_reset(fd, gt);
+
 	igt_fixture
 		drm_close_driver(fd);
 }
-- 
2.34.1


             reply	other threads:[~2024-11-18  9:00 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-18  9:01 nakshtra.goyal [this message]
2024-11-18 21:19 ` ✓ CI.xeBAT: success for tests/intel/xe_exec_reset: Add mocs reset test (rev5) Patchwork
2024-11-18 21:37 ` ✗ Fi.CI.BAT: failure " Patchwork
2024-11-19  5:57 ` ✗ CI.xeFULL: " Patchwork
2024-11-22  4:08 ` ✓ i915.CI.BAT: success " Patchwork
2024-11-25  6:01 ` ✓ Xe.CI.BAT: success for tests/intel/xe_exec_reset: Add mocs reset test (rev6) Patchwork
2024-11-25  6:11 ` ✗ i915.CI.BAT: failure " Patchwork
2024-11-25  9:29 ` ✗ Xe.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=20241118090131.3233488-1-nakshtra.goyal@intel.com \
    --to=nakshtra.goyal@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=matthew.d.roper@intel.com \
    --cc=ramadevi.gandi@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