Re: [PATCH i-g-t] tests/gem_eio: Fix usage of gem_quiescent_gpu

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

 



Quoting Antonio Argenziano (2017-12-14 22:01:31)
> After change "lib: Ask the kernel to quiesce the GPU" was merged,
> gem_quiescent_gpu() would not submit noop batches to all engines
> therefore the test should submit the workload and use the library
> function to wait for the workload to complete.
> 
> Cc: Chris Wilson <chris@xxxxxxxxxxxxxxxxxx>
> Cc: Mika Kuoppala <mika.kuoppala@xxxxxxxxxxxxxxx>
> Cc: Joonas Lahtinen <joonas.lahtinen@xxxxxxxxxxxxxxx>
> Signed-off-by: Antonio Argenziano <antonio.argenziano@xxxxxxxxx>
> ---
>  tests/gem_eio.c | 30 +++++++++++++++++++++++++++++-
>  1 file changed, 29 insertions(+), 1 deletion(-)
> 
> diff --git a/tests/gem_eio.c b/tests/gem_eio.c
> index 2ac9f0a9..868f2236 100644
> --- a/tests/gem_eio.c
> +++ b/tests/gem_eio.c
> @@ -60,13 +60,41 @@ static bool i915_reset_control(bool enable)
>         return ret;
>  }
>  
> +static void noop(int fd, unsigned flags)
> +{
> +       const uint32_t bbe = MI_BATCH_BUFFER_END;
> +       struct drm_i915_gem_execbuffer2 eb;
> +       struct drm_i915_gem_exec_object2 exec;
> +
> +       memset(&exec, 0, sizeof(exec));
> +       exec.handle = gem_create(fd, 4096);
> +       igt_assert((int)exec.handle > 0);

gem_create() provides the checks.
exec.handle is u32, with 0 being the only special invalid value. It just
happens that in the linux implementation it is limited internally by the
idr (but that limit may well be removed). Other implementations may use
a psuedo-random handle generator.
-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