i965: Implement proper workaround for Gen4 GPU CONSTANT_BUFFER hangs

Graphics / Mesa 3D Graphics Library / Mesa - Kenneth Graunke [whitecape.org] - 14 April 2015 03:49 UTC

I finally managed to dig up some information on our mysterious GPU hangs. A wiki page from the Crestline validation team mentions that they found a GPU hang in "Serious Sam 2" (on Windows) with remarkably similar conditions to the ones we've seen in Google Chrome and glmark2.

Apparently, if WM_STATE has "PS Use Source Depth" enabled, CC_STATE has most depth state disabled, and you issue a CONSTANT_BUFFER command and immediately draw, the depth interpolator makes a small mistake that leads to hangs.

Most of the traces I looked at contained a CONSTANT_BUFFER packet immediately followed by 3DPRIMITIVE, or at least very few packets. It appears they also have "PS Use Source Depth" enabled - either at the hang, or a little before it. So I think this is our bug.

The workaround is to emit a non-pipelined state packet after issuing a CONSTANT_BUFFER packet. This is really similar to the workaround I developed in commit c4fd0c9052dd391d6f2e9bb8e6da209dfc7ef35b.

v2: Fix word-wrapping issues.

f55ded7 i965: Implement proper workaround for Gen4 GPU CONSTANT_BUFFER hangs.
src/mesa/drivers/dri/i965/brw_curbe.c | 39 ++++++++++++++++++++++-----------
1 file changed, 26 insertions(+), 13 deletions(-)

Upstream: cgit.freedesktop.org


  • Share