Re: [igt-dev] [PATCH i-g-t v2 5/5] test/prime_vgem: use the gem_engine_topology library

Ramalingam C
2019-05-30T16:02:19Z

On 2019-05-30 at 16:50:47 +0100, Chris Wilson wrote:
> Quoting Ramalingam C (2019-05-30 16:42:22)
> > Replace the legacy for_each_engine* defines with the ones
> > implemented in the gem_engine_topology library.
> >
> > Signed-off-by: Ramalingam C <ramalingam.c@intel.com>
> > ---
> > tests/prime_vgem.c | 70 +++++++++++++++++++++-------------------------
> > 1 file changed, 32 insertions(+), 38 deletions(-)
> >
> > diff --git a/tests/prime_vgem.c b/tests/prime_vgem.c
> > index 69ae8c9b0710..7689f6b3d6c8 100644
> > --- a/tests/prime_vgem.c
> > +++ b/tests/prime_vgem.c
> > @@ -325,7 +325,7 @@ static bool prime_busy(int fd, bool excl)
> > return poll(&pfd, 1, 0) == 0;
> > }
> >
> > -static void work(int i915, int dmabuf, unsigned ring, uint32_t flags)
> > +static void work(int i915, int dmabuf, const struct intel_execution_engine2 *e)
> > {
> > const int SCRATCH = 0;
> > const int BATCH = 1;
> > @@ -341,7 +341,7 @@ static void work(int i915, int dmabuf, unsigned ring, uint32_t flags)
> > memset(&execbuf, 0, sizeof(execbuf));
> > execbuf.buffers_ptr = (uintptr_t)obj;
> > execbuf.buffer_count = 2;
> > - execbuf.flags = ring | flags;
> > + execbuf.flags = e ? e->flags : I915_EXEC_DEFAULT;
>
> Again, this is random selection. I915_EXEC_DEFAULT is dangerous once a
> random engine map has been installed.
So should we use I915_EXEC_RENDER instead of I915_EXEC_DEFAULT?

-Ram.
> -Chris