All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Wilson <chris@chris-wilson.co.uk>
To: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>,
	intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH] drm/i915/selftests: Check a few more fixed locations within the context image
Date: Mon, 28 Oct 2019 12:16:54 +0000	[thread overview]
Message-ID: <157226501399.32326.12505624004113950921@skylake-alporthouse-com> (raw)
In-Reply-To: <157226478507.8043.8486482740267218580@jlahtine-desk.ger.corp.intel.com>

Quoting Joonas Lahtinen (2019-10-28 12:13:05)
> Quoting Chris Wilson (2019-10-27 17:03:13)
> > As we use hard coded offsets for a few locations within the context
> > image, include those in the selftests to assert that they are valid.
> > 
> > Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> > Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
> 
> <SNIP>
> 
> > +++ b/drivers/gpu/drm/i915/gt/selftest_lrc.c
> > @@ -3194,6 +3194,26 @@ static int live_lrc_fixed(void *arg)
> >                         u32 offset;
> >                         const char *name;
> >                 } tbl[] = {
> > +                       {
> > +                               i915_mmio_reg_offset(RING_START(engine->mmio_base)),
> > +                               CTX_RING_BUFFER_START - 1,
> > +                               "RING_START"
> > +                       },
> > +                       {
> > +                               i915_mmio_reg_offset(RING_CTL(engine->mmio_base)),
> > +                               CTX_RING_BUFFER_CONTROL - 1,
> > +                               "RING_CTL"
> > +                       },
> > +                       {
> > +                               i915_mmio_reg_offset(RING_HEAD(engine->mmio_base)),
> > +                               CTX_RING_HEAD - 1,
> > +                               "RING_HEAD"
> > +                       },
> > +                       {
> > +                               i915_mmio_reg_offset(RING_TAIL(engine->mmio_base)),
> > +                               CTX_RING_TAIL - 1,
> > +                               "RING_TAIL"
> > +                       },
> 
> Quite repetitive. If you are not looking to add dissimilar patterns,
> could use a #define, but up to you.

The tables spares us even more repetition :)
I didn't look too hard at reducing the repetitiveness as I was expecting
a few more registers to break the mould. We shall see what the future
brings.

There's a few more registers we use hardcoded locations for, mostly in
perf. Hmm, I should probably make that a local test for selftest_perf.c
so that the logic and test are close together.
-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: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>,
	intel-gfx@lists.freedesktop.org
Subject: Re: [Intel-gfx] [PATCH] drm/i915/selftests: Check a few more fixed locations within the context image
Date: Mon, 28 Oct 2019 12:16:54 +0000	[thread overview]
Message-ID: <157226501399.32326.12505624004113950921@skylake-alporthouse-com> (raw)
Message-ID: <20191028121654.FM-BwNsfGM5AIJcHX-BzUdZ9TLHxiNH3xTClLHd6FUw@z> (raw)
In-Reply-To: <157226478507.8043.8486482740267218580@jlahtine-desk.ger.corp.intel.com>

Quoting Joonas Lahtinen (2019-10-28 12:13:05)
> Quoting Chris Wilson (2019-10-27 17:03:13)
> > As we use hard coded offsets for a few locations within the context
> > image, include those in the selftests to assert that they are valid.
> > 
> > Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> > Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
> 
> <SNIP>
> 
> > +++ b/drivers/gpu/drm/i915/gt/selftest_lrc.c
> > @@ -3194,6 +3194,26 @@ static int live_lrc_fixed(void *arg)
> >                         u32 offset;
> >                         const char *name;
> >                 } tbl[] = {
> > +                       {
> > +                               i915_mmio_reg_offset(RING_START(engine->mmio_base)),
> > +                               CTX_RING_BUFFER_START - 1,
> > +                               "RING_START"
> > +                       },
> > +                       {
> > +                               i915_mmio_reg_offset(RING_CTL(engine->mmio_base)),
> > +                               CTX_RING_BUFFER_CONTROL - 1,
> > +                               "RING_CTL"
> > +                       },
> > +                       {
> > +                               i915_mmio_reg_offset(RING_HEAD(engine->mmio_base)),
> > +                               CTX_RING_HEAD - 1,
> > +                               "RING_HEAD"
> > +                       },
> > +                       {
> > +                               i915_mmio_reg_offset(RING_TAIL(engine->mmio_base)),
> > +                               CTX_RING_TAIL - 1,
> > +                               "RING_TAIL"
> > +                       },
> 
> Quite repetitive. If you are not looking to add dissimilar patterns,
> could use a #define, but up to you.

The tables spares us even more repetition :)
I didn't look too hard at reducing the repetitiveness as I was expecting
a few more registers to break the mould. We shall see what the future
brings.

There's a few more registers we use hardcoded locations for, mostly in
perf. Hmm, I should probably make that a local test for selftest_perf.c
so that the logic and test are close together.
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2019-10-28 12:16 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-27 15:03 [PATCH] drm/i915/selftests: Check a few more fixed locations within the context image Chris Wilson
2019-10-27 15:03 ` [Intel-gfx] " Chris Wilson
2019-10-27 16:07 ` ✓ Fi.CI.BAT: success for " Patchwork
2019-10-27 16:07   ` [Intel-gfx] " Patchwork
2019-10-28 12:13 ` [PATCH] " Joonas Lahtinen
2019-10-28 12:13   ` [Intel-gfx] " Joonas Lahtinen
2019-10-28 12:16   ` Chris Wilson [this message]
2019-10-28 12:16     ` Chris Wilson
2019-10-28 16:15 ` ✓ Fi.CI.IGT: success for " Patchwork
2019-10-28 16:15   ` [Intel-gfx] " 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=157226501399.32326.12505624004113950921@skylake-alporthouse-com \
    --to=chris@chris-wilson.co.uk \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=joonas.lahtinen@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.