OSDN Git Service

i965: Emit 3DSTATE_MULTISAMPLE before WM_HZ_OP (gen8+)
authorBen Widawsky <benjamin.widawsky@intel.com>
Thu, 21 May 2015 02:20:14 +0000 (19:20 -0700)
committerEmil Velikov <emil.l.velikov@gmail.com>
Wed, 3 Jun 2015 11:06:01 +0000 (12:06 +0100)
commitf8bb4a814d9aac2825737e48fefc16785cb9060c
tree4a98b22d2995213653ce19bb3ddc4b5c3f349812
parent8c56fc92750a4a6c390354c0b1428cdc9edac5b5
i965: Emit 3DSTATE_MULTISAMPLE before WM_HZ_OP (gen8+)

Starting with GEN8, there is documentation that the multisample state command
must be emitted before the 3DSTATE_WM_HZ_OP command any time the multisample
count changes. The 3DSTATE_WM_HZ_OP packet gets emitted as a result of a
intel_hix_exec(), which is called upon a fast clear and/or a resolve. This can
happen before the state atoms are checked, and so the multisample state must be
put directly in the function.

v1:
- In v0, I was always emitting the command, but Ken came up with the condition to
determine whether or not the sample count actually changed.
- Ken's recommendation was to set brw->num_multisamples after emitting
3DSTATE_MULTISAMPLE. This doesn't work. I put my best guess as to why in the XXX
(it was causing 7 regressions on BDW).

v2:
Flag NEW_MULTISAMPLE state. As Ken found, in state upload we check for the
multisample change to determine whether or not to emit certain packets. Since
the hiz code doesn't actually care about the number of multisamples, set the
flag and let the later code take care of it.

Jenkins results:
http://otc-mesa-ci.jf.intel.com/view/dev/job/bwidawsk/136/

Fixes around 200 piglit tests on SKL. I'm somewhat surprised that it seems to
have no impact on BDW as the restriction is needed there as well.

Cc: "10.5 10.6" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
Reviewed-by: Neil Roberts <neil@linux.intel.com> (v0)
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> (v2)
(cherry picked from commit e2d84d99f5a66738e8f584bdfea66182f36fe46c)
src/mesa/drivers/dri/i965/gen8_depth_state.c