From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>,
intel-gfx@lists.freedesktop.org,
Enrico Tagliavini <enrico.tagliavini@gmail.com>,
Bjoern C <lkml@call-home.ch>,
Alexandru DAMIAN <alexandru.damian@intel.com>
Subject: Re: [PATCH v2 3/3] drm/i915: Prevent MI_DISPLAY_FLIP straddling two cachelines on IVB
Date: Tue, 11 Feb 2014 17:50:05 +0200 [thread overview]
Message-ID: <20140211155005.GV3891@intel.com> (raw)
In-Reply-To: <20140211141428.GC11275@nuc-i3427.alporthouse.com>
On Tue, Feb 11, 2014 at 02:14:28PM +0000, Chris Wilson wrote:
> On Tue, Feb 11, 2014 at 03:55:50PM +0200, ville.syrjala@linux.intel.com wrote:
> > From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> >
> > According to BSpec the entire MI_DISPLAY_FLIP packet must be contained
> > in a single cacheline. Make sure that happens.
> >
> > v2: Use intel_ring_begin_cacheline_safe()
>
> Ugh, no. Let's not make intel_ring_begin() any more complicated and just
> introduce a function to align the current head in the ringbuffer to a
> cacheline. Especially with such an interface that is hard to get right.
This doesn't make intel_ring_begin() itself more complicated, but I
guess you meant that the new special version is too complicated for
your taste?
So I guess you want somehting like this:
int ring_align()
{
nops = (64 - (tail & 63)) / 4;
ret = ring_begin(nops);
if (ret)
return ret;
while (nops--)
ring_emit(MI_NOOP);
ring_advance()
return 0;
}
int queue_flip()
{
ret = ring_align();
if (ret)
return ret;
ret = ring_begin(len);
if (ret)
return ret;
if (RCS)
emit LRI DERRMR;
emit MI_DISPLAY_FLIP;
ring_advance()
return 0;
}
So we end up relying on the fact that the entire
LRI+MI_DISPLAY_FLIP sequence will fit within one cacheline. Although if
that would be problem I suppose we could always emit the LRI before
aligning the tail.
If no one is concerned about the useless MI_NOOPs we'll be emitting for
most flips, I guess it's a good enough solution.
--
Ville Syrjälä
Intel OTC
next prev parent reply other threads:[~2014-02-11 15:50 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-11 13:55 [PATCH 0/3] drm/i915: IVB MI_DISPLAY_FLIP cacheline trick ville.syrjala
2014-02-11 13:55 ` [PATCH 1/3] drm/i915: Rework ring wrap detection ville.syrjala
2014-02-11 13:55 ` [PATCH 2/3] drm/i915: Introduce intel_ring_begin_cacheline_safe() ville.syrjala
2014-02-11 13:55 ` [PATCH v2 3/3] drm/i915: Prevent MI_DISPLAY_FLIP straddling two cachelines on IVB ville.syrjala
2014-02-11 14:14 ` Chris Wilson
2014-02-11 15:50 ` Ville Syrjälä [this message]
2014-02-11 16:01 ` Daniel Vetter
2014-02-11 16:23 ` 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=20140211155005.GV3891@intel.com \
--to=ville.syrjala@linux.intel.com \
--cc=alexandru.damian@intel.com \
--cc=chris@chris-wilson.co.uk \
--cc=enrico.tagliavini@gmail.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=lkml@call-home.ch \
/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.