[Mesa-dev] [PATCH 1/2] intel: Move finish_batch() call before MI_BATCH_BUFFER_END and padding.

Eric Anholt eric at anholt.net
Sun Aug 12 18:43:06 PDT 2012


Kenneth Graunke <kenneth at whitecape.org> writes:

> On Gen4+, brw_finish_batch() calls brw_emit_query_end(), which emits
> some extra PIPE_CONTROLs to capture the current occlusion query data.
> Unfortunately, it was being called *after* _intel_batchbuffer_flush
> added the MI_BATCH_BUFFER_END, meaning those PIPE_CONTROLs didn't get
> inside the batch.
>
> Not only does this likely cause bogus occlusion query values, it can
> also cause crashes: with the recent change to use 64-bit depth count
> writes on Gen6+, we started emitting an odd-length PIPE_CONTROL, which
> happened after the MI_NOOP padding.  This resulted in an odd-length
> batch buffer, which resulted in execbuf2 returning -EINVAL and the
> application dying with an intel_do_flush_locked failure.
>
> On older generations, finish_batch() doesn't emit any state, so this
> change shouldn't have any effect.
>
> Huge thanks to Chris Wilson for helping me figure this out.
>
> NOTE: This is a candidate for stable release branches.

Looks like this is safe for i915 as well.

This series is

Reviewed-by: Eric Anholt <eric at anholt.net>

(though I'd also love a patch asserting that we didn't overflow our
RESERVED_SPACE).
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20120812/3c3d707a/attachment.pgp>


More information about the mesa-dev mailing list