From: Ben Widawsky <ben@bwidawsk.net>
To: Chris Wilson <chris@chris-wilson.co.uk>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH] drm/i915: Only apply the SNB pipe control w/a to gen6
Date: Fri, 20 Jul 2012 14:00:57 -0700 [thread overview]
Message-ID: <20120720140057.2f095b38@stallone.hsd1.or.comcast.net> (raw)
In-Reply-To: <1342803748-25695-1-git-send-email-chris@chris-wilson.co.uk>
On Fri, 20 Jul 2012 18:02:28 +0100
Chris Wilson <chris@chris-wilson.co.uk> wrote:
> The requirements for the sync flush to be emitted prior to the render
> cache flush is only true for SandyBridge. On IvyBridge and friends we
> can just emit the flushes with an inline CS stall.
>
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Tested-by: Ben Widawsky <ben@bwidawsk.net> [tested on IVB]
> ---
> drivers/gpu/drm/i915/intel_ringbuffer.c | 33
> +++++++++++++++++++------------ 1 file changed, 20 insertions(+), 13
> deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.c
> b/drivers/gpu/drm/i915/intel_ringbuffer.c index b35a89a..42ad7ad
> 100644 --- a/drivers/gpu/drm/i915/intel_ringbuffer.c
> +++ b/drivers/gpu/drm/i915/intel_ringbuffer.c
> @@ -214,15 +214,8 @@ gen6_render_ring_flush(struct intel_ring_buffer
> *ring, u32 invalidate_domains, u32 flush_domains)
> {
> u32 flags = 0;
> - struct pipe_control *pc = ring->private;
> - u32 scratch_addr = pc->gtt_offset + 128;
> int ret;
>
> - /* Force SNB workarounds for PIPE_CONTROL flushes */
> - ret = intel_emit_post_sync_nonzero_flush(ring);
> - if (ret)
> - return ret;
> -
> /* Just flush everything. Experiments have shown that
> reducing the
> * number of bits based on the write domains has little
> performance
> * impact.
> @@ -242,21 +235,33 @@ gen6_render_ring_flush(struct intel_ring_buffer
> *ring, if (flush_domains)
> flags |= PIPE_CONTROL_CS_STALL;
>
> - ret = intel_ring_begin(ring, 6);
> + ret = intel_ring_begin(ring, 4);
> if (ret)
> return ret;
>
> - intel_ring_emit(ring, GFX_OP_PIPE_CONTROL(5));
> + intel_ring_emit(ring, GFX_OP_PIPE_CONTROL(4));
> intel_ring_emit(ring, flags);
> - intel_ring_emit(ring, scratch_addr |
> PIPE_CONTROL_GLOBAL_GTT);
> - intel_ring_emit(ring, 0); /* lower dword */
> - intel_ring_emit(ring, 0); /* uppwer dword */
> - intel_ring_emit(ring, MI_NOOP);
> + intel_ring_emit(ring, 0);
> + intel_ring_emit(ring, 0);
> intel_ring_advance(ring);
>
> return 0;
> }
>
> +static int
> +gen6_render_ring_flush__wa(struct intel_ring_buffer *ring,
> + u32 invalidate_domains, u32 flush_domains)
> +{
> + int ret;
> +
> + /* Force SNB workarounds for PIPE_CONTROL flushes */
> + ret = intel_emit_post_sync_nonzero_flush(ring);
> + if (ret)
> + return ret;
> +
> + return gen6_render_ring_flush(ring, invalidate_domains,
> flush_domains); +}
> +
> static void ring_write_tail(struct intel_ring_buffer *ring,
> u32 value)
> {
> @@ -1374,6 +1379,8 @@ int intel_init_render_ring_buffer(struct
> drm_device *dev) if (INTEL_INFO(dev)->gen >= 6) {
> ring->add_request = gen6_add_request;
> ring->flush = gen6_render_ring_flush;
> + if (INTEL_INFO(dev)->gen == 6)
> + ring->flush = gen6_render_ring_flush__wa;
> ring->irq_get = gen6_ring_get_irq;
> ring->irq_put = gen6_ring_put_irq;
> ring->irq_enable_mask = GT_USER_INTERRUPT;
--
Ben Widawsky, Intel Open Source Technology Center
next prev parent reply other threads:[~2012-07-20 21:01 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-20 17:02 [PATCH] drm/i915: Only apply the SNB pipe control w/a to gen6 Chris Wilson
2012-07-20 21:00 ` Ben Widawsky [this message]
2012-07-25 12:51 ` [PATCH 1/2] drm/i915: flush DC writes cached in l3$ on gen7 Daniel Vetter
2012-07-25 12:51 ` [PATCH 2/2] drm/i915: disable indirect state pointers in render flush Daniel Vetter
2012-07-26 17:33 ` Eric Anholt
2012-07-26 17:47 ` Daniel Vetter
2012-07-26 17:25 ` [PATCH 1/2] drm/i915: flush DC writes cached in l3$ on gen7 Eric Anholt
2012-08-08 7:35 ` [PATCH] drm/i915: Only apply the SNB pipe control w/a to gen6 Daniel Vetter
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=20120720140057.2f095b38@stallone.hsd1.or.comcast.net \
--to=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