Skip to content

Commit 9bdbb71

Browse files
anholtgregkh
authored andcommitted
drm/i915: Turn on a required 3D clock gating bit on Sandybridge.
commit 406478d upstream. Fixes rendering failures in Unigine Tropics and Sanctuary and the mesa "fire" demo. Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Keith Packard <keithp@keithp.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
1 parent 03d51d1 commit 9bdbb71

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
@@ -3401,6 +3401,9 @@
34013401
#define GT_FIFO_FREE_ENTRIES 0x120008
34023402
#define GT_FIFO_NUM_RESERVED_ENTRIES 20
34033403

3404+
#define GEN6_UCGCTL2 0x9404
3405+
# define GEN6_RCPBUNIT_CLOCK_GATE_DISABLE (1 << 12)
3406+
34043407
#define GEN6_RPNSWREQ 0xA008
34053408
#define GEN6_TURBO_DISABLE (1<<31)
34063409
#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
@@ -7882,6 +7882,15 @@ static void gen6_init_clock_gating(struct drm_device *dev)
78827882
I915_WRITE(WM2_LP_ILK, 0);
78837883
I915_WRITE(WM1_LP_ILK, 0);
78847884

7885+
/* According to the BSpec vol1g, bit 12 (RCPBUNIT) clock
7886+
* gating disable must be set. Failure to set it results in
7887+
* flickering pixels due to Z write ordering failures after
7888+
* some amount of runtime in the Mesa "fire" demo, and Unigine
7889+
* Sanctuary and Tropics, and apparently anything else with
7890+
* alpha test or pixel discard.
7891+
*/
7892+
I915_WRITE(GEN6_UCGCTL2, GEN6_RCPBUNIT_CLOCK_GATE_DISABLE);
7893+
78857894
/*
78867895
* According to the spec the following bits should be
78877896
* set in order to enable memory self-refresh and fbc:

0 commit comments

Comments
 (0)