aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/intel_pm.c
diff options
context:
space:
mode:
authorPaulo Zanoni <paulo.r.zanoni@intel.com>2013-05-03 16:23:43 -0400
committerDaniel Vetter <daniel.vetter@ffwll.ch>2013-05-21 05:58:20 -0400
commit85a02deb4ca5a7e1e39e8538b6eb3c7066469720 (patch)
tree884ec125b939b7b4a693a203e43670e70ff9dc38 /drivers/gpu/drm/i915/intel_pm.c
parentb2b877ffe37d699f77f45e993590b66010491c52 (diff)
drm/i915: set the IPS linetime watermark
Remove the "placeholder" comment and set the actual value described by the specification. We still don't enable IPS, but it won't hurt to already have the value set here. While at it, fully set the register value instead of just masking the values we're changing. Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com> [danvet: Resolve conflict due to reordered patches.] Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/i915/intel_pm.c')
-rw-r--r--drivers/gpu/drm/i915/intel_pm.c22
1 files changed, 7 insertions, 15 deletions
diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
index 2c406ddc6354..ad1d35526a8f 100644
--- a/drivers/gpu/drm/i915/intel_pm.c
+++ b/drivers/gpu/drm/i915/intel_pm.c
@@ -2079,31 +2079,23 @@ haswell_update_linetime_wm(struct drm_device *dev, struct drm_crtc *crtc)
2079 struct intel_crtc *intel_crtc = to_intel_crtc(crtc); 2079 struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
2080 enum pipe pipe = intel_crtc->pipe; 2080 enum pipe pipe = intel_crtc->pipe;
2081 struct drm_display_mode *mode = &intel_crtc->config.adjusted_mode; 2081 struct drm_display_mode *mode = &intel_crtc->config.adjusted_mode;
2082 u32 temp; 2082 u32 linetime, ips_linetime;
2083 2083
2084 if (!intel_crtc_active(crtc)) { 2084 if (!intel_crtc_active(crtc)) {
2085 I915_WRITE(PIPE_WM_LINETIME(pipe), 0); 2085 I915_WRITE(PIPE_WM_LINETIME(pipe), 0);
2086 return; 2086 return;
2087 } 2087 }
2088 2088
2089 temp = I915_READ(PIPE_WM_LINETIME(pipe));
2090 temp &= ~PIPE_WM_LINETIME_MASK;
2091
2092 /* The WM are computed with base on how long it takes to fill a single 2089 /* The WM are computed with base on how long it takes to fill a single
2093 * row at the given clock rate, multiplied by 8. 2090 * row at the given clock rate, multiplied by 8.
2094 * */ 2091 * */
2095 temp |= PIPE_WM_LINETIME_TIME( 2092 linetime = DIV_ROUND_CLOSEST(mode->htotal * 1000 * 8, mode->clock);
2096 DIV_ROUND_CLOSEST(mode->htotal * 1000 * 8, mode->clock)); 2093 ips_linetime = DIV_ROUND_CLOSEST(mode->htotal * 1000 * 8,
2097 2094 intel_ddi_get_cdclk_freq(dev_priv));
2098 /* IPS watermarks are only used by pipe A, and are ignored by
2099 * pipes B and C. They are calculated similarly to the common
2100 * linetime values, except that we are using CD clock frequency
2101 * in MHz instead of pixel rate for the division.
2102 *
2103 * This is a placeholder for the IPS watermark calculation code.
2104 */
2105 2095
2106 I915_WRITE(PIPE_WM_LINETIME(pipe), temp); 2096 I915_WRITE(PIPE_WM_LINETIME(pipe),
2097 PIPE_WM_LINETIME_IPS_LINETIME(ips_linetime) |
2098 PIPE_WM_LINETIME_TIME(linetime));
2107} 2099}
2108 2100
2109static void haswell_update_wm(struct drm_device *dev) 2101static void haswell_update_wm(struct drm_device *dev)