aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVille Syrjälä <ville.syrjala@linux.intel.com>2013-08-01 09:18:53 -0400
committerDaniel Vetter <daniel.vetter@ffwll.ch>2013-08-05 13:04:16 -0400
commit3312ba65caa23cf1210cc578755babc394769843 (patch)
tree4aa0125d3cb3290a272921673ed6b41d30f50149
parent26ec971e302c53b44cc5627ffe209a7d33199e28 (diff)
drm/i915: Disable specific watermark levels when latency is zero
Return UINT_MAX for the calculated WM level if the latency is zero. This will lead to marking the WM level as disabled. I'm not sure if latency==0 should mean that we want to disable the level. But that's the implication I got from the fact that we don't even enable the watermark code of the SSKDP register is 0. v2: Use WARN() to scare people Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
-rw-r--r--drivers/gpu/drm/i915/intel_pm.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
index 8358d73ae468..856c094a35e0 100644
--- a/drivers/gpu/drm/i915/intel_pm.c
+++ b/drivers/gpu/drm/i915/intel_pm.c
@@ -2131,6 +2131,9 @@ static uint32_t ilk_wm_method1(uint32_t pixel_rate, uint8_t bytes_per_pixel,
2131{ 2131{
2132 uint64_t ret; 2132 uint64_t ret;
2133 2133
2134 if (WARN(latency == 0, "Latency value missing\n"))
2135 return UINT_MAX;
2136
2134 ret = (uint64_t) pixel_rate * bytes_per_pixel * latency; 2137 ret = (uint64_t) pixel_rate * bytes_per_pixel * latency;
2135 ret = DIV_ROUND_UP_ULL(ret, 64 * 10000) + 2; 2138 ret = DIV_ROUND_UP_ULL(ret, 64 * 10000) + 2;
2136 2139
@@ -2143,6 +2146,9 @@ static uint32_t ilk_wm_method2(uint32_t pixel_rate, uint32_t pipe_htotal,
2143{ 2146{
2144 uint32_t ret; 2147 uint32_t ret;
2145 2148
2149 if (WARN(latency == 0, "Latency value missing\n"))
2150 return UINT_MAX;
2151
2146 ret = (latency * pixel_rate) / (pipe_htotal * 10000); 2152 ret = (latency * pixel_rate) / (pipe_htotal * 10000);
2147 ret = (ret + 1) * horiz_pixels * bytes_per_pixel; 2153 ret = (ret + 1) * horiz_pixels * bytes_per_pixel;
2148 ret = DIV_ROUND_UP(ret, 64) + 2; 2154 ret = DIV_ROUND_UP(ret, 64) + 2;