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
Subject: Re: [PATCH 1/2] drm/i915/selftests: Verify the LRC register layout between init and HW
Date: Tue, 24 Sep 2019 12:00:55 +0100	[thread overview]
Message-ID: <156932285589.3684.14832880682799375166@skylake-alporthouse-com> (raw)
In-Reply-To: <87mueuyoy5.fsf@gaia.fi.intel.com>

Quoting Mika Kuoppala (2019-09-24 11:21:38)
> Chris Wilson <chris@chris-wilson.co.uk> writes:
> > +static u32 *set_offsets(u32 *regs,
> > +                     const u8 *data,
> > +                     const struct intel_engine_cs *engine)
> > +#define NOP(x) (BIT(7) | (x))
> > +#define LRI(count, flags) ((flags) << 6 | (count))
> > +#define POSTED BIT(0)
> > +#define REG(x) (((x) >> 2) | BUILD_BUG_ON_ZERO(x >= 0x200))
> > +#define REG16(x) \
> > +     (((x) >> 9) | BIT(7) | BUILD_BUG_ON_ZERO(x >= 0x10000)), \
> > +     (((x) >> 2) & 0x7f)
> 
> I am still not sure if the actual saving are worth the complexity.
> 
> > +#define END() 0
> > +{
> > +     const u32 base = engine->mmio_base;
> > +
> > +     while (*data) {
> > +             u8 count, flags;
> > +
> > +             if (*data & BIT(7)) { /* skip */
> > +                     regs += *data++ & ~BIT(7);
> > +                     continue;
> > +             }
> > +
> > +             count = *data & 0x3f;
> > +             flags = *data >> 6;
> > +             data++;
> > +
> > +             *regs = MI_LOAD_REGISTER_IMM(count);
> > +             if (flags & POSTED)
> > +                     *regs |= MI_LRI_FORCE_POSTED;
> > +             if (INTEL_GEN(engine->i915) >= 11)
> > +                     *regs |= MI_LRI_CS_MMIO;
> > +             regs++;
> > +
> > +             GEM_BUG_ON(!count);
> > +             do {
> > +                     u32 offset = 0;
> > +                     u8 v;
> > +
> > +                     do {
> > +                             v = *data++;
> > +                             offset <<= 7;
> > +                             offset |= v & ~BIT(7);
> > +                     } while (v & BIT(7));
> 
> ...but perhaps this amount of extra can be tolerated.
> 
> Did you check how this would play out with just REG being wide enough?

Function                                     old     new   delta
gen9_xcs_offsets                             122     145     +23
gen12_xcs_offsets                            136     157     +21
gen11_rcs_offsets                             44      60     +16
gen8_rcs_offsets                              41      55     +14
gen12_rcs_offsets                             47      60     +13
gen8_xcs_offsets                              40      51     +11
set_offsets.isra                             215     179     -36
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  parent reply	other threads:[~2019-09-24 11:01 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-23 23:02 [PATCH 1/2] drm/i915/selftests: Verify the LRC register layout between init and HW Chris Wilson
2019-09-23 23:02 ` [PATCH 2/2] drm/i915/tgl: Swap engines for rps (gpu reclocking) Chris Wilson
2019-09-24  7:09   ` [PATCH] drm/i915/tgl: Swap engines for no rc6/rps (gpu powersave and reclocking) Chris Wilson
2019-09-23 23:08 ` ✗ Fi.CI.CHECKPATCH: warning for series starting with [1/2] drm/i915/selftests: Verify the LRC register layout between init and HW Patchwork
2019-09-23 23:31 ` ✓ Fi.CI.BAT: success " Patchwork
2019-09-24  7:17 ` ✗ Fi.CI.CHECKPATCH: warning for series starting with [1/2] drm/i915/selftests: Verify the LRC register layout between init and HW (rev2) Patchwork
2019-09-24  7:43 ` ✓ Fi.CI.BAT: success " Patchwork
2019-09-24  7:59   ` Chris Wilson
2019-09-24 10:21 ` [PATCH 1/2] drm/i915/selftests: Verify the LRC register layout between init and HW Mika Kuoppala
2019-09-24 10:43   ` Chris Wilson
2019-09-24 15:07     ` Mika Kuoppala
2019-09-24 11:00   ` Chris Wilson [this message]
2019-09-24 11:58     ` Mika Kuoppala
2019-09-24 13:23 ` ✗ Fi.CI.CHECKPATCH: warning for series starting with [1/2] drm/i915/selftests: Verify the LRC register layout between init and HW (rev3) Patchwork
2019-09-24 13:48 ` ✓ Fi.CI.BAT: success " Patchwork
2019-09-24 13:58   ` Chris Wilson
2019-09-24 14:59 ` [PATCH v2] drm/i915/selftests: Verify the LRC register layout between init and HW Chris Wilson
2019-09-24 15:04   ` Chris Wilson
2019-09-24 15:57 ` ✗ Fi.CI.CHECKPATCH: warning for series starting with [v2] drm/i915/selftests: Verify the LRC register layout between init and HW (rev5) Patchwork
2019-09-24 16:25 ` ✓ Fi.CI.BAT: success " Patchwork
2019-09-25  6:56 ` ✓ Fi.CI.IGT: " Patchwork
  -- strict thread matches above, loose matches on Subject: below --
2019-09-20 19:55 [PATCH 1/2] drm/i915/selftests: Verify the LRC register layout between init and HW Chris Wilson

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=156932285589.3684.14832880682799375166@skylake-alporthouse-com \
    --to=chris@chris-wilson.co.uk \
    --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.