Re: [PATCH igt] lib: Run gem_test_engine() in an isolated context

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Quoting Tvrtko Ursulin (2018-03-22 15:48:50)
> 
> On 22/03/2018 14:12, Chris Wilson wrote:
> > Ignore the shennigans of the test surrounding the library call to
> > gem_test_engine() and focus on answering the query of whether the engine
> > exists and is operational.
> > 
> > Signed-off-by: Chris Wilson <chris@xxxxxxxxxxxxxxxxxx>
> > Cc: Tvrtko Ursulin <tvrtko.ursulin@xxxxxxxxx>
> > ---
> >   lib/i915/gem_submission.c | 23 +++++++++++++++++++----
> >   1 file changed, 19 insertions(+), 4 deletions(-)
> > 
> > diff --git a/lib/i915/gem_submission.c b/lib/i915/gem_submission.c
> > index c5e96969..062b8b93 100644
> > --- a/lib/i915/gem_submission.c
> > +++ b/lib/i915/gem_submission.c
> > @@ -22,6 +22,7 @@
> >    */
> >   
> >   #include <errno.h>
> > +#include <fcntl.h>
> >   #include <stdbool.h>
> >   #include <sys/ioctl.h>
> >   
> > @@ -164,6 +165,17 @@ bool gem_has_guc_submission(int fd)
> >       return gem_submission_method(fd) & GEM_SUBMISSION_GUC;
> >   }
> >   
> > +static int reopen_driver(int fd)
> > +{
> > +     char path[256];
> > +
> > +     snprintf(path, sizeof(path), "/proc/self/fd/%d", fd);
> > +     fd = open(path, O_RDWR);
> > +     igt_assert_lte(0, fd);
> 
> We have igt_assert_fd if you want it.

Done. Pushed this nice bit of rug sweeping.
Nothing to see here, please move along...
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux