[Intel-gfx] [PATCH i-g-t] lib/dummyload: Cleanup access to spin obj array

Chris Wilson chris at chris-wilson.co.uk
Wed May 22 09:18:09 UTC 2019


Quoting Mika Kuoppala (2019-05-22 10:13:46)
> Instead of relying a static obj array inside igt_spin_t,
> access it with proper indexing.
> 
> Cc: Chris Wilson <chris at chris-wilson.co.uk>
> Signed-off-by: Mika Kuoppala <mika.kuoppala at linux.intel.com>
> ---
>  lib/igt_dummyload.c            | 32 +++++++++++++++-----------------
>  lib/igt_dummyload.h            |  1 +
>  tests/i915/gem_exec_schedule.c | 25 +++++++++++++++----------
>  tests/i915/gem_softpin.c       |  2 +-
>  tests/i915/gem_spin_batch.c    |  4 ++--
>  tests/i915/i915_hangman.c      |  2 +-
>  6 files changed, 35 insertions(+), 31 deletions(-)
> 
> diff --git a/lib/igt_dummyload.c b/lib/igt_dummyload.c
> index 15d64fad..b2da222e 100644
> --- a/lib/igt_dummyload.c
> +++ b/lib/igt_dummyload.c
> @@ -72,7 +72,6 @@ emit_recursive_batch(igt_spin_t *spin,
>                      int fd, const struct igt_spin_factory *opts)
>  {
>  #define SCRATCH 0
> -#define BATCH 1

#define BATCH IGT_SPIN_BATCH

> diff --git a/lib/igt_dummyload.h b/lib/igt_dummyload.h
> index 61a9f2fc..f7772b90 100644
> --- a/lib/igt_dummyload.h
> +++ b/lib/igt_dummyload.h
> @@ -42,6 +42,7 @@ typedef struct igt_spin {
>  
>         int out_fence;
>         struct drm_i915_gem_exec_object2 obj[2];
> +#define SPIN_OBJ_BATCH   1

Leading IGT_SPIN to match type.
IGT_SPIN_BATCH is unique enough for the moment.
-Chris


More information about the Intel-gfx mailing list