From: Ramalingam C <ramalingam.c@intel.com>
To: igt-dev@lists.freedesktop.org, tvrtko.ursulin@linux.intel.com,
andi@etezian.org
Subject: [igt-dev] [RFC v2 42/43] lib: replace the legacy funcs with gem_engine_topology libraries
Date: Fri, 21 Jun 2019 15:33:44 +0530 [thread overview]
Message-ID: <20190621100345.20019-43-ramalingam.c@intel.com> (raw)
In-Reply-To: <20190621100345.20019-1-ramalingam.c@intel.com>
All legacy functions are replaced with the functions from the
gem_engine_topology library.
Signed-off-by: Ramalingam C <ramalingam.c@intel.com>
---
benchmarks/gem_syslatency.c | 7 ++++---
lib/i915/gem_ring.c | 7 +++++--
lib/i915/gem_submission.c | 6 ++++--
lib/igt_gt.c | 11 -----------
lib/igt_gt.h | 21 ---------------------
5 files changed, 13 insertions(+), 39 deletions(-)
diff --git a/benchmarks/gem_syslatency.c b/benchmarks/gem_syslatency.c
index 7671dc43efe9..01ddbf67ea3f 100644
--- a/benchmarks/gem_syslatency.c
+++ b/benchmarks/gem_syslatency.c
@@ -100,14 +100,15 @@ static void *gem_busyspin(void *arg)
bs->sz ? bs->sz + sizeof(bbe) : bs->leak ? 16 << 20 : 4 << 10;
unsigned engines[16];
unsigned nengine;
- unsigned engine;
+ const struct intel_execution_engine2 *engine;
int fd;
fd = drm_open_driver(DRIVER_INTEL);
nengine = 0;
- for_each_engine(fd, engine)
- if (!ignore_engine(fd, engine)) engines[nengine++] = engine;
+ for_each_context_engine(fd, 0, engine)
+ if (!ignore_engine(fd, engine->flags))
+ engines[nengine++] = engine->flags;
memset(obj, 0, sizeof(obj));
obj[0].handle = gem_create(fd, 4096);
diff --git a/lib/i915/gem_ring.c b/lib/i915/gem_ring.c
index fdb9fc1b13fe..e050e4c90844 100644
--- a/lib/i915/gem_ring.c
+++ b/lib/i915/gem_ring.c
@@ -33,6 +33,8 @@
#include "igt_dummyload.h"
#include "igt_gt.h"
+#include <i915/gem_engine_topology.h>
+
static int __execbuf(int fd, struct drm_i915_gem_execbuffer2 *execbuf)
{
int err;
@@ -141,9 +143,10 @@ gem_measure_ring_inflight(int fd, unsigned int engine, enum measure_ring_flags f
{
if (engine == ALL_ENGINES) {
unsigned int global_min = ~0u;
+ const struct intel_execution_engine2 *e;
- for_each_physical_engine(fd, engine) {
- unsigned int engine_min = __gem_measure_ring_inflight(fd, engine, flags);
+ for_each_context_engine(fd, 0, e) {
+ unsigned int engine_min = __gem_measure_ring_inflight(fd, e->flags, flags);
if (engine_min < global_min)
global_min = engine_min;
diff --git a/lib/i915/gem_submission.c b/lib/i915/gem_submission.c
index 2fd460d5ed2b..9bfb91b89f80 100644
--- a/lib/i915/gem_submission.c
+++ b/lib/i915/gem_submission.c
@@ -36,6 +36,7 @@
#include "ioctl_wrappers.h"
#include "i915/gem_submission.h"
+#include "i915/gem_engine_topology.h"
/**
* SECTION:gem_submission
@@ -207,6 +208,7 @@ void gem_test_engine(int i915, unsigned int engine)
.buffers_ptr = to_user_pointer(&obj),
.buffer_count = 1,
};
+ const struct intel_execution_engine2 *e;
i915 = gem_reopen_driver(i915);
igt_assert(!is_wedged(i915));
@@ -215,8 +217,8 @@ void gem_test_engine(int i915, unsigned int engine)
gem_write(i915, obj.handle, 0, &bbe, sizeof(bbe));
if (engine == ALL_ENGINES) {
- for_each_physical_engine(i915, engine) {
- execbuf.flags = engine;
+ __for_each_physical_engine(i915, e) {
+ execbuf.flags = e->flags;
gem_execbuf(i915, &execbuf);
}
} else {
diff --git a/lib/igt_gt.c b/lib/igt_gt.c
index 78e3cd08925b..e89058a93f9c 100644
--- a/lib/igt_gt.c
+++ b/lib/igt_gt.c
@@ -546,17 +546,6 @@ unsigned intel_detect_and_clear_missed_interrupts(int fd)
return missed;
}
-const struct intel_execution_engine intel_execution_engines[] = {
- { "default", NULL, 0, 0 },
- { "render", "rcs0", I915_EXEC_RENDER, 0 },
- { "bsd", "vcs0", I915_EXEC_BSD, 0 },
- { "bsd1", "vcs0", I915_EXEC_BSD, 1<<13 /*I915_EXEC_BSD_RING1*/ },
- { "bsd2", "vcs1", I915_EXEC_BSD, 2<<13 /*I915_EXEC_BSD_RING2*/ },
- { "blt", "bcs0", I915_EXEC_BLT, 0 },
- { "vebox", "vecs0", I915_EXEC_VEBOX, 0 },
- { NULL, 0, 0 }
-};
-
bool gem_class_can_store_dword(int fd, int class)
{
uint16_t devid = intel_get_drm_devid(fd);
diff --git a/lib/igt_gt.h b/lib/igt_gt.h
index 73b5002a04bd..4ad5d892579a 100644
--- a/lib/igt_gt.h
+++ b/lib/igt_gt.h
@@ -65,27 +65,6 @@ unsigned intel_detect_and_clear_missed_interrupts(int fd);
#define ALL_ENGINES ~0u /* Use in interfaces to iterate all engines */
-extern const struct intel_execution_engine {
- const char *name;
- const char *full_name;
- unsigned exec_id;
- unsigned flags;
-} intel_execution_engines[];
-
-#define for_if(expr__) if (!(expr__)) {} else
-
-#define for_each_engine(fd__, flags__) \
- for (const struct intel_execution_engine *e__ = intel_execution_engines;\
- e__->name; \
- e__++) \
- for_if (gem_has_ring(fd__, flags__ = e__->exec_id | e__->flags))
-
-#define for_each_physical_engine(fd__, flags__) \
- for (const struct intel_execution_engine *e__ = intel_execution_engines;\
- e__->name; \
- e__++) \
- for_if (gem_ring_has_physical_engine(fd__, flags__ = e__->exec_id | e__->flags))
-
bool gem_ring_is_physical_engine(int fd, unsigned int ring);
bool gem_ring_has_physical_engine(int fd, unsigned int ring);
--
2.19.1
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
next prev parent reply other threads:[~2019-06-21 10:02 UTC|newest]
Thread overview: 72+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-21 10:03 [igt-dev] [RFC v2 00/43] Upgrading the Engine discovery Ramalingam C
2019-06-21 10:03 ` [igt-dev] [RFC v2 01/43] test/i915: gem_bad_reloc: use the gem_engine_topology library Ramalingam C
2019-06-21 10:02 ` Chris Wilson
2019-06-21 10:05 ` Tvrtko Ursulin
2019-06-21 10:51 ` Chris Wilson
2019-06-21 10:03 ` [igt-dev] [RFC v2 02/43] test/i915: gem_exec_async: " Ramalingam C
2019-06-21 10:03 ` [igt-dev] [RFC v2 03/43] test/i915: gem_exec_capture: " Ramalingam C
2019-06-21 10:03 ` [igt-dev] [RFC v2 04/43] test/i915: gem_exec_params: " Ramalingam C
2019-06-21 10:03 ` [igt-dev] [RFC v2 05/43] lib/i915: Helper func for engine class to exec_flag Ramalingam C
2019-06-21 10:49 ` Tvrtko Ursulin
2019-06-21 12:52 ` Ramalingam C
2019-06-25 11:43 ` Andi Shyti
2019-06-21 10:03 ` [igt-dev] [RFC v2 06/43] test/prime_vgem: use the gem_engine_topology library Ramalingam C
2019-06-21 10:08 ` Chris Wilson
2019-06-21 10:03 ` [igt-dev] [RFC v2 07/43] tests/i915/gem_exec_reuse: " Ramalingam C
2019-06-21 10:03 ` [igt-dev] [RFC v2 08/43] tests/i915/gem_sync: " Ramalingam C
2019-06-21 10:03 ` [igt-dev] [RFC v2 09/43] tests/i915/gem_busy: " Ramalingam C
2019-06-21 10:03 ` [igt-dev] [RFC v2 10/43] tests/i915/gem_concurrent_all: " Ramalingam C
2019-06-21 10:03 ` [igt-dev] [RFC v2 11/43] tests/i915/gem_cs_prefetch: " Ramalingam C
2019-06-21 10:11 ` Chris Wilson
2019-06-21 10:03 ` [igt-dev] [RFC v2 12/43] tests/i915/gem_ctx_create: " Ramalingam C
2019-06-21 10:03 ` [igt-dev] [RFC v2 13/43] tests/i915/gem_ctx_isolation: " Ramalingam C
2019-06-28 22:12 ` Stimson, Dale B
2019-06-21 10:03 ` [igt-dev] [RFC v2 14/43] tests/i915/gem_ctx_switch: " Ramalingam C
2019-06-21 10:14 ` Chris Wilson
2019-06-21 10:03 ` [igt-dev] [RFC v2 15/43] tests/i915/gem_ctx_thrash: " Ramalingam C
2019-06-21 10:03 ` [igt-dev] [RFC v2 16/43] tests/i915/gem_eio: " Ramalingam C
2019-06-21 10:20 ` Chris Wilson
2019-06-21 10:03 ` [igt-dev] [RFC v2 17/43] tests/i915/gem_exec_await: " Ramalingam C
2019-06-21 10:03 ` [igt-dev] [RFC v2 18/43] tests/i915/gem_exec_create: " Ramalingam C
2019-06-21 10:21 ` Chris Wilson
2019-06-25 12:17 ` Andi Shyti
2019-06-21 10:03 ` [igt-dev] [RFC v2 19/43] tests/i915/gem_exec_fence: " Ramalingam C
2019-06-21 10:22 ` Chris Wilson
2019-06-21 10:03 ` [igt-dev] [RFC v2 20/43] tests/i915/gem_exec_flush: " Ramalingam C
2019-06-21 10:03 ` [igt-dev] [RFC v2 21/43] tests/i915/gem_exec_gttfill: " Ramalingam C
2019-06-21 10:03 ` [igt-dev] [RFC v2 22/43] tests/i915/gem_exec_latency: " Ramalingam C
2019-06-21 10:03 ` [igt-dev] [RFC v2 23/43] tests/i915/gem_exec_nop: " Ramalingam C
2019-06-21 10:23 ` Chris Wilson
2019-06-21 10:03 ` [igt-dev] [RFC v2 24/43] tests/i915/gem_exec_reloc: " Ramalingam C
2019-06-21 10:24 ` Chris Wilson
2019-06-21 10:03 ` [igt-dev] [RFC v2 25/43] tests/i915/gem_exec_schedule: " Ramalingam C
2019-06-21 10:25 ` Chris Wilson
2019-06-21 10:03 ` [igt-dev] [RFC v2 26/43] tests/i915/gem_exec_suspend: " Ramalingam C
2019-06-21 10:03 ` [igt-dev] [RFC v2 27/43] tests/i915/gem_exec_whisper: " Ramalingam C
2019-06-21 10:26 ` Chris Wilson
2019-06-21 10:03 ` [igt-dev] [RFC v2 28/43] tests/i915/gem_mocs_settings: " Ramalingam C
2019-06-21 10:03 ` [igt-dev] [RFC v2 29/43] tests/i915/gem_reset_stats: " Ramalingam C
2019-06-21 10:29 ` Chris Wilson
2019-06-21 10:03 ` [igt-dev] [RFC v2 30/43] tests/i915/gem_ring_sync_loop: " Ramalingam C
2019-06-21 10:03 ` [igt-dev] [RFC v2 31/43] tests/i915/gem_ringfill: " Ramalingam C
2019-06-21 10:29 ` Chris Wilson
2019-06-21 10:03 ` [igt-dev] [RFC v2 32/43] tests/i915/gem_shrink: " Ramalingam C
2019-06-21 10:30 ` Chris Wilson
2019-06-21 10:03 ` [igt-dev] [RFC v2 33/43] tests/i915/gem_spin_batch: " Ramalingam C
2019-06-21 10:03 ` [igt-dev] [RFC v2 34/43] tests/i915/gem_storedw_loop: " Ramalingam C
2019-06-21 10:03 ` [igt-dev] [RFC v2 35/43] tests/i915/gem_userptr_blits: " Ramalingam C
2019-06-21 10:32 ` Chris Wilson
2019-06-21 10:03 ` [igt-dev] [RFC v2 36/43] tests/i915/i915_hangman: " Ramalingam C
2019-06-21 10:03 ` [igt-dev] [RFC v2 37/43] tests/i915/i915_module_load: " Ramalingam C
2019-06-21 10:03 ` [igt-dev] [RFC v2 38/43] tests/kms_busy: " Ramalingam C
2019-06-21 10:35 ` Chris Wilson
2019-06-21 10:03 ` [igt-dev] [RFC v2 39/43] tests/prime_busy: " Ramalingam C
2019-06-21 10:36 ` Chris Wilson
2019-06-21 10:03 ` [igt-dev] [RFC v2 40/43] tests/amdgpu/amd_prime: " Ramalingam C
2019-06-21 10:03 ` [igt-dev] [RFC v2 41/43] tests/i915/gem_ctx_shared: " Ramalingam C
2019-06-21 10:37 ` Chris Wilson
2019-06-21 10:03 ` Ramalingam C [this message]
2019-06-21 10:03 ` [igt-dev] [RFC v2 43/43] lib/gem_engine_topology: rename the macros Ramalingam C
2019-06-21 10:42 ` [igt-dev] ✓ Fi.CI.BAT: success for Upgrading the Engine discovery Patchwork
2019-06-21 16:12 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
2019-06-28 22:25 ` [igt-dev] ✗ Fi.CI.BAT: failure for Upgrading the Engine discovery (rev2) 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=20190621100345.20019-43-ramalingam.c@intel.com \
--to=ramalingam.c@intel.com \
--cc=andi@etezian.org \
--cc=igt-dev@lists.freedesktop.org \
--cc=tvrtko.ursulin@linux.intel.com \
/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