drm/i915: Kill fbc_enable from hsw_lp_wm_results
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Tue, 6 Aug 2013 19:24:03 +0000 (22:24 +0300)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Thu, 8 Aug 2013 12:04:53 +0000 (14:04 +0200)
We don't need to store the FBC WM enabled status in each watermark
level. We anyway have to reduce it down to a single boolean, so just
delay checking the FBC WM limit until we're computing the final
value.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/i915/intel_pm.c

index fe1992f2002bb9a31a64afa91b27bffd9792ec82..d5f0b4e1f1c45302e2a4dbd8e3b3be152d2d35d3 100644 (file)
@@ -2182,7 +2182,6 @@ struct hsw_wm_maximums {
 
 struct hsw_lp_wm_result {
        bool enable;
-       bool fbc_enable;
        uint32_t pri_val;
        uint32_t spr_val;
        uint32_t cur_val;
@@ -2324,13 +2323,6 @@ static bool hsw_compute_lp_wm(struct drm_i915_private *dev_priv,
        result->fbc_val = max3(res[0].fbc_val, res[1].fbc_val, res[2].fbc_val);
        result->enable = true;
 
-       if (result->fbc_val > max->fbc) {
-               result->fbc_enable = false;
-               result->fbc_val = 0;
-       } else {
-               result->fbc_enable = true;
-       }
-
        if (!result->enable)
                return false;
 
@@ -2575,9 +2567,9 @@ static void hsw_compute_wm_results(struct drm_device *dev,
         * a WM level. */
        results->enable_fbc_wm = true;
        for (level = 1; level <= max_level; level++) {
-               if (!lp_results[level - 1].fbc_enable) {
+               if (!lp_results[level - 1].fbc_val > lp_maximums->fbc) {
                        results->enable_fbc_wm = false;
-                       break;
+                       lp_results[level - 1].fbc_val = 0;
                }
        }