drm/i915: Set the Stencil Cache eviction policy to non-LRA mode.
authorKenneth Graunke <kenneth@whitecape.org>
Fri, 27 Apr 2012 19:44:41 +0000 (12:44 -0700)
committerBen Hutchings <ben@decadent.org.uk>
Fri, 11 May 2012 12:14:39 +0000 (13:14 +0100)
commit95053b00dba206bb36217801c60bbb612d8160e0
treeb4e4c511493400eb5e8fb57095266ba704451d99
parent487020e781b754a33510169f05d08f07ca83979f
drm/i915: Set the Stencil Cache eviction policy to non-LRA mode.

commit 3a69ddd6f872180b6f61fda87152b37202118fbc upstream.

Clearing bit 5 of CACHE_MODE_0 is necessary to prevent GPU hangs in
OpenGL programs such as Google MapsGL, Google Earth, and gzdoom when
using separate stencil buffers.  Without it, the GPU tries to use the
LRA eviction policy, which isn't supported.  This was supposed to be off
by default, but seems to be on for many machines.

This cannot be done in gen6_init_clock_gating with most of the other
workaround bits; the render ring needs to exist.  Otherwise, the
register write gets dropped on the floor (one printk will show it
changed, but a second printk immediately following shows the value
reverts to the old one).

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=47535
Cc: Rob Castle <futuredub@gmail.com>
Cc: Eric Appleman <erappleman@gmail.com>
Cc: aaron667@gmx.net
Cc: Keith Packard <keithp@keithp.com>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
drivers/gpu/drm/i915/i915_reg.h
drivers/gpu/drm/i915/intel_ringbuffer.c