From: Arjun Melkaveri <arjun.melkaveri@intel.com>
To: arjun.melkaveri@intel.com, igt-dev@lists.freedesktop.org
Subject: [igt-dev] [PATCH] [PATCH i-g-t]tests/i915/gem_ctx_create: Reverted device reopen logic
Date: Mon, 23 Mar 2020 12:16:07 +0530 [thread overview]
Message-ID: <20200323064607.7041-1-arjun.melkaveri@intel.com> (raw)
Removed gem_reopen_driver and gem_context_copy_engines
logic from code as it is not recommended.
No reopen after fork is needed .
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Ursulin Tvrtko <tvrtko.ursulin@intel.com>
Signed-off-by: Arjun Melkaveri <arjun.melkaveri@intel.com>
---
tests/i915/gem_ctx_create.c | 45 +++++--------------------------------
1 file changed, 6 insertions(+), 39 deletions(-)
diff --git a/tests/i915/gem_ctx_create.c b/tests/i915/gem_ctx_create.c
index 2d477226..4f160ea9 100644
--- a/tests/i915/gem_ctx_create.c
+++ b/tests/i915/gem_ctx_create.c
@@ -100,12 +100,10 @@ static void files(int core, int timeout, const int ncpus)
igt_fork(child, ncpus) {
struct timespec start, end;
unsigned count = 0;
- int fd;
clock_gettime(CLOCK_MONOTONIC, &start);
do {
- fd = gem_reopen_driver(core);
- gem_context_copy_engines(core, 0, fd, 0);
+ int fd = drm_open_driver(DRIVER_INTEL);
obj.handle = gem_open(fd, name);
execbuf.flags &= ~ENGINE_FLAGS;
@@ -160,15 +158,6 @@ static void active(int fd, const struct intel_execution_engine2 *e,
if (ncpus < 0) {
igt_fork(child, ppgtt_nengine) {
unsigned long count = 0;
- int i915;
-
- i915 = gem_reopen_driver(fd);
- /*
- * Ensure the gpu is idle by launching
- * a nop execbuf and stalling for it
- */
- gem_quiescent_gpu(i915);
- gem_context_copy_engines(fd, 0, i915, 0);
if (ppgtt_engines[child] == e->flags)
continue;
@@ -192,21 +181,10 @@ static void active(int fd, const struct intel_execution_engine2 *e,
igt_fork(child, ncpus) {
struct timespec start, end;
unsigned count = 0;
- int i915;
- uint32_t ctx;
-
- i915 = gem_reopen_driver(fd);
- /*
- * Ensure the gpu is idle by launching
- * a nop execbuf and stalling for it.
- */
- gem_quiescent_gpu(i915);
- ctx = gem_context_create(i915);
- gem_context_copy_engines(fd, 0, i915, ctx);
clock_gettime(CLOCK_MONOTONIC, &start);
do {
- execbuf.rsvd1 = gem_context_clone_with_engines(fd, ctx);
+ execbuf.rsvd1 = gem_context_clone_with_engines(fd, 0);
for (unsigned n = 0; n < nengine; n++) {
execbuf.flags = engines[n];
gem_execbuf(fd, &execbuf);
@@ -217,8 +195,6 @@ static void active(int fd, const struct intel_execution_engine2 *e,
clock_gettime(CLOCK_MONOTONIC, &end);
} while (elapsed(&start, &end) < timeout);
- gem_context_destroy(fd, ctx);
-
gem_sync(fd, obj.handle);
clock_gettime(CLOCK_MONOTONIC, &end);
igt_info("[%d] Context creation + execution: %.3f us\n",
@@ -325,18 +301,9 @@ static void maximum(int fd, int ncpus, unsigned mode)
igt_fork(child, ncpus) {
struct timespec start, end;
- int i915;
-
- i915 = gem_reopen_driver(fd);
- /*
- * Ensure the gpu is idle by launching
- * a nop execbuf and stalling for it.
- */
- gem_quiescent_gpu(i915);
- gem_context_copy_engines(fd, 0, i915, 0);
hars_petruska_f54_1_random_perturb(child);
- obj[0].handle = gem_create(i915, 4096);
+ obj[0].handle = gem_create(fd, 4096);
clock_gettime(CLOCK_MONOTONIC, &start);
for (int repeat = 0; repeat < 3; repeat++) {
@@ -347,13 +314,13 @@ static void maximum(int fd, int ncpus, unsigned mode)
execbuf.rsvd1 = contexts[i];
for (unsigned long j = 0; j < all_nengine; j++) {
execbuf.flags = all_engines[j];
- gem_execbuf(i915, &execbuf);
+ gem_execbuf(fd, &execbuf);
}
}
}
- gem_sync(i915, obj[0].handle);
+ gem_sync(fd, obj[0].handle);
clock_gettime(CLOCK_MONOTONIC, &end);
- gem_close(i915, obj[0].handle);
+ gem_close(fd, obj[0].handle);
igt_info("[%d] Context execution: %.3f us\n", child,
elapsed(&start, &end) / (3 * count * all_nengine) * 1e6);
--
2.25.1
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
next reply other threads:[~2020-03-23 6:47 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-23 6:46 Arjun Melkaveri [this message]
2020-03-23 7:49 ` [igt-dev] ✓ Fi.CI.BAT: success for tests/i915/gem_ctx_create: Reverted device reopen logic Patchwork
2020-03-23 8:19 ` [igt-dev] [PATCH] [PATCH i-g-t]tests/i915/gem_ctx_create: " Tvrtko Ursulin
2020-03-23 8:33 ` Melkaveri, Arjun
2020-03-23 8:49 ` [igt-dev] ✗ Fi.CI.IGT: failure for tests/i915/gem_ctx_create: " 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=20200323064607.7041-1-arjun.melkaveri@intel.com \
--to=arjun.melkaveri@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