public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: Chris Wilson <chris@chris-wilson.co.uk>,
	Ben Widawsky <ben@bwidawsk.net>,
	intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 2/6] drm/i915: Use a private interface for register access within GT
Date: Fri, 12 Jul 2013 22:57:25 +0200	[thread overview]
Message-ID: <20130712205725.GK6143@phenom.ffwll.local> (raw)
In-Reply-To: <20130712205546.GH23323@cantiga.alporthouse.com>

On Fri, Jul 12, 2013 at 09:55:46PM +0100, Chris Wilson wrote:
> On Fri, Jul 12, 2013 at 01:25:27PM -0700, Ben Widawsky wrote:
> > On Fri, Jul 12, 2013 at 03:02:32PM +0100, Chris Wilson wrote:
> > > The GT functions for enabling register access also need to occasionally
> > > write to and read from registers. To avoid the potential recursion as we
> > > modify the public interface to be stricter, introduce a private register
> > > access API for the GT functions.
> > > 
> > > Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> > > ---
> > >  drivers/gpu/drm/i915/intel_gt.c | 92 +++++++++++++++++++++++++----------------
> > >  1 file changed, 56 insertions(+), 36 deletions(-)
> > > 
> > > diff --git a/drivers/gpu/drm/i915/intel_gt.c b/drivers/gpu/drm/i915/intel_gt.c
> > > index 060e256..cb3116c 100644
> > > --- a/drivers/gpu/drm/i915/intel_gt.c
> > > +++ b/drivers/gpu/drm/i915/intel_gt.c
> > > @@ -26,6 +26,19 @@
> > >  
> > >  #define FORCEWAKE_ACK_TIMEOUT_MS 2
> > >  
> > > +#define __raw_i915_read8(dev_priv__, reg__) readb((dev_priv__)->regs + (reg__))
> > > +#define __raw_i915_write8(dev_priv__, reg__, val__) writeb(val__, (dev_priv__)->regs + (reg__))
> > > +
> > > +#define __raw_i915_read16(dev_priv__, reg__) readw((dev_priv__)->regs + (reg__))
> > > +#define __raw_i915_write16(dev_priv__, reg__, val__) writew(val__, (dev_priv__)->regs + (reg__))
> > > +
> > > +#define __raw_i915_read32(dev_priv__, reg__) readl((dev_priv__)->regs + (reg__))
> > > +#define __raw_i915_write32(dev_priv__, reg__, val__) writel(val__, (dev_priv__)->regs + (reg__))
> > 
> > Instead of what you did, I would have preferred
> > #define __raw_posting_read
> 
> In hindsight, I agree with using __raw_posting_read.

Patch on top to avoid another messy rebase? I've read through the patches
and also thought that the (void)__raw_read sprinkled all over is
unsightly, a __raw_posting_read would look better.
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch

  reply	other threads:[~2013-07-12 20:57 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-12 14:02 [PATCH 1/6] drm/i915: Colocate all GT access routines in the same file Chris Wilson
2013-07-12 14:02 ` [PATCH 2/6] drm/i915: Use a private interface for register access within GT Chris Wilson
2013-07-12 20:25   ` Ben Widawsky
2013-07-12 20:55     ` Chris Wilson
2013-07-12 20:57       ` Daniel Vetter [this message]
2013-07-12 14:02 ` [PATCH 3/6] drm/i915: Use the common register access functions for NOTRACE variants Chris Wilson
2013-07-12 20:34   ` Ben Widawsky
2013-07-12 20:51     ` Chris Wilson
2013-07-12 14:02 ` [PATCH 4/6] drm/i915: Serialize all register access Chris Wilson
2013-07-12 20:37   ` Ben Widawsky
2013-07-12 20:52     ` Chris Wilson
2013-07-16  3:20       ` Ben Widawsky
2013-07-12 14:02 ` [PATCH 5/6] drm/i915: Squash gen lookup through multiple indirections inside GT access Chris Wilson
2013-07-12 14:02 ` [PATCH 6/6] drm/i915: Convert the register access tracepoint to be conditional Chris Wilson
  -- strict thread matches above, loose matches on Subject: below --
2013-07-12 14:59 [PATCH 1/6] drm/i915: Colocate all GT access routines in the same file Chris Wilson
2013-07-12 14:59 ` [PATCH 2/6] drm/i915: Use a private interface for register access within GT Chris Wilson
2013-07-12 17:08 [PATCH 1/6] drm/i915: Colocate all GT access routines in the same file Chris Wilson
2013-07-12 17:08 ` [PATCH 2/6] drm/i915: Use a private interface for register access within GT Chris Wilson
2013-07-14 19:48   ` Ben Widawsky
2013-07-16 16:18     ` Chris Wilson
2013-07-16 19:02 [PATCH 1/6] drm/i915: Colocate all GT access routines in the same file Chris Wilson
2013-07-16 19:02 ` [PATCH 2/6] drm/i915: Use a private interface for register access within GT 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=20130712205725.GK6143@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --cc=ben@bwidawsk.net \
    --cc=chris@chris-wilson.co.uk \
    --cc=intel-gfx@lists.freedesktop.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox