public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Ramalingam C <ramalingam.c@intel.com>
To: igt-dev@lists.freedesktop.org
Subject: [igt-dev] [PATCH i-g-t v2 3/5] test/i915: gem_exec_capture: use the gem_engine_topology library
Date: Thu, 30 May 2019 21:12:20 +0530	[thread overview]
Message-ID: <20190530154222.16804-4-ramalingam.c@intel.com> (raw)
In-Reply-To: <20190530154222.16804-1-ramalingam.c@intel.com>

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

Signed-off-by: Ramalingam C <ramalingam.c@intel.com>
---
 tests/i915/gem_exec_capture.c | 24 ++++++++++--------------
 1 file changed, 10 insertions(+), 14 deletions(-)

diff --git a/tests/i915/gem_exec_capture.c b/tests/i915/gem_exec_capture.c
index 4457496d6d05..c0c3b88d5fa7 100644
--- a/tests/i915/gem_exec_capture.c
+++ b/tests/i915/gem_exec_capture.c
@@ -61,7 +61,8 @@ static void check_error_state(int dir, struct drm_i915_gem_exec_object2 *obj)
 	igt_assert(found);
 }
 
-static void __capture1(int fd, int dir, unsigned ring, uint32_t target)
+static void __capture1(int fd, int dir, const struct intel_execution_engine2 *e,
+		       uint32_t target)
 {
 	const int gen = intel_gen(intel_get_drm_devid(fd));
 	struct drm_i915_gem_exec_object2 obj[4];
@@ -145,7 +146,7 @@ static void __capture1(int fd, int dir, unsigned ring, uint32_t target)
 	memset(&execbuf, 0, sizeof(execbuf));
 	execbuf.buffers_ptr = (uintptr_t)obj;
 	execbuf.buffer_count = ARRAY_SIZE(obj);
-	execbuf.flags = ring;
+	execbuf.flags = e ? e->flags : 0;
 	if (gen > 3 && gen < 6)
 		execbuf.flags |= I915_EXEC_SECURE;
 
@@ -168,12 +169,12 @@ static void __capture1(int fd, int dir, unsigned ring, uint32_t target)
 	gem_close(fd, obj[SCRATCH].handle);
 }
 
-static void capture(int fd, int dir, unsigned ring)
+static void capture(int fd, int dir, const struct intel_execution_engine2 *e)
 {
 	uint32_t handle;
 
 	handle = gem_create(fd, 4096);
-	__capture1(fd, dir, ring, handle);
+	__capture1(fd, dir, e, handle);
 	gem_close(fd, handle);
 }
 
@@ -501,7 +502,7 @@ static void userptr(int fd, int dir)
 	igt_assert(posix_memalign(&ptr, 4096, 4096) == 0);
 	igt_require(__gem_userptr(fd, ptr, 4096, 0, 0, &handle) == 0);
 
-	__capture1(fd, dir, 0, handle);
+	__capture1(fd, dir, NULL, handle);
 
 	gem_close(fd, handle);
 	free(ptr);
@@ -526,7 +527,7 @@ static size_t safer_strlen(const char *s)
 
 igt_main
 {
-	const struct intel_execution_engine *e;
+	const struct intel_execution_engine2 *e;
 	igt_hang_t hang;
 	int fd = -1;
 	int dir = -1;
@@ -552,15 +553,10 @@ igt_main
 		igt_require(safer_strlen(igt_sysfs_get(dir, "error")) > 0);
 	}
 
-	for (e = intel_execution_engines; e->name; e++) {
-		/* default exec-id is purely symbolic */
-		if (e->exec_id == 0)
-			continue;
-
+	__for_each_physical_engine(fd, e) {
 		igt_subtest_f("capture-%s", e->name) {
-			igt_require(gem_ring_has_physical_engine(fd, e->exec_id | e->flags));
-			igt_require(gem_can_store_dword(fd, e->exec_id | e->flags));
-			capture(fd, dir, e->exec_id | e->flags);
+			igt_require(gem_class_can_store_dword(fd, e->class));
+			capture(fd, dir, e);
 		}
 	}
 
-- 
2.19.1

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

  parent reply	other threads:[~2019-05-30 15:39 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-30 15:42 [igt-dev] [PATCH i-g-t v2 0/5] Engine discovery for few more tests Ramalingam C
2019-05-30 15:42 ` [igt-dev] [PATCH i-g-t v2 1/5] test/i915: gem_bad_reloc: use the gem_engine_topology library Ramalingam C
2019-06-06 14:06   ` Andi Shyti
2019-05-30 15:42 ` [igt-dev] [PATCH i-g-t v2 2/5] test/i915: gem_exec_async: " Ramalingam C
2019-05-30 15:44   ` Chris Wilson
2019-05-30 16:14     ` Ramalingam C
2019-06-06 14:09   ` Andi Shyti
2019-05-30 15:42 ` Ramalingam C [this message]
2019-05-30 15:47   ` [igt-dev] [PATCH i-g-t v2 3/5] test/i915: gem_exec_capture: " Chris Wilson
2019-05-30 15:59     ` Ramalingam C
2019-06-06 14:10   ` Andi Shyti
2019-05-30 15:42 ` [igt-dev] [PATCH i-g-t v2 4/5] test/i915: gem_exec_params: " Ramalingam C
2019-05-30 15:49   ` Chris Wilson
2019-05-30 16:13     ` Ramalingam C
2019-06-06 14:12   ` Andi Shyti
2019-05-30 15:42 ` [igt-dev] [PATCH i-g-t v2 5/5] test/prime_vgem: " Ramalingam C
2019-05-30 15:50   ` Chris Wilson
2019-05-30 16:05     ` Ramalingam C
2019-06-06 14:17   ` Andi Shyti
2019-06-06 14:38     ` Tvrtko Ursulin
2019-06-06 15:31       ` Ramalingam C
2019-06-06 15:34         ` Tvrtko Ursulin
2019-06-06 15:48           ` Ramalingam C
2019-06-06 15:57             ` Tvrtko Ursulin
2019-06-07 10:38             ` Andi Shyti
2019-06-07 10:34       ` Andi Shyti
2019-05-31 11:11 ` [igt-dev] ✓ Fi.CI.BAT: success for Engine discovery for few more tests Patchwork
2019-06-01  2:54 ` [igt-dev] ✗ 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=20190530154222.16804-4-ramalingam.c@intel.com \
    --to=ramalingam.c@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