summaryrefslogtreecommitdiff
path: root/tests/gem_exec_await.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2018-02-21 14:13:16 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2018-02-23 16:42:36 +0000
commit305ebcedc36e98f3118ac27a5bbde0ce7cd71a74 (patch)
tree3e392be546ac6e667b13ad6b494d724ab4822707 /tests/gem_exec_await.c
parentf9b6fd624be9692e9a892c0976fa72cedefc9fed (diff)
Iterate over physical engines
We current have a single for_each_engine() iterator which we use to generate both a set of uABI engines and a set of physical engines. Determining what uABI ring-id corresponds to an actual HW engine is tricky, so pull that out to a library function and introduce for_each_physical_engine() for cases where we want to issue requests once on each HW ring (avoiding aliasing issues). v2: Remember can_store_dword for gem_sync v3: Find more open-coded for_each_physical Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Diffstat (limited to 'tests/gem_exec_await.c')
-rw-r--r--tests/gem_exec_await.c17
1 files changed, 1 insertions, 16 deletions
diff --git a/tests/gem_exec_await.c b/tests/gem_exec_await.c
index 1c1640de..2ff180b0 100644
--- a/tests/gem_exec_await.c
+++ b/tests/gem_exec_await.c
@@ -45,17 +45,6 @@ static double elapsed(const struct timespec *start, const struct timespec *end)
(end->tv_nsec - start->tv_nsec)*1e-9);
}
-static bool ignore_engine(int fd, unsigned engine)
-{
- if (engine == 0)
- return true;
-
- if (gem_has_bsd2(fd) && engine == I915_EXEC_BSD)
- return true;
-
- return false;
-}
-
static void xchg_obj(void *array, unsigned i, unsigned j)
{
struct drm_i915_gem_exec_object2 *obj = array;
@@ -90,12 +79,8 @@ static void wide(int fd, int ring_size, int timeout, unsigned int flags)
double time;
nengine = 0;
- for_each_engine(fd, engine) {
- if (ignore_engine(fd, engine))
- continue;
-
+ for_each_physical_engine(fd, engine)
engines[nengine++] = engine;
- }
igt_require(nengine);
exec = calloc(nengine, sizeof(*exec));