提交 39acb4aa 编写于 作者: V Ville Syrjälä

drm/i915: Print a debug message when exceeding dotclock limit on pre-gen4

Currently there's no trace in dmesg when the gen2/3 dotclock checks
reject the modeset. Add some to avoid further head scratching.

While at it refactor the code a bit to look nicer.
Signed-off-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1446241178-432-1-git-send-email-ville.syrjala@linux.intel.comReviewed-by: NAnder Conselvan de Oliveira <conselvan2@gmail.com>
上级 44eb0cb9
...@@ -6552,6 +6552,15 @@ static void hsw_compute_ips_config(struct intel_crtc *crtc, ...@@ -6552,6 +6552,15 @@ static void hsw_compute_ips_config(struct intel_crtc *crtc,
pipe_config_supports_ips(dev_priv, pipe_config); pipe_config_supports_ips(dev_priv, pipe_config);
} }
static bool intel_crtc_supports_double_wide(const struct intel_crtc *crtc)
{
const struct drm_i915_private *dev_priv = to_i915(crtc->base.dev);
/* GDG double wide on either pipe, otherwise pipe A only */
return INTEL_INFO(dev_priv)->gen < 4 &&
(crtc->pipe == PIPE_A || IS_I915G(dev_priv));
}
static int intel_crtc_compute_config(struct intel_crtc *crtc, static int intel_crtc_compute_config(struct intel_crtc *crtc,
struct intel_crtc_state *pipe_config) struct intel_crtc_state *pipe_config)
{ {
...@@ -6561,23 +6570,24 @@ static int intel_crtc_compute_config(struct intel_crtc *crtc, ...@@ -6561,23 +6570,24 @@ static int intel_crtc_compute_config(struct intel_crtc *crtc,
/* FIXME should check pixel clock limits on all platforms */ /* FIXME should check pixel clock limits on all platforms */
if (INTEL_INFO(dev)->gen < 4) { if (INTEL_INFO(dev)->gen < 4) {
int clock_limit = dev_priv->max_cdclk_freq; int clock_limit = dev_priv->max_cdclk_freq * 9 / 10;
/* /*
* Enable pixel doubling when the dot clock * Enable double wide mode when the dot clock
* is > 90% of the (display) core speed. * is > 90% of the (display) core speed.
*
* GDG double wide on either pipe,
* otherwise pipe A only.
*/ */
if ((crtc->pipe == PIPE_A || IS_I915G(dev)) && if (intel_crtc_supports_double_wide(crtc) &&
adjusted_mode->crtc_clock > clock_limit * 9 / 10) { adjusted_mode->crtc_clock > clock_limit) {
clock_limit *= 2; clock_limit *= 2;
pipe_config->double_wide = true; pipe_config->double_wide = true;
} }
if (adjusted_mode->crtc_clock > clock_limit * 9 / 10) if (adjusted_mode->crtc_clock > clock_limit) {
DRM_DEBUG_KMS("requested pixel clock (%d kHz) too high (max: %d kHz, double wide: %s)\n",
adjusted_mode->crtc_clock, clock_limit,
yesno(pipe_config->double_wide));
return -EINVAL; return -EINVAL;
}
} }
/* /*
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册