All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Wilson <chris@chris-wilson.co.uk>
To: Mika Kuoppala <mika.kuoppala@linux.intel.com>,
	intel-gfx@lists.freedesktop.org
Cc: igt-dev@lists.freedesktop.org
Subject: Re: [PATCH i-g-t] lib/dummyload: Cleanup access to spin obj array
Date: Wed, 22 May 2019 10:38:04 +0100	[thread overview]
Message-ID: <155851788398.23981.2076407745257565334@skylake-alporthouse-com> (raw)
In-Reply-To: <20190522093402.16899-1-mika.kuoppala@linux.intel.com>

Quoting Mika Kuoppala (2019-05-22 10:34:02)
> Instead of relying a static obj array inside igt_spin_t,
> access it with proper indexing.
> 
> v2: IGT_SPIN_BATCH
> 
> Cc: Chris Wilson <chris@chris-wilson.co.uk>
> Signed-off-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
> ---
>  lib/igt_dummyload.c            | 13 ++++++-------
>  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, 26 insertions(+), 21 deletions(-)
> 
> diff --git a/lib/igt_dummyload.c b/lib/igt_dummyload.c
> index 15d64fad..e6e366cb 100644
> --- a/lib/igt_dummyload.c
> +++ b/lib/igt_dummyload.c
> @@ -72,7 +72,7 @@ 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
>         const int gen = intel_gen(intel_get_drm_devid(fd));
>         struct drm_i915_gem_relocation_entry relocs[2], *r;
>         struct drm_i915_gem_execbuffer2 *execbuf;
> @@ -261,12 +261,11 @@ emit_recursive_batch(igt_spin_t *spin,
>         igt_assert_lt(cs - batch, BATCH_SIZE / sizeof(*cs));
>  
>         /* Make it easier for callers to resubmit. */
> -
> -       obj[BATCH].relocation_count = 0;
> -       obj[BATCH].relocs_ptr = 0;
> -
> -       obj[SCRATCH].flags = EXEC_OBJECT_PINNED;
> -       obj[BATCH].flags = EXEC_OBJECT_PINNED;
> +       for (i = 0; i < ARRAY_SIZE(spin->obj); i++) {
> +               spin->obj[i].relocation_count = 0;
> +               spin->obj[i].relocs_ptr = 0;
> +               spin->obj[i].flags = EXEC_OBJECT_PINNED;
> +       }
>  
>         spin->cmd_precondition = *spin->condition;
>  
> diff --git a/lib/igt_dummyload.h b/lib/igt_dummyload.h
> index 61a9f2fc..bb361842 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 IGT_SPIN_BATCH   1
>         struct drm_i915_gem_execbuffer2 execbuf;
>         uint32_t poll_handle;
>         uint32_t *poll;
> diff --git a/tests/i915/gem_exec_schedule.c b/tests/i915/gem_exec_schedule.c
> index c0438513..ed02d529 100644
> --- a/tests/i915/gem_exec_schedule.c
> +++ b/tests/i915/gem_exec_schedule.c
> @@ -234,7 +234,8 @@ static void independent(int fd, unsigned int engine)
>                 } else {
>                         struct drm_i915_gem_execbuffer2 eb = {
>                                 .buffer_count = 1,
> -                               .buffers_ptr = to_user_pointer(&spin->obj[1]),
> +                               .buffers_ptr =
> +                               to_user_pointer(&spin->obj[IGT_SPIN_BATCH]),

That should have an extra level of indent, at which point realise the
attempt to avoid the 80col is moot and just keep it on one long line.

Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

WARNING: multiple messages have this Message-ID (diff)
From: Chris Wilson <chris@chris-wilson.co.uk>
To: Mika Kuoppala <mika.kuoppala@linux.intel.com>,
	intel-gfx@lists.freedesktop.org
Cc: igt-dev@lists.freedesktop.org
Subject: Re: [igt-dev] [PATCH i-g-t] lib/dummyload: Cleanup access to spin obj array
Date: Wed, 22 May 2019 10:38:04 +0100	[thread overview]
Message-ID: <155851788398.23981.2076407745257565334@skylake-alporthouse-com> (raw)
In-Reply-To: <20190522093402.16899-1-mika.kuoppala@linux.intel.com>

Quoting Mika Kuoppala (2019-05-22 10:34:02)
> Instead of relying a static obj array inside igt_spin_t,
> access it with proper indexing.
> 
> v2: IGT_SPIN_BATCH
> 
> Cc: Chris Wilson <chris@chris-wilson.co.uk>
> Signed-off-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
> ---
>  lib/igt_dummyload.c            | 13 ++++++-------
>  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, 26 insertions(+), 21 deletions(-)
> 
> diff --git a/lib/igt_dummyload.c b/lib/igt_dummyload.c
> index 15d64fad..e6e366cb 100644
> --- a/lib/igt_dummyload.c
> +++ b/lib/igt_dummyload.c
> @@ -72,7 +72,7 @@ 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
>         const int gen = intel_gen(intel_get_drm_devid(fd));
>         struct drm_i915_gem_relocation_entry relocs[2], *r;
>         struct drm_i915_gem_execbuffer2 *execbuf;
> @@ -261,12 +261,11 @@ emit_recursive_batch(igt_spin_t *spin,
>         igt_assert_lt(cs - batch, BATCH_SIZE / sizeof(*cs));
>  
>         /* Make it easier for callers to resubmit. */
> -
> -       obj[BATCH].relocation_count = 0;
> -       obj[BATCH].relocs_ptr = 0;
> -
> -       obj[SCRATCH].flags = EXEC_OBJECT_PINNED;
> -       obj[BATCH].flags = EXEC_OBJECT_PINNED;
> +       for (i = 0; i < ARRAY_SIZE(spin->obj); i++) {
> +               spin->obj[i].relocation_count = 0;
> +               spin->obj[i].relocs_ptr = 0;
> +               spin->obj[i].flags = EXEC_OBJECT_PINNED;
> +       }
>  
>         spin->cmd_precondition = *spin->condition;
>  
> diff --git a/lib/igt_dummyload.h b/lib/igt_dummyload.h
> index 61a9f2fc..bb361842 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 IGT_SPIN_BATCH   1
>         struct drm_i915_gem_execbuffer2 execbuf;
>         uint32_t poll_handle;
>         uint32_t *poll;
> diff --git a/tests/i915/gem_exec_schedule.c b/tests/i915/gem_exec_schedule.c
> index c0438513..ed02d529 100644
> --- a/tests/i915/gem_exec_schedule.c
> +++ b/tests/i915/gem_exec_schedule.c
> @@ -234,7 +234,8 @@ static void independent(int fd, unsigned int engine)
>                 } else {
>                         struct drm_i915_gem_execbuffer2 eb = {
>                                 .buffer_count = 1,
> -                               .buffers_ptr = to_user_pointer(&spin->obj[1]),
> +                               .buffers_ptr =
> +                               to_user_pointer(&spin->obj[IGT_SPIN_BATCH]),

That should have an extra level of indent, at which point realise the
attempt to avoid the 80col is moot and just keep it on one long line.

Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
-Chris
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

  reply	other threads:[~2019-05-22  9:38 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-22  9:13 [PATCH i-g-t] lib/dummyload: Cleanup access to spin obj array Mika Kuoppala
2019-05-22  9:13 ` [igt-dev] " Mika Kuoppala
2019-05-22  9:18 ` Chris Wilson
2019-05-22  9:18   ` [igt-dev] " Chris Wilson
2019-05-22  9:34   ` Mika Kuoppala
2019-05-22  9:34     ` [igt-dev] " Mika Kuoppala
2019-05-22  9:38     ` Chris Wilson [this message]
2019-05-22  9:38       ` Chris Wilson
2019-05-22  9:46       ` Mika Kuoppala
2019-05-22  9:46         ` [igt-dev] " Mika Kuoppala
2019-05-23  8:59       ` Mika Kuoppala
2019-05-23  8:59         ` [igt-dev] " Mika Kuoppala
2019-05-22 10:52 ` [igt-dev] ✓ Fi.CI.BAT: success for lib/dummyload: Cleanup access to spin obj array (rev3) Patchwork
2019-05-23  2:01 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=155851788398.23981.2076407745257565334@skylake-alporthouse-com \
    --to=chris@chris-wilson.co.uk \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=mika.kuoppala@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.