drm/i915: implement WaDisableVLVClockGating_VBIIssue on VLV
authorJesse Barnes <jbarnes@virtuousgeek.org>
Thu, 25 Oct 2012 19:15:44 +0000 (12:15 -0700)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Sun, 11 Nov 2012 22:51:35 +0000 (23:51 +0100)
This allows us to get the right vblank interrupt frequency.

v2: pull in register definition

Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Reviewed-by: Antti Koskipää <antti.koskipaa@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/i915/i915_reg.h
drivers/gpu/drm/i915/intel_pm.c

index 5a1a984d74c9d3522a6d130ef5ade61388040d37..2aff1bbcfc83e63efe0b9e8f4472e61a2bd6900f 100644 (file)
 #define IIR            0x020a4
 #define IMR            0x020a8
 #define ISR            0x020ac
+#define VLV_GUNIT_CLOCK_GATE   0x182060
+#define   GCFG_DIS             (1<<8)
 #define VLV_IIR_RW     0x182084
 #define VLV_IER                0x1820a0
 #define VLV_IIR                0x1820a4
index 871bfe49b913695d16116b8c7e0ab496ac4a23ad..10e6d6c219600d2b467e7f89df7c5147e7665015 100644 (file)
@@ -3755,6 +3755,13 @@ static void valleyview_init_clock_gating(struct drm_device *dev)
                   PIPEA_HLINE_INT_EN | PIPEA_VBLANK_INT_EN |
                   SPRITEB_FLIPDONE_INT_EN | SPRITEA_FLIPDONE_INT_EN |
                   PLANEA_FLIPDONE_INT_EN);
+
+       /*
+        * WaDisableVLVClockGating_VBIIssue
+        * Disable clock gating on th GCFG unit to prevent a delay
+        * in the reporting of vblank events.
+        */
+       I915_WRITE(VLV_GUNIT_CLOCK_GATE, GCFG_DIS);
 }
 
 static void g4x_init_clock_gating(struct drm_device *dev)