UPSTREAM: iris/gen12: Work around push constant corruption on context switch.

This has been confirmed to fix sporadic graphics corruption on Gen12
platforms for a number of workloads (including Heaven, Valley and
CS:GO among others).  Corruption seems to occur during context switch
fairly consistently, but unfortunately this problem doesn't seem to be
documented.  Until the hardware team comes up with a better
workaround, fix the problem by reemitting constants at the beginning
of each batch.

No corruption has been observed so far in GL due to preemption,
however this is a possibility to keep in mind, it may be necessary to
disable preemption in addition to this patch in order to fully address
this problem (see also 81201e461772a06ed2).

BUG=b:177028336, b:177028255
TEST=CtsDeqp on volteer (Robert/Lab, I don't have it)

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4412
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4454
Cc: mesa-stable
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 20e2c7308f67412234847fd66fb330969ae30de0)
Change-Id: Ic1ea85efa34e73c05320be13b571532b05df3de9
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/mesa/+/2891952
Reviewed-by: Sean Paul <seanpaul@chromium.org>
Reviewed-by: Robert Tarasov <tutankhamen@chromium.org>
Commit-Queue: Ilja H. Friedel <ihf@chromium.org>
Tested-by: Ilja H. Friedel <ihf@chromium.org>
1 file changed