]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
drm/i915: Enable interrupt-based AGPBUSY# enable on 85x
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Tue, 25 Feb 2014 13:13:40 +0000 (15:13 +0200)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Wed, 28 May 2014 12:50:56 +0000 (14:50 +0200)
85x also has a similar AGPBUSY# bit as gen3. Enable it to make
sure vblank interrupts don't get dealyed during C3 state.

There's also another bit which controls whether AGPBUSY# is asserted
based on pending cacheable cycles and interrupts, or just based on
pending commands in the ring and interrupts. Select the cacheable
cycles mode since that seems to be the new way of doing things in
85x, and it does give slightly better C3 residency numbers with
glxgears running.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/i915/i915_reg.h
drivers/gpu/drm/i915/intel_pm.c

index acb00858f657b4ac02cf2c191eade5e7a14a9cc9..242df99f8b1a42f244f55c42ae45ecad643f31a2 100644 (file)
@@ -1298,6 +1298,10 @@ enum punit_power_well {
 #define   MI_ARB_DISPLAY_PRIORITY_A_B          (0 << 0)        /* display A > display B */
 #define   MI_ARB_DISPLAY_PRIORITY_B_A          (1 << 0)        /* display B > display A */
 
+#define MI_STATE       0x020e4 /* gen2 only */
+#define   MI_AGPBUSY_INT_EN                    (1 << 1) /* 85x only */
+#define   MI_AGPBUSY_830_MODE                  (1 << 0) /* 85x only */
+
 #define CACHE_MODE_0   0x02120 /* 915+ only */
 #define   CM0_PIPELINED_RENDER_FLUSH_DISABLE (1<<8)
 #define   CM0_IZ_OPT_DISABLE      (1<<6)
index df5181503e59f305bc5c9e8fee6510b58d294ddd..16840f3d4e5207b66af47cb605b431821fd7c032 100644 (file)
@@ -5707,6 +5707,10 @@ static void i85x_init_clock_gating(struct drm_device *dev)
        struct drm_i915_private *dev_priv = dev->dev_private;
 
        I915_WRITE(RENCLK_GATE_D1, SV_CLOCK_GATE_DISABLE);
+
+       /* interrupts should cause a wake up from C3 */
+       I915_WRITE(MI_STATE, _MASKED_BIT_ENABLE(MI_AGPBUSY_INT_EN) |
+                  _MASKED_BIT_DISABLE(MI_AGPBUSY_830_MODE));
 }
 
 static void i830_init_clock_gating(struct drm_device *dev)