From: Paulo Zanoni <przanoni@gmail.com>
To: intel-gfx@lists.freedesktop.org
Cc: Paulo Zanoni <paulo.r.zanoni@intel.com>
Subject: [PATCH 3/4] drm/i915: add workaround to gen7_render_ring_flush
Date: Fri, 17 Aug 2012 18:35:43 -0300 [thread overview]
Message-ID: <1345239344-9968-4-git-send-email-przanoni@gmail.com> (raw)
In-Reply-To: <1345239344-9968-1-git-send-email-przanoni@gmail.com>
From: Paulo Zanoni <paulo.r.zanoni@intel.com>
The combination of this commit + the next one will prevent a lot of
gpu hangs.
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
---
drivers/gpu/drm/i915/intel_ringbuffer.c | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)
diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.c b/drivers/gpu/drm/i915/intel_ringbuffer.c
index dc5272b..9895a6e 100644
--- a/drivers/gpu/drm/i915/intel_ringbuffer.c
+++ b/drivers/gpu/drm/i915/intel_ringbuffer.c
@@ -263,6 +263,25 @@ gen6_render_ring_flush(struct intel_ring_buffer *ring,
}
static int
+gen7_render_ring_cs_stall_wa(struct intel_ring_buffer *ring)
+{
+ int ret;
+
+ ret = intel_ring_begin(ring, 4);
+ if (ret)
+ return ret;
+
+ intel_ring_emit(ring, GFX_OP_PIPE_CONTROL(4));
+ intel_ring_emit(ring, PIPE_CONTROL_CS_STALL |
+ PIPE_CONTROL_STALL_AT_SCOREBOARD);
+ intel_ring_emit(ring, 0);
+ intel_ring_emit(ring, 0);
+ intel_ring_advance(ring);
+
+ return 0;
+}
+
+static int
gen7_render_ring_flush(struct intel_ring_buffer *ring,
u32 invalidate_domains, u32 flush_domains)
{
@@ -295,6 +314,11 @@ gen7_render_ring_flush(struct intel_ring_buffer *ring,
* TLB invalidate requires a post-sync write.
*/
flags |= PIPE_CONTROL_QW_WRITE;
+
+ /* Workaround: we must issue a pipe_control with CS-stall bit
+ * set before a pipe_control command that has the state cache
+ * invalidate bit set. */
+ gen7_render_ring_cs_stall_wa(ring);
}
ret = intel_ring_begin(ring, 4);
--
1.7.11.2
next prev parent reply other threads:[~2012-08-17 21:35 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-17 21:35 [PATCH 0/4] Haswell GPU hang fixes Paulo Zanoni
2012-08-17 21:35 ` [PATCH 1/4] drm/i915: add gen7_render_ring_flush Paulo Zanoni
2012-08-17 21:35 ` [PATCH 2/4] drm/i915: add workarounds directly to gen6_render_ring_flush Paulo Zanoni
2012-08-17 21:35 ` Paulo Zanoni [this message]
2012-08-28 9:17 ` [PATCH 3/4] drm/i915: add workaround to gen7_render_ring_flush Daniel Vetter
2012-08-28 13:10 ` Paulo Zanoni
2012-08-28 15:17 ` Daniel Vetter
2012-08-17 21:35 ` [PATCH 4/4] drm/i915: add one more " Paulo Zanoni
2012-08-17 22:39 ` [PATCH 0/4] Haswell GPU hang fixes Ben Widawsky
2012-08-17 22:42 ` Paulo Zanoni
2012-08-17 22:53 ` Ben Widawsky
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=1345239344-9968-4-git-send-email-przanoni@gmail.com \
--to=przanoni@gmail.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=paulo.r.zanoni@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox