diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2020-02-10 23:05:26 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2020-02-11 10:35:18 +0000 |
commit | 3ce739c6f1a81bda0a92c2d44972ef075487e8b1 (patch) | |
tree | 27e9bf3f78fe778c5bd49aeb8112dcc7ea267acb /tests/i915/gem_exec_nop.c | |
parent | 6a96c17f3a1b4e1f90b1a0b0ce42a7219875d1a4 (diff) |
i915/gem_exec_nop: Keep a copy of the names
The engine names are now stored inside the iterator and not as static
strings. If we wish to use them later, we need to make a copy.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Reviewed-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Diffstat (limited to 'tests/i915/gem_exec_nop.c')
-rw-r--r-- | tests/i915/gem_exec_nop.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/tests/i915/gem_exec_nop.c b/tests/i915/gem_exec_nop.c index ed9568e5..fc7f1182 100644 --- a/tests/i915/gem_exec_nop.c +++ b/tests/i915/gem_exec_nop.c @@ -436,7 +436,7 @@ static void parallel(int fd, uint32_t handle, int timeout) struct drm_i915_gem_execbuffer2 execbuf; struct drm_i915_gem_exec_object2 obj; unsigned engines[16]; - const char *names[16]; + char *names[16]; unsigned nengine; unsigned long count; double time, sum; @@ -445,7 +445,7 @@ static void parallel(int fd, uint32_t handle, int timeout) nengine = 0; __for_each_physical_engine(fd, e) { engines[nengine] = e->flags; - names[nengine++] = e->name; + names[nengine++] = strdup(e->name); time = nop_on_ring(fd, handle, e, 1, &count) / count; sum += time; @@ -485,10 +485,11 @@ static void parallel(int fd, uint32_t handle, int timeout) time = elapsed(&start, &now) / count; igt_info("%s: %ld cycles, %.3fus\n", names[child], count, 1e6*time); } + while (nengine--) + free(names[nengine]); igt_waitchildren(); igt_assert_eq(intel_detect_and_clear_missed_interrupts(fd), 0); - } static void series(int fd, uint32_t handle, int timeout) |