diff options
author | Ville Syrjälä <ville.syrjala@linux.intel.com> | 2014-08-14 18:21:53 -0400 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2014-09-03 05:05:02 -0400 |
commit | 9d53910580512207186729c94b39cca9a9778c13 (patch) | |
tree | f634c8f769696faae1601b07dd290dc900622240 | |
parent | d1d70677e165826f3fa9966e1b7ec3765d7c0fb7 (diff) |
drm/i915: Fix gen2 planes B and C max watermark value
The max watermark value for gen2 planes B and C is 0x1f, instead of
the 0x3f that plane A uses.
Also check against the max even if the pipe is disabled since the
FIFO size exceeds the plane B and C max watermark value.
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Tested-by: Thomas Richter <richter@rus.uni-stuttgart.de>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
-rw-r--r-- | drivers/gpu/drm/i915/intel_pm.c | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c index 376cc2c8751a..38b61e4d17ae 100644 --- a/drivers/gpu/drm/i915/intel_pm.c +++ b/drivers/gpu/drm/i915/intel_pm.c | |||
@@ -1001,13 +1001,20 @@ static const struct intel_watermark_params i915_wm_info = { | |||
1001 | .guard_size = 2, | 1001 | .guard_size = 2, |
1002 | .cacheline_size = I915_FIFO_LINE_SIZE, | 1002 | .cacheline_size = I915_FIFO_LINE_SIZE, |
1003 | }; | 1003 | }; |
1004 | static const struct intel_watermark_params i830_wm_info = { | 1004 | static const struct intel_watermark_params i830_a_wm_info = { |
1005 | .fifo_size = I855GM_FIFO_SIZE, | 1005 | .fifo_size = I855GM_FIFO_SIZE, |
1006 | .max_wm = I915_MAX_WM, | 1006 | .max_wm = I915_MAX_WM, |
1007 | .default_wm = 1, | 1007 | .default_wm = 1, |
1008 | .guard_size = 2, | 1008 | .guard_size = 2, |
1009 | .cacheline_size = I830_FIFO_LINE_SIZE, | 1009 | .cacheline_size = I830_FIFO_LINE_SIZE, |
1010 | }; | 1010 | }; |
1011 | static const struct intel_watermark_params i830_bc_wm_info = { | ||
1012 | .fifo_size = I855GM_FIFO_SIZE, | ||
1013 | .max_wm = I915_MAX_WM/2, | ||
1014 | .default_wm = 1, | ||
1015 | .guard_size = 2, | ||
1016 | .cacheline_size = I830_FIFO_LINE_SIZE, | ||
1017 | }; | ||
1011 | static const struct intel_watermark_params i845_wm_info = { | 1018 | static const struct intel_watermark_params i845_wm_info = { |
1012 | .fifo_size = I830_FIFO_SIZE, | 1019 | .fifo_size = I830_FIFO_SIZE, |
1013 | .max_wm = I915_MAX_WM, | 1020 | .max_wm = I915_MAX_WM, |
@@ -1689,7 +1696,7 @@ static void i9xx_update_wm(struct drm_crtc *unused_crtc) | |||
1689 | else if (!IS_GEN2(dev)) | 1696 | else if (!IS_GEN2(dev)) |
1690 | wm_info = &i915_wm_info; | 1697 | wm_info = &i915_wm_info; |
1691 | else | 1698 | else |
1692 | wm_info = &i830_wm_info; | 1699 | wm_info = &i830_a_wm_info; |
1693 | 1700 | ||
1694 | fifo_size = dev_priv->display.get_fifo_size(dev, 0); | 1701 | fifo_size = dev_priv->display.get_fifo_size(dev, 0); |
1695 | crtc = intel_get_crtc_for_plane(dev, 0); | 1702 | crtc = intel_get_crtc_for_plane(dev, 0); |
@@ -1704,8 +1711,14 @@ static void i9xx_update_wm(struct drm_crtc *unused_crtc) | |||
1704 | wm_info, fifo_size, cpp, | 1711 | wm_info, fifo_size, cpp, |
1705 | latency_ns); | 1712 | latency_ns); |
1706 | enabled = crtc; | 1713 | enabled = crtc; |
1707 | } else | 1714 | } else { |
1708 | planea_wm = fifo_size - wm_info->guard_size; | 1715 | planea_wm = fifo_size - wm_info->guard_size; |
1716 | if (planea_wm > (long)wm_info->max_wm) | ||
1717 | planea_wm = wm_info->max_wm; | ||
1718 | } | ||
1719 | |||
1720 | if (IS_GEN2(dev)) | ||
1721 | wm_info = &i830_bc_wm_info; | ||
1709 | 1722 | ||
1710 | fifo_size = dev_priv->display.get_fifo_size(dev, 1); | 1723 | fifo_size = dev_priv->display.get_fifo_size(dev, 1); |
1711 | crtc = intel_get_crtc_for_plane(dev, 1); | 1724 | crtc = intel_get_crtc_for_plane(dev, 1); |
@@ -1723,8 +1736,11 @@ static void i9xx_update_wm(struct drm_crtc *unused_crtc) | |||
1723 | enabled = crtc; | 1736 | enabled = crtc; |
1724 | else | 1737 | else |
1725 | enabled = NULL; | 1738 | enabled = NULL; |
1726 | } else | 1739 | } else { |
1727 | planeb_wm = fifo_size - wm_info->guard_size; | 1740 | planeb_wm = fifo_size - wm_info->guard_size; |
1741 | if (planeb_wm > (long)wm_info->max_wm) | ||
1742 | planeb_wm = wm_info->max_wm; | ||
1743 | } | ||
1728 | 1744 | ||
1729 | DRM_DEBUG_KMS("FIFO watermarks - A: %d, B: %d\n", planea_wm, planeb_wm); | 1745 | DRM_DEBUG_KMS("FIFO watermarks - A: %d, B: %d\n", planea_wm, planeb_wm); |
1730 | 1746 | ||