Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: sai.gowtham.ch@intel.com
To: igt-dev@lists.freedesktop.org, sai.gowtham.ch@intel.com
Subject: [PATCH i-g-t 2/2] tests/intel/xe_pm: Test to validate vm unbind all flag with suspend and resume
Date: Fri, 15 Mar 2024 10:35:36 +0530	[thread overview]
Message-ID: <20240315050536.21319-3-sai.gowtham.ch@intel.com> (raw)
In-Reply-To: <20240315050536.21319-1-sai.gowtham.ch@intel.com>

From: Sai Gowtham Ch <sai.gowtham.ch@intel.com>

Test to validate vm unbind all operation with suspend and resume.

Signed-off-by: Sai Gowtham Ch <sai.gowtham.ch@intel.com>
---
 tests/intel/xe_pm.c | 37 +++++++++++++++++++++++++++++++++++++
 1 file changed, 37 insertions(+)

diff --git a/tests/intel/xe_pm.c b/tests/intel/xe_pm.c
index ac402e757..f46120662 100644
--- a/tests/intel/xe_pm.c
+++ b/tests/intel/xe_pm.c
@@ -605,6 +605,40 @@ static void test_mmap(device_t device, uint32_t placement, uint32_t flags)
 	close(fw_handle);
 }
 
+/**
+ * SUBTEST: unbind-all
+ * Description: Validate vm unbind functionality with suspend and resume
+ *
+ * Functionality: pm - s3
+ * Run type: FULL
+ */
+static void unbind_all(device_t device, int n_vmas)
+{
+	uint32_t bo, bo_size = xe_get_default_alignment(device.fd_xe);
+	uint64_t addr = 0x1a0000;
+	uint32_t vm;
+	int i;
+
+	struct drm_xe_sync sync[1] = {
+		{ .type = DRM_XE_SYNC_TYPE_SYNCOBJ, .flags = DRM_XE_SYNC_FLAG_SIGNAL, },
+	};
+
+	vm = xe_vm_create(device.fd_xe, 0, 0);
+	bo = xe_bo_create(device.fd_xe, vm, bo_size, vram_if_possible(device.fd_xe, 0), 0);
+
+	for (i = 0; i < n_vmas; ++i)
+		xe_vm_bind_async(device.fd_xe, vm, 0, bo, 0, addr + i * bo_size, bo_size, NULL, 0);
+	igt_system_suspend_autoresume(SUSPEND_STATE_MEM, SUSPEND_TEST_NONE);
+	sync[0].handle = syncobj_create(device.fd_xe, 0);
+	xe_vm_unbind_all_async(device.fd_xe, vm, 0, bo, sync, 1);
+
+	igt_assert(syncobj_wait(device.fd_xe, &sync[0].handle, 1, INT64_MAX, 0, NULL));
+	syncobj_destroy(device.fd_xe, sync[0].handle);
+
+	gem_close(device.fd_xe, bo);
+	xe_vm_destroy(device.fd_xe, vm);
+}
+
 igt_main
 {
 	struct drm_xe_engine_class_instance *hwe;
@@ -768,6 +802,9 @@ igt_main
 		}
 	}
 
+	igt_subtest("unbind-all")
+		unbind_all(device, 2);
+
 	igt_fixture {
 		close(sysfs_fd);
 		igt_pm_set_d3cold_allowed(device.pci_slot_name, d3cold_allowed);
-- 
2.39.1


  parent reply	other threads:[~2024-03-15  5:06 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-15  5:05 [PATCH i-g-t 0/2] tests/intel/xe_pm: Tests to validate vm-bind sai.gowtham.ch
2024-03-15  5:05 ` [PATCH i-g-t 1/2] tests/intel/xe_pm: Test to validate vm bind functionality with suspend and resume sai.gowtham.ch
2024-03-21 20:37   ` Rodrigo Vivi
2024-03-22 17:12     ` Ch, Sai Gowtham
2024-03-15  5:05 ` sai.gowtham.ch [this message]
2024-03-21 20:44   ` [PATCH i-g-t 2/2] tests/intel/xe_pm: Test to validate vm unbind all flag " Rodrigo Vivi
2024-03-22 17:05     ` Ch, Sai Gowtham
2024-03-15  6:16 ` ✓ CI.xeBAT: success for tests/intel/xe_pm: Tests to validate vm-bind Patchwork
2024-03-15  6:38 ` ✓ Fi.CI.BAT: " Patchwork
2024-03-16  5:05 ` ✗ Fi.CI.IGT: failure " 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=20240315050536.21319-3-sai.gowtham.ch@intel.com \
    --to=sai.gowtham.ch@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    /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