From f535e532f3279e43a7f20bc96d4e62b24a9af684 Mon Sep 17 00:00:00 2001
From: Thomas Richter <thor@math.tu-berlin.de>
Date: Mon, 18 Nov 2013 10:38:27 +0100
Subject: [PATCH 3/3] Watermark configuration workaround for i830 chipsets.
For unclear reasons, the watermark level on i830 and related
chipsets must not grow above 6 as otherwise display flickering
will occurr, specifically on panning.
Signed-off-by: Thomas Richter <thor@math.tu-berlin.de>
---
drivers/gpu/drm/i915/intel_pm.c | 25 +++++++++++++++++++++++++
1 file changed, 25 insertions(+)
@@ -1648,6 +1648,21 @@ static void i9xx_update_wm(struct drm_crtc *unused_crtc)
I915_WRITE(FW_BLC_SELF, srwm & 0x3f);
}
+ if (IS_I830(dev)) {
+ /* For unknown reasons, i830 chipsets run havok
+ * on panning if the watermark is below 6,
+ * thus adjust it accordingly.
+ */
+ if (planea_wm < 6) {
+ planea_wm = 6;
+ DRM_DEBUG_KMS("i9xx plane A wm workaround enabled\n");
+ }
+ if (planeb_wm < 6) {
+ planeb_wm = 6;
+ DRM_DEBUG_KMS("i9xx plane B wm workaround enabled\n");
+ }
+ }
+
DRM_DEBUG_KMS("Setting FIFO watermarks - A: %d, B: %d, C: %d, SR %d\n",
planea_wm, planeb_wm, cwm, srwm);
@@ -1692,6 +1707,16 @@ static void i830_update_wm(struct drm_crtc *unused_crtc)
&i830_wm_info,
dev_priv->display.get_fifo_size(dev, 0),
4, latency_ns);
+
+ /* For unknown reasons, i830 chipsets run havok
+ * on panning if the watermark is below 6,
+ * thus adjust it accordingly.
+ */
+ if (planea_wm < 6) {
+ planea_wm = 6;
+ DRM_DEBUG_KMS("i830 plane A wm workaround enabled\n");
+ }
+
fwater_lo = I915_READ(FW_BLC) & ~0xfff;
fwater_lo |= (3<<8) | planea_wm;
--
1.7.10.4