diff options
author | Mika Kahola <mika.kahola@intel.com> | 2015-08-18 07:36:59 -0400 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2015-08-26 04:28:54 -0400 |
commit | adafdc6fcb66ea6541a88884ec522273f857c145 (patch) | |
tree | e24fcbf16ae67547137a4eeb8892d51c78a0871b /drivers/gpu/drm/i915/intel_display.c | |
parent | 65d64cc5bb7aee1f5a8d6717f4d421623c58ea30 (diff) |
drm/i915: Store max dotclock
Store max dotclock into dev_priv structure so we are able
to filter out the modes that are not supported by our
platforms.
V2:
- limit the max dot clock frequency to max CD clock frequency
for the gen9 and above
- limit the max dot clock frequency to 90% of the max CD clock
frequency for the older gens
- for Cherryview the max dot clock frequency is limited to 95%
of the max CD clock frequency
- for gen2 and gen3 the max dot clock limit is set to 90% of the
2X max CD clock frequency
V3:
- max_dotclk variable renamed as max_dotclk_freq in i915_drv.h
- in intel_compute_max_dotclk() the rounding method changed from
round up to round down when computing max dotclock
V4:
- Haswell and Broadwell supports now dot clocks up to max CD clock
frequency
Signed-off-by: Mika Kahola <mika.kahola@intel.com>
Reviewed-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 | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index 50cbc7e374cc..03e84ace8a09 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c | |||
@@ -5240,6 +5240,21 @@ static void modeset_update_crtc_power_domains(struct drm_atomic_state *state) | |||
5240 | modeset_put_power_domains(dev_priv, put_domains[i]); | 5240 | modeset_put_power_domains(dev_priv, put_domains[i]); |
5241 | } | 5241 | } |
5242 | 5242 | ||
5243 | static int intel_compute_max_dotclk(struct drm_i915_private *dev_priv) | ||
5244 | { | ||
5245 | int max_cdclk_freq = dev_priv->max_cdclk_freq; | ||
5246 | |||
5247 | if (INTEL_INFO(dev_priv)->gen >= 9 || | ||
5248 | IS_HASWELL(dev_priv) || IS_BROADWELL(dev_priv)) | ||
5249 | return max_cdclk_freq; | ||
5250 | else if (IS_CHERRYVIEW(dev_priv)) | ||
5251 | return max_cdclk_freq*95/100; | ||
5252 | else if (INTEL_INFO(dev_priv)->gen < 4) | ||
5253 | return 2*max_cdclk_freq*90/100; | ||
5254 | else | ||
5255 | return max_cdclk_freq*90/100; | ||
5256 | } | ||
5257 | |||
5243 | static void intel_update_max_cdclk(struct drm_device *dev) | 5258 | static void intel_update_max_cdclk(struct drm_device *dev) |
5244 | { | 5259 | { |
5245 | struct drm_i915_private *dev_priv = dev->dev_private; | 5260 | struct drm_i915_private *dev_priv = dev->dev_private; |
@@ -5279,8 +5294,13 @@ static void intel_update_max_cdclk(struct drm_device *dev) | |||
5279 | dev_priv->max_cdclk_freq = dev_priv->cdclk_freq; | 5294 | dev_priv->max_cdclk_freq = dev_priv->cdclk_freq; |
5280 | } | 5295 | } |
5281 | 5296 | ||
5297 | dev_priv->max_dotclk_freq = intel_compute_max_dotclk(dev_priv); | ||
5298 | |||
5282 | DRM_DEBUG_DRIVER("Max CD clock rate: %d kHz\n", | 5299 | DRM_DEBUG_DRIVER("Max CD clock rate: %d kHz\n", |
5283 | dev_priv->max_cdclk_freq); | 5300 | dev_priv->max_cdclk_freq); |
5301 | |||
5302 | DRM_DEBUG_DRIVER("Max dotclock rate: %d kHz\n", | ||
5303 | dev_priv->max_dotclk_freq); | ||
5284 | } | 5304 | } |
5285 | 5305 | ||
5286 | static void intel_update_cdclk(struct drm_device *dev) | 5306 | static void intel_update_cdclk(struct drm_device *dev) |