On 6 January 2014 17:05, Chad Versace <chad.vers...@linux.intel.com> wrote:
> Set brw->need_workaround_flush immediately after each 3D_CMD_PRIM. This > may prevent undiscovered difficult-to-diagnose gpu hangs, according to > Ken. > > The art of emitting workaround flushes on Sandybridge is mysterious and > not fully understood. Ken's intuition says that > intel_emit_post_sync_nonzero_flush() is required after each 3D_CMD_PRIM. > > On gen6, there are two places where we emit 3D_CMD_PRIM: brw_emit_prim() > and gen6_blorp_emit_primitive(). The former already sets > need_workaround_flush, so this patch needs only to change the latter. > > There is no need to set need_workaround_flush in > gen7_blorp_emit_primitive() because the workaround applies only to gen6. > > CC: mesa-sta...@lists.freedesktop.org > CC: Kenneth Graunke <kenn...@whitecape.org> > CC: Paul Berry <stereotype...@gmail.com> > CC: Stéphane Marchesin <marc...@chromium.org> > Signed-off-by: Chad Versace <chad.vers...@linux.intel.com> > --- > src/mesa/drivers/dri/i965/gen6_blorp.cpp | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/src/mesa/drivers/dri/i965/gen6_blorp.cpp > b/src/mesa/drivers/dri/i965/gen6_blorp.cpp > index 441d61f..929d7b5 100644 > --- a/src/mesa/drivers/dri/i965/gen6_blorp.cpp > +++ b/src/mesa/drivers/dri/i965/gen6_blorp.cpp > @@ -1010,6 +1010,9 @@ gen6_blorp_emit_primitive(struct brw_context *brw, > OUT_BATCH(0); > OUT_BATCH(0); > ADVANCE_BATCH(); > + > + /* Only used on Sandybridge; harmless to set elsewhere. */ > + brw->batch.need_workaround_flush = true; > This is not strictly necessary, since we already set brw->batch.need_workaround_flush in brw_blorp_exec() after running the blorp operation. However, doing it here in gen6_blorp_emit_primitive() seems slightly better, since it makes the blorp codepath more similar to the non-blorp codepath. My personal preference would be to go ahead with this patch, but squash in a removal of the code in brw_blorp_exec() that sets need_workaround_flush. But I don't have a strong preference. Either way the patch is: Reviewed-by: Paul Berry <stereotype...@gmail.com>
_______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev