i965: Query whether we have kernel support for the TIMESTAMP register once
authorChris Wilson <chris@chris-wilson.co.uk>
Wed, 29 Apr 2015 12:32:38 +0000 (13:32 +0100)
committerChris Wilson <chris@chris-wilson.co.uk>
Wed, 8 Jul 2015 09:57:35 +0000 (10:57 +0100)
commitc8d3ebaffc0d7d915c1c19d54dba61fd1e57b338
tree7eb56b7e7bba59d38f6ad568fcb2ec6fb48e81d2
parent38c2ec5ff0bf626578db7b84387279342aa48844
i965: Query whether we have kernel support for the TIMESTAMP register once

Move the query for the TIMESTAMP register from context init to the
screen, so that it is only queried once for all contexts.

On 32bit systems, some old kernels trigger a hw bug resulting in the
TIMESTAMP register being shifted and the low 32bits always zero. Detect
this by repeating the read a few times and check the register is
incrementing every 80ns as expected and not stuck on zero (as would be
the case with the buggy kernel/hw.).

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Martin Peres <martin.peres@linux.intel.com>
Reviewed-by: Martin Peres <martin.peres@linux.intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/drivers/dri/i965/intel_extensions.c
src/mesa/drivers/dri/i965/intel_screen.c
src/mesa/drivers/dri/i965/intel_screen.h