diff options
author | Ville Syrjälä <ville.syrjala@linux.intel.com> | 2013-09-04 11:30:04 -0400 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2013-09-17 04:02:22 -0400 |
commit | ad3a44799510e778a6b4bf7999618634bdd6615d (patch) | |
tree | defcdf6e4cb6420ee803a832b454fc4cde32dc6b /drivers/gpu/drm/i915/intel_display.c | |
parent | 282740f73a93461645bb87cd62e428aa625619fb (diff) |
drm/i915: Check pixel clock limits on pre-gen4
We don't want to try to push the hardware beyond it's capabilities,
so check the pixel clock against the display core clock limit. Do
it for pre-gen4 for now since that's where we alread have the double
wide pixel clock limit check.
Let's assume that when double wide mode is enabled the max
pixel clock limit is also doubled.
FIXME: panel fitter downscaling probably affects the limit on
non-pch platforms too, so we'd need another version of
ilk_pipe_pixel_rate() to figure that out.
FIXME: should check the limits on all platforms. Also sprites
affect the max allowed pixel rate on some platforms, so we need
to eventually tie all the planes and pipes into one check in
the future. But we need plane state pre-compute before that can
happen.
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/i915/intel_display.c')
-rw-r--r-- | drivers/gpu/drm/i915/intel_display.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index d01a800f8a36..91631bf354e6 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c | |||
@@ -4143,6 +4143,7 @@ static int intel_crtc_compute_config(struct intel_crtc *crtc, | |||
4143 | struct drm_device *dev = crtc->base.dev; | 4143 | struct drm_device *dev = crtc->base.dev; |
4144 | struct drm_display_mode *adjusted_mode = &pipe_config->adjusted_mode; | 4144 | struct drm_display_mode *adjusted_mode = &pipe_config->adjusted_mode; |
4145 | 4145 | ||
4146 | /* FIXME should check pixel clock limits on all platforms */ | ||
4146 | if (INTEL_INFO(dev)->gen < 4) { | 4147 | if (INTEL_INFO(dev)->gen < 4) { |
4147 | struct drm_i915_private *dev_priv = dev->dev_private; | 4148 | struct drm_i915_private *dev_priv = dev->dev_private; |
4148 | int clock_limit = | 4149 | int clock_limit = |
@@ -4156,8 +4157,13 @@ static int intel_crtc_compute_config(struct intel_crtc *crtc, | |||
4156 | * the only reason for the pipe == PIPE_A check? | 4157 | * the only reason for the pipe == PIPE_A check? |
4157 | */ | 4158 | */ |
4158 | if (crtc->pipe == PIPE_A && | 4159 | if (crtc->pipe == PIPE_A && |
4159 | adjusted_mode->clock > clock_limit * 9 / 10) | 4160 | adjusted_mode->clock > clock_limit * 9 / 10) { |
4161 | clock_limit *= 2; | ||
4160 | pipe_config->double_wide = true; | 4162 | pipe_config->double_wide = true; |
4163 | } | ||
4164 | |||
4165 | if (adjusted_mode->clock > clock_limit * 9 / 10) | ||
4166 | return -EINVAL; | ||
4161 | } | 4167 | } |
4162 | 4168 | ||
4163 | /* Cantiga+ cannot handle modes with a hsync front porch of 0. | 4169 | /* Cantiga+ cannot handle modes with a hsync front porch of 0. |