public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
From: sai gowtham <sai.gowtham.ch@intel.com>
To: sai.gowtham.ch@intel.com, igt-dev@lists.freedesktop.org
Subject: [igt-dev] [PATCH] [PATCH i-g-t]tests/i915/gem_exec_create: Added __for_each_physical_engine to utilize all available engines.
Date: Tue, 18 Feb 2020 17:45:49 +0530	[thread overview]
Message-ID: <20200218121549.12917-1-sai.gowtham.ch@intel.com> (raw)

From: saigowth <sai.gowtham.ch@intel.com>

Replaced the legacy for_each_engine* defines with the ones
implemented in the gem_engine_topology library.

Cc: Dec Katarzyna <katarzyna.dec@intel.com>
Cc: Ursulin Tvrtko <tvrtko.ursulin@intel.com>
Signed-off-by: sai gowtham <sai.gowtham.ch@intel.com>
---
 tests/i915/gem_exec_create.c | 29 ++++++++++++++++-------------
 1 file changed, 16 insertions(+), 13 deletions(-)

diff --git a/tests/i915/gem_exec_create.c b/tests/i915/gem_exec_create.c
index 102a161d..c70572af 100644
--- a/tests/i915/gem_exec_create.c
+++ b/tests/i915/gem_exec_create.c
@@ -58,14 +58,15 @@ static double elapsed(const struct timespec *start, const struct timespec *end)
 
 static void all(int fd, unsigned flags, int timeout, int ncpus)
 {
+	const struct intel_execution_engine2 *e;
 	const uint32_t bbe = MI_BATCH_BUFFER_END;
 	struct drm_i915_gem_execbuffer2 execbuf;
 	struct drm_i915_gem_exec_object2 obj;
 	unsigned engines[16], nengine;
 
 	nengine = 0;
-	for_each_physical_engine(e, fd)
-		engines[nengine++] = eb_ring(e);
+	__for_each_physical_engine(fd, e)
+		engines[nengine++] = e->flags;
 	igt_require(nengine);
 
 	memset(&obj, 0, sizeof(obj));
@@ -86,38 +87,40 @@ static void all(int fd, unsigned flags, int timeout, int ncpus)
 
 	intel_detect_and_clear_missed_interrupts(fd);
 	igt_fork(child, ncpus) {
+		int i915;
 		struct timespec start, now;
 		unsigned long count;
 		double time;
-
+		i915 = gem_reopen_driver(fd);
+		gem_context_copy_engines(fd, 0, i915, 0);
 		count = 0;
 		clock_gettime(CLOCK_MONOTONIC, &start);
 		do {
 			for (int loop = 0; loop < 1024; loop++) {
 				for (int n = 0; n < nengine; n++) {
-					obj.handle =  gem_create(fd, 4096);
-					gem_write(fd, obj.handle, 0, &bbe, sizeof(bbe));
+					obj.handle =  gem_create(i915, 4096);
+					gem_write(i915, obj.handle, 0, &bbe, sizeof(bbe));
 					execbuf.flags &= ~ENGINE_FLAGS;
 					execbuf.flags |= engines[n];
-					gem_execbuf(fd, &execbuf);
+					gem_execbuf(i915, &execbuf);
 					if (flags & LEAK)
-						gem_madvise(fd, obj.handle, I915_MADV_DONTNEED);
+						gem_madvise(i915, obj.handle, I915_MADV_DONTNEED);
 					else
-						gem_close(fd, obj.handle);
+						gem_close(i915, obj.handle);
 				}
 			}
 			count += nengine * 1024;
 			clock_gettime(CLOCK_MONOTONIC, &now);
 		} while (elapsed(&start, &now) < timeout); /* Hang detection ~120s */
-		obj.handle =  gem_create(fd, 4096);
-		gem_write(fd, obj.handle, 0, &bbe, sizeof(bbe));
+		obj.handle =  gem_create(i915, 4096);
+		gem_write(i915, obj.handle, 0, &bbe, sizeof(bbe));
 		for (int n = 0; n < nengine; n++) {
 			execbuf.flags &= ~ENGINE_FLAGS;
 			execbuf.flags |= engines[n];
-			gem_execbuf(fd, &execbuf);
+			gem_execbuf(i915, &execbuf);
 		}
-		gem_sync(fd, obj.handle);
-		gem_close(fd, obj.handle);
+		gem_sync(i915, obj.handle);
+		gem_close(i915, obj.handle);
 		clock_gettime(CLOCK_MONOTONIC, &now);
 
 		time = elapsed(&start, &now) / count;
-- 
2.25.0

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

             reply	other threads:[~2020-02-18 12:16 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-18 12:15 sai gowtham [this message]
2020-02-18 18:26 ` [igt-dev] ✓ Fi.CI.BAT: success for tests/i915/gem_exec_create: Added __for_each_physical_engine to utilize all available engines Patchwork
2020-02-20  4:01 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
2020-03-05 12:42 ` [igt-dev] [PATCH] [PATCH i-g-t]tests/i915/gem_exec_create: " Katarzyna Dec
2020-03-06  3:20   ` Ch, Sai Gowtham
2020-03-06 10:23     ` Tvrtko Ursulin
2020-03-06 11:22       ` Andi Shyti
2020-03-06 14:07         ` Tvrtko Ursulin
2020-03-19  3:55           ` Ch, Sai Gowtham
2020-03-19  7:06             ` Tvrtko Ursulin
2020-03-06 11:23 ` Andi Shyti

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=20200218121549.12917-1-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