i965: Set screen->cmd_parser_version to 0 if we can't write registers.
authorKenneth Graunke <kenneth@whitecape.org>
Fri, 3 Mar 2017 02:21:31 +0000 (18:21 -0800)
committerKenneth Graunke <kenneth@whitecape.org>
Mon, 20 Mar 2017 22:58:05 +0000 (15:58 -0700)
commit31693a13f8fbc52d4f19f1e8800a4edabeecbe19
tree699c9f36bf9046f1356b2c9cd691e4aa0ab4403f
parent4a2ad6b145b4dd0d19a8e5e0ee6bed09e08ce0eb
i965: Set screen->cmd_parser_version to 0 if we can't write registers.

If we can't write registers, then the effective command parser version
is 0 - it may exist, but it's not usefully enabling anything.

See kernel commit 1ca3712ca3429a617ed6c5f87718e4f6fe4ae0c6 (in v4.8)
where the kernel starts doing this for us.  This makes us do more or
less the same thing on older kernels.

This should preserve a bit of sanity by allowing us to perform a
screen->cmd_parser_version > N check to determine that we really can
use the features promised by command parser version N.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
src/mesa/drivers/dri/i965/intel_screen.c