+static bool pipe_config_supports_ips(struct drm_i915_private *dev_priv,
+ struct intel_crtc_state *pipe_config)
+{
+ if (pipe_config->pipe_bpp > 24)
+ return false;
+
+ /* HSW can handle pixel rate up to cdclk? */
+ if (IS_HASWELL(dev_priv->dev))
+ return true;
+
+ /*
+ * FIXME if we compare against max we should then
+ * increase the cdclk frequency when the current
+ * value is too low. The other option is to compare
+ * against the cdclk frequency we're going have post
+ * modeset (ie. one we computed using other constraints).
+ * Need to measure whether using a lower cdclk w/o IPS
+ * is better or worse than a higher cdclk w/ IPS.
+ */
+ return ilk_pipe_pixel_rate(pipe_config) <=
+ dev_priv->max_cdclk_freq * 95 / 100;
+}
+