i965: Use absolute addressing for constant buffer 0 on Kernel 4.16+.
authorKenneth Graunke <kenneth@whitecape.org>
Fri, 15 Aug 2014 05:36:45 +0000 (22:36 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Sat, 17 Feb 2018 19:26:31 +0000 (11:26 -0800)
commitfa8a764b62588420ac789df79ec0ab858b38639f
tree7715cae140e58ee024faa95de730040b9e4d7407
parenta63c74be851e3d9ddc3bc6ae162346463b1daef3
i965: Use absolute addressing for constant buffer 0 on Kernel 4.16+.

By default, 3DSTATE_CONSTANT_* Constant Buffer 0 is relative to dynamic
state base address.  This makes it unusable for pushing UBOs.

There is a bit in the INSTPM register (or CS_DEBUG_MODE2 on Skylake)
which controls whether buffer 0 is relative to dynamic state base
address, or simply a normal pointer.  Setting that gives us full
flexibility.  This lets us push up to 4 UBO ranges.

We can't currently write this on Haswell and earlier, and will need
to update the kernel command parser, and then do the whole version
checking song and dance.  We also need a brand new kernel that supports
context isolation - on older kernels, newly created contexts inherit
register state from whatever happened to be running.  So, setting this
would have catastrophic impact on other drivers such as libva, Beignet,
or older Mesa.

See commit 8ec5a4e4a4a32f4de351c5fc2bf0eb615b6eef1b where we did this
once before, but had to revert it in commit 013d33122028f2492da90a03a.

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
src/mesa/drivers/dri/i965/brw_state_upload.c
src/mesa/drivers/dri/i965/intel_screen.c