drm/i915: set watermarks for third pipe on IVB
authorJesse Barnes <jbarnes@virtuousgeek.org>
Wed, 12 Oct 2011 22:36:42 +0000 (15:36 -0700)
committerKeith Packard <keithp@keithp.com>
Fri, 21 Oct 2011 06:21:56 +0000 (23:21 -0700)
The watermark reg for the third pipe is in an unusual offset; add
support for it and set watermarks for 3 pipe configs.

Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Tested-By: Eugeni Dodonov <eugeni.dodonov@intel.com>
Reviewed-By: Eugeni Dodonov <eugeni.dodonov@intel.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
drivers/gpu/drm/i915/i915_reg.h
drivers/gpu/drm/i915/intel_display.c

index c7ef323d716e69d137f081bf14b239ddb3d7c137..5a09416e611f566774e18ad7095d3c007ea1876b 100644 (file)
 #define  WM0_PIPE_CURSOR_MASK  (0x1f)
 
 #define WM0_PIPEB_ILK          0x45104
+#define WM0_PIPEC_IVB          0x45200
 #define WM1_LP_ILK             0x45108
 #define  WM1_LP_SR_EN          (1<<31)
 #define  WM1_LP_LATENCY_SHIFT  24
index ad3a0187d306b364d6ee4e6e5ce151e53c1c7a69..064c65980a9ab21d59e6ac97719543a8fdbc9dbf 100644 (file)
@@ -4540,6 +4540,20 @@ static void sandybridge_update_wm(struct drm_device *dev)
                enabled |= 2;
        }
 
+       /* IVB has 3 pipes */
+       if (IS_IVYBRIDGE(dev) &&
+           g4x_compute_wm0(dev, 2,
+                           &sandybridge_display_wm_info, latency,
+                           &sandybridge_cursor_wm_info, latency,
+                           &plane_wm, &cursor_wm)) {
+               I915_WRITE(WM0_PIPEC_IVB,
+                          (plane_wm << WM0_PIPE_PLANE_SHIFT) | cursor_wm);
+               DRM_DEBUG_KMS("FIFO watermarks For pipe C -"
+                             " plane %d, cursor: %d\n",
+                             plane_wm, cursor_wm);
+               enabled |= 3;
+       }
+
        /*
         * Calculate and update the self-refresh watermark only when one
         * display plane is used.