[Intel-gfx] [PATCH i-g-t v3] lib: Move __gem_context_create to common ioctl wrapper library.

Chris Wilson chris at chris-wilson.co.uk
Thu Oct 26 10:12:13 UTC 2017


Quoting Michał Winiarski (2017-10-26 11:05:14)
> On Wed, Oct 25, 2017 at 05:28:39PM -0700, Antonio Argenziano wrote:
> > 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)
> > 
> > Signed-off-by: Antonio Argenziano <antonio.argenziano at intel.com>
> > 
> > Cc: Chris Wilson <chris at chris-wilson.co.uk>
> > Cc: Michał Winiarski <michal.winiarski at intel.com>
> > ---
> >  benchmarks/gem_exec_ctx.c   |  6 ++---
> >  benchmarks/gem_exec_trace.c |  4 +--
> >  lib/i915/gem_context.c      | 62 +++++++++++++++++++++++++++++++++++++--------
> >  lib/i915/gem_context.h      |  3 +++
> >  tests/gem_ctx_create.c      | 10 ++++----
> >  tests/gem_ctx_switch.c      | 13 ----------
> >  tests/gem_eio.c             | 13 +---------
> >  tests/gem_exec_await.c      | 14 ++--------
> >  tests/gem_exec_nop.c        | 13 ----------
> >  tests/gem_exec_parallel.c   | 15 +++--------
> >  tests/gem_exec_reuse.c      | 13 ----------
> >  tests/gem_exec_whisper.c    | 13 ----------
> >  12 files changed, 71 insertions(+), 108 deletions(-)
> > 
> > diff --git a/benchmarks/gem_exec_ctx.c b/benchmarks/gem_exec_ctx.c
> > index 0eac04b0..a1c6e5d7 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)
> 
> We only need this _local helper in negative parameters checks (in
> tests/gem_ctx_create - and perhaps we can open-code those two ioctl calls?).
> Both gem_exec_trace, gem_exec_ctx can use the helpers from lib.

This benchmarks/, where life is a little different as most igt macros
falter (as we aren't inside the test framework). It's a bit of a mess.
-Chris


More information about the Intel-gfx mailing list