Skip to content

Commit 406478d

Browse files
anholtkeith-packard
authored andcommitted
drm/i915: Turn on a required 3D clock gating bit on Sandybridge.
Fixes rendering failures in Unigine Tropics and Sanctuary and the mesa "fire" demo. Signed-off-by: Eric Anholt <eric@anholt.net> Cc: stable@kernel.org Signed-off-by: Keith Packard <keithp@keithp.com>
1 parent 680da87 commit 406478d

2 files changed

Lines changed: 12 additions & 0 deletions

File tree

‎drivers/gpu/drm/i915/i915_reg.h‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3444,6 +3444,9 @@
34443444
#define GT_FIFO_FREE_ENTRIES 0x120008
34453445
#define GT_FIFO_NUM_RESERVED_ENTRIES 20
34463446

3447+
#define GEN6_UCGCTL2 0x9404
3448+
# define GEN6_RCPBUNIT_CLOCK_GATE_DISABLE (1 << 12)
3449+
34473450
#define GEN6_RPNSWREQ 0xA008
34483451
#define GEN6_TURBO_DISABLE (1<<31)
34493452
#define GEN6_FREQUENCY(x) ((x)<<25)

‎drivers/gpu/drm/i915/intel_display.c‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8148,6 +8148,15 @@ static void gen6_init_clock_gating(struct drm_device *dev)
81488148
I915_WRITE(WM2_LP_ILK, 0);
81498149
I915_WRITE(WM1_LP_ILK, 0);
81508150

8151+
/* According to the BSpec vol1g, bit 12 (RCPBUNIT) clock
8152+
* gating disable must be set. Failure to set it results in
8153+
* flickering pixels due to Z write ordering failures after
8154+
* some amount of runtime in the Mesa "fire" demo, and Unigine
8155+
* Sanctuary and Tropics, and apparently anything else with
8156+
* alpha test or pixel discard.
8157+
*/
8158+
I915_WRITE(GEN6_UCGCTL2, GEN6_RCPBUNIT_CLOCK_GATE_DISABLE);
8159+
81518160
/*
81528161
* According to the spec the following bits should be
81538162
* set in order to enable memory self-refresh and fbc:

0 commit comments

Comments
 (0)