From: Daniel Vetter <daniel@ffwll.ch>
To: Chris Wilson <chris@chris-wilson.co.uk>,
Jesse Barnes <jbarnes@virtuousgeek.org>,
intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 1/6] drm/i915: Replace hardcoded cacheline size with macro
Date: Thu, 3 Apr 2014 17:16:16 +0200 [thread overview]
Message-ID: <20140403151616.GE7225@phenom.ffwll.local> (raw)
In-Reply-To: <20140403064540.GI5602@nuc-i3427.alporthouse.com>
On Thu, Apr 03, 2014 at 07:45:40AM +0100, Chris Wilson wrote:
> On Wed, Apr 02, 2014 at 02:57:11PM -0700, Jesse Barnes wrote:
> > On Wed, 2 Apr 2014 16:36:06 +0100
> > Chris Wilson <chris@chris-wilson.co.uk> wrote:
> >
> > > For readibility and guess at the meaning behind the constants.
> > >
> > > Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> > > ---
> > > drivers/gpu/drm/i915/intel_ringbuffer.c | 29 ++++++++++++++++-------------
> > > 1 file changed, 16 insertions(+), 13 deletions(-)
> > >
> > > diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.c b/drivers/gpu/drm/i915/intel_ringbuffer.c
> > > index 785f246d28a8..475391ce671a 100644
> > > --- a/drivers/gpu/drm/i915/intel_ringbuffer.c
> > > +++ b/drivers/gpu/drm/i915/intel_ringbuffer.c
> > > @@ -33,6 +33,8 @@
> > > #include "i915_trace.h"
> > > #include "intel_drv.h"
> > >
> > > +#define CACHELINE_BYTES 64
> > > +
> >
> > Are you sure it's 64 on every gen? It changes on the CPU side from
> > time to time... I thought it might have changed over time on the GPU
> > too but I haven't checked the specs.
>
> The cacheline is 32bytes on gen2, 64 elsewhere. We've made a blanket
> assumption of 64 and then some random factors on top. (Some cachelines
> may be as large as 1024bytes elsewhere in the chip.) I'm not sure where
> some of the values used in the code where plucked from, Jesse?
Maybe a quick comment that this is the maximum and that gen2 has only
32bytes but aligning more isn't harmful?
Perhaps also mention that for actual cacheline flushing we _must_ use the
cl size of the cpu for otherwise we don't flush poperly. If your define
has some comment/warning to that effect I'm ok with this generalization.
And it nicely makes some of the additional lore (128bytes ?!) stick out
more.
btw the 1k thing at least on i865G is iirc just the writeout fifo between
the cpu and the gmch to paper over FSB latencies (or whatever irked hw
designers).
-Daniel
--
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
next prev parent reply other threads:[~2014-04-03 15:16 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-02 15:36 [PATCH 1/6] drm/i915: Replace hardcoded cacheline size with macro Chris Wilson
2014-04-02 15:36 ` [PATCH 2/6] drm/i915: Move all ring resets before setting the HWS page Chris Wilson
2014-04-02 21:58 ` Jesse Barnes
2014-04-03 15:18 ` Daniel Vetter
2014-04-02 15:36 ` [PATCH 3/6] drm/i915: Preserve ring buffers objects across resume Chris Wilson
2014-04-02 22:10 ` Jesse Barnes
2014-04-03 6:43 ` Chris Wilson
2014-04-02 15:36 ` [PATCH 4/6] drm/i915: Allow the module to load even if we fail to setup rings Chris Wilson
2014-04-02 22:11 ` Jesse Barnes
2014-04-03 6:42 ` Chris Wilson
2014-04-02 15:36 ` [PATCH 5/6] drm/i915: Mark device as wedged if we fail to resume Chris Wilson
2014-04-02 15:36 ` [PATCH 6/6] drm/i915: Include a little more information about why ring init fails Chris Wilson
2014-04-02 21:57 ` [PATCH 1/6] drm/i915: Replace hardcoded cacheline size with macro Jesse Barnes
2014-04-03 6:45 ` Chris Wilson
2014-04-03 15:16 ` Daniel Vetter [this message]
2014-04-03 15:23 ` Chris Wilson
2014-04-03 21:09 ` Daniel Vetter
-- strict thread matches above, loose matches on Subject: below --
2014-04-09 8:19 Chris Wilson
2014-04-22 12:35 ` Mateo Lozano, Oscar
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=20140403151616.GE7225@phenom.ffwll.local \
--to=daniel@ffwll.ch \
--cc=chris@chris-wilson.co.uk \
--cc=intel-gfx@lists.freedesktop.org \
--cc=jbarnes@virtuousgeek.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