diff options
author | Antonio Argenziano <antonio.argenziano@intel.com> | 2018-02-06 16:27:14 -0800 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2018-02-07 08:26:14 +0000 |
commit | 2baf7ece5b6d2faccedc56527ec91623f41a85e4 (patch) | |
tree | c2362e443cd7b61e51e6b92f939e16a107734be5 /benchmarks | |
parent | 3fd9b578b3138b04178b4ce8ee4a60e74a16ec91 (diff) |
lib: Move __gem_context_create to common ioctl wrapper library.
This patch adds a context creation ioctl wrapper that returns the error
for the caller to consume. Multiple tests that implemented this already,
have been changed to use the new library function.
v2:
- Add gem_require_contexts() to check for contexts support (Chris)
v3:
- Add gem_has_contexts to check for contexts support and change
gem_require_contexts to skip if contests support is not available.
(Chris)
v4:
- Cosmetic changes and use lib function in gem_ctx_create where
possible. (Michal)
v5:
- Use gem_contexts_require() in tests and fixtures. (Chris)
Signed-off-by: Antonio Argenziano <antonio.argenziano@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Michał Winiarski <michal.winiarski@intel.com>
Reviewed-by: Michał Winiarski <michal.winiarski@intel.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'benchmarks')
-rw-r--r-- | benchmarks/gem_exec_ctx.c | 6 | ||||
-rw-r--r-- | benchmarks/gem_exec_trace.c | 4 |
2 files changed, 5 insertions, 5 deletions
diff --git a/benchmarks/gem_exec_ctx.c b/benchmarks/gem_exec_ctx.c index 0eac04b03..a1c6e5d7f 100644 --- a/benchmarks/gem_exec_ctx.c +++ b/benchmarks/gem_exec_ctx.c @@ -64,7 +64,7 @@ static uint32_t batch(int fd) return handle; } -static uint32_t __gem_context_create(int fd) +static uint32_t __gem_context_create_local(int fd) { struct drm_i915_gem_context_create create; @@ -101,7 +101,7 @@ static int loop(unsigned ring, execbuf.flags |= LOCAL_I915_EXEC_HANDLE_LUT; execbuf.flags |= LOCAL_I915_EXEC_NO_RELOC; if (mode != DEFAULT) { - execbuf.rsvd1 = __gem_context_create(fd); + execbuf.rsvd1 = __gem_context_create_local(fd); if (execbuf.rsvd1 == 0) return 77; } @@ -125,7 +125,7 @@ static int loop(unsigned ring, uint32_t ctx = 0; if (mode != DEFAULT && mode != NOP) { - execbuf.rsvd1 = __gem_context_create(fd); + execbuf.rsvd1 = __gem_context_create_local(fd); ctx = gem_context_create(fd); } diff --git a/benchmarks/gem_exec_trace.c b/benchmarks/gem_exec_trace.c index 125776498..2724ee920 100644 --- a/benchmarks/gem_exec_trace.c +++ b/benchmarks/gem_exec_trace.c @@ -105,7 +105,7 @@ static double elapsed(const struct timespec *start, const struct timespec *end) return 1e3*(end->tv_sec - start->tv_sec) + 1e-6*(end->tv_nsec - start->tv_nsec); } -static uint32_t __gem_context_create(int fd) +static uint32_t __gem_context_create_local(int fd) { struct drm_i915_gem_context_create arg = {}; drmIoctl(fd, DRM_IOCTL_I915_GEM_CONTEXT_CREATE, &arg); @@ -216,7 +216,7 @@ static double replay(const char *filename, long nop, long range) num_ctx = new_ctx; } - ctx[t->handle] = __gem_context_create(fd); + ctx[t->handle] = __gem_context_create_local(fd); break; } case DEL_CTX: |