[igt-dev] [RFC PATCH v8 4/5] lib: ioctl_wrappers: reach engines by index as well

Chris Wilson chris at chris-wilson.co.uk
Wed Feb 13 09:22:22 UTC 2019


Quoting Andi Shyti (2019-02-13 01:11:03)
> Hi Chris,
> 
> > > -bool gem_has_ring(int fd, unsigned ring)
> > > +bool gem_has_ring_by_idx(int fd, unsigned idx, unsigned rsvd1)
> > 
> > __gem_has_ring(int fd, uint32_t ctx, unsigned int ring)
> > 
> > #define gem_has_ring(fd, ring) __gem_has_ring(fd, 0, ring)
> > 
> > * mutters rsvd1!
> 
> Yes, that's quite a controversy: the concept of 'ring' is swapped
> depending on whether you call 'gem_has_ring' or
> 'gem_has_ring_by_idx' and I bet there is no naming choice that
> would please both callers. Unless I use neutral names, like 'a'
> and 'b', or 'x' and 'y'.
> 
> That's why originally I called it 'flags' and 'rsvd1' as they are
> called in the 'drm_i915_gem_execbuffer2' structure, in order to
> minimize confusion.

rsvd1 is the ctx id.

This should be gem_context_has_engine() and
#define gem_has_ring(fd, ring) gem_context_has_engine(fd, 0, ring)

The whole designed is that the flags/index should be transparent to the
caller, so _by_idx is anathema.
-Chris


More information about the igt-dev mailing list