diff options
author | Ville Syrjälä <ville.syrjala@linux.intel.com> | 2015-10-30 17:39:38 -0400 |
---|---|---|
committer | Ville Syrjälä <ville.syrjala@linux.intel.com> | 2015-11-09 13:02:42 -0500 |
commit | 39acb4aa1aa6a30647cbe402e3f817b2b87feb1e (patch) | |
tree | 744c58a254406535b3e1e9b6d7e25bb1e9c170b0 /drivers/gpu/drm/i915/intel_display.c | |
parent | 44eb0cb9620c6a53ec8e7073262e2af8079b727f (diff) |
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: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1446241178-432-1-git-send-email-ville.syrjala@linux.intel.com
Reviewed-by: Ander Conselvan de Oliveira <conselvan2@gmail.com>
Diffstat (limited to 'drivers/gpu/drm/i915/intel_display.c')
-rw-r--r-- | drivers/gpu/drm/i915/intel_display.c | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index 5a938ffd2ded..0368a315ebbf 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c | |||
@@ -6552,6 +6552,15 @@ static void hsw_compute_ips_config(struct intel_crtc *crtc, | |||
6552 | pipe_config_supports_ips(dev_priv, pipe_config); | 6552 | pipe_config_supports_ips(dev_priv, pipe_config); |
6553 | } | 6553 | } |
6554 | 6554 | ||
6555 | static bool intel_crtc_supports_double_wide(const struct intel_crtc *crtc) | ||
6556 | { | ||
6557 | const struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); | ||
6558 | |||
6559 | /* GDG double wide on either pipe, otherwise pipe A only */ | ||
6560 | return INTEL_INFO(dev_priv)->gen < 4 && | ||
6561 | (crtc->pipe == PIPE_A || IS_I915G(dev_priv)); | ||
6562 | } | ||
6563 | |||
6555 | static int intel_crtc_compute_config(struct intel_crtc *crtc, | 6564 | static int intel_crtc_compute_config(struct intel_crtc *crtc, |
6556 | struct intel_crtc_state *pipe_config) | 6565 | struct intel_crtc_state *pipe_config) |
6557 | { | 6566 | { |
@@ -6561,23 +6570,24 @@ static int intel_crtc_compute_config(struct intel_crtc *crtc, | |||
6561 | 6570 | ||
6562 | /* FIXME should check pixel clock limits on all platforms */ | 6571 | /* FIXME should check pixel clock limits on all platforms */ |
6563 | if (INTEL_INFO(dev)->gen < 4) { | 6572 | if (INTEL_INFO(dev)->gen < 4) { |
6564 | int clock_limit = dev_priv->max_cdclk_freq; | 6573 | int clock_limit = dev_priv->max_cdclk_freq * 9 / 10; |
6565 | 6574 | ||
6566 | /* | 6575 | /* |
6567 | * Enable pixel doubling when the dot clock | 6576 | * Enable double wide mode when the dot clock |
6568 | * is > 90% of the (display) core speed. | 6577 | * is > 90% of the (display) core speed. |
6569 | * | ||
6570 | * GDG double wide on either pipe, | ||
6571 | * otherwise pipe A only. | ||
6572 | */ | 6578 | */ |
6573 | if ((crtc->pipe == PIPE_A || IS_I915G(dev)) && | 6579 | if (intel_crtc_supports_double_wide(crtc) && |
6574 | adjusted_mode->crtc_clock > clock_limit * 9 / 10) { | 6580 | adjusted_mode->crtc_clock > clock_limit) { |
6575 | clock_limit *= 2; | 6581 | clock_limit *= 2; |
6576 | pipe_config->double_wide = true; | 6582 | pipe_config->double_wide = true; |
6577 | } | 6583 | } |
6578 | 6584 | ||
6579 | if (adjusted_mode->crtc_clock > clock_limit * 9 / 10) | 6585 | if (adjusted_mode->crtc_clock > clock_limit) { |
6586 | DRM_DEBUG_KMS("requested pixel clock (%d kHz) too high (max: %d kHz, double wide: %s)\n", | ||
6587 | adjusted_mode->crtc_clock, clock_limit, | ||
6588 | yesno(pipe_config->double_wide)); | ||
6580 | return -EINVAL; | 6589 | return -EINVAL; |
6590 | } | ||
6581 | } | 6591 | } |
6582 | 6592 | ||
6583 | /* | 6593 | /* |