Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Bommu Krishnaiah <krishnaiah.bommu@intel.com>
To: igt-dev@lists.freedesktop.org
Cc: Bommu Krishnaiah <krishnaiah.bommu@intel.com>
Subject: [igt-dev] [PATCH] tests/ xe_exec_compute_mode: Increase fence timeout for simulation env
Date: Fri, 16 Jun 2023 16:35:19 +0530	[thread overview]
Message-ID: <20230616110519.3903-1-krishnaiah.bommu@intel.com> (raw)

Increase fence timeout to 100 seconds for simulation env.
Value is determined based on experiments.

Signed-off-by: Bommu Krishnaiah <krishnaiah.bommu@intel.com>
---
 tests/xe/xe_exec_compute_mode.c | 20 ++++++++++++++------
 1 file changed, 14 insertions(+), 6 deletions(-)

diff --git a/tests/xe/xe_exec_compute_mode.c b/tests/xe/xe_exec_compute_mode.c
index 68519399..aba35c19 100644
--- a/tests/xe/xe_exec_compute_mode.c
+++ b/tests/xe/xe_exec_compute_mode.c
@@ -113,6 +113,7 @@ test_exec(int fd, struct drm_xe_engine_class_instance *eci,
 	} *data;
 	int i, j, b;
 	int map_fd = -1;
+	int64_t fence_timeout;
 
 	igt_assert(n_engines <= MAX_N_ENGINES);
 
@@ -184,7 +185,12 @@ test_exec(int fd, struct drm_xe_engine_class_instance *eci,
 					 to_user_pointer(data), addr,
 					 bo_size, sync, 1);
 #define ONE_SEC	1000
-	xe_wait_ufence(fd, &data[0].vm_sync, USER_FENCE_VALUE, NULL, ONE_SEC);
+#define HUNDRED_SEC	100000
+
+	fence_timeout = igt_run_in_simulation() ? HUNDRED_SEC : ONE_SEC;
+
+	xe_wait_ufence(fd, &data[0].vm_sync, USER_FENCE_VALUE, NULL,
+		       fence_timeout);
 	data[0].vm_sync = 0;
 
 	for (i = 0; i < n_execs; i++) {
@@ -210,7 +216,7 @@ test_exec(int fd, struct drm_xe_engine_class_instance *eci,
 
 		if (flags & REBIND && i + 1 != n_execs) {
 			xe_wait_ufence(fd, &data[i].exec_sync, USER_FENCE_VALUE,
-				       NULL, ONE_SEC);
+				       NULL, fence_timeout);
 			xe_vm_unbind_async(fd, vm, bind_engines[e], 0,
 					   addr, bo_size, NULL, 0);
 
@@ -226,7 +232,7 @@ test_exec(int fd, struct drm_xe_engine_class_instance *eci,
 							 addr, bo_size, sync,
 							 1);
 			xe_wait_ufence(fd, &data[0].vm_sync, USER_FENCE_VALUE,
-				       NULL, ONE_SEC);
+				       NULL, fence_timeout);
 			data[0].vm_sync = 0;
 		}
 
@@ -239,7 +245,8 @@ test_exec(int fd, struct drm_xe_engine_class_instance *eci,
 				 * an invalidate.
 				 */
 				xe_wait_ufence(fd, &data[i].exec_sync,
-					       USER_FENCE_VALUE, NULL, ONE_SEC);
+					       USER_FENCE_VALUE, NULL,
+					       fence_timeout);
 				igt_assert_eq(data[i].data, 0xc0ffee);
 			} else if (i * 2 != n_execs) {
 				/*
@@ -269,7 +276,7 @@ test_exec(int fd, struct drm_xe_engine_class_instance *eci,
 	j = flags & INVALIDATE ? n_execs - 1 : 0;
 	for (i = j; i < n_execs; i++)
 		xe_wait_ufence(fd, &data[i].exec_sync, USER_FENCE_VALUE, NULL,
-			       ONE_SEC);
+			       fence_timeout);
 
 	/* Wait for all execs to complete */
 	if (flags & INVALIDATE)
@@ -278,7 +285,8 @@ test_exec(int fd, struct drm_xe_engine_class_instance *eci,
 	sync[0].addr = to_user_pointer(&data[0].vm_sync);
 	xe_vm_unbind_async(fd, vm, bind_engines[0], 0, addr, bo_size,
 			   sync, 1);
-	xe_wait_ufence(fd, &data[0].vm_sync, USER_FENCE_VALUE, NULL, ONE_SEC);
+	xe_wait_ufence(fd, &data[0].vm_sync, USER_FENCE_VALUE, NULL,
+		       fence_timeout);
 
 	for (i = j; i < n_execs; i++)
 		igt_assert_eq(data[i].data, 0xc0ffee);
-- 
2.25.1

             reply	other threads:[~2023-06-16 11:10 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-16 11:05 Bommu Krishnaiah [this message]
2023-06-19  5:52 ` [igt-dev] [PATCH] tests/ xe_exec_compute_mode: Increase fence timeout for simulation env Zbigniew Kempczyński
2023-06-20  9:38   ` Bommu, Krishnaiah
2023-06-20 10:56     ` Zbigniew Kempczyński
2023-06-19 14:13 ` Kamil Konieczny
2023-06-19 16:39   ` Bommu, Krishnaiah

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=20230616110519.3903-1-krishnaiah.bommu@intel.com \
    --to=krishnaiah.bommu@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