aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2013-06-03 16:40:22 -0400
committerDaniel Vetter <daniel.vetter@ffwll.ch>2013-06-04 07:56:28 -0400
commitee9300bb5fa423117585a57c6a158522d2298b4e (patch)
tree547e226f24512b9ee24902397b6b221b67023968 /drivers
parentac58c3f046dde3c29b0e3fc7ea71a82b5f80c470 (diff)
drm/i915: move find_pll callback to dev_priv->display
Now that the DP madness is cleared out, this is all only per-platform. So move it out from the intel clock limits structure. While at it drop the intel prefix on the static functions, call the vtable entry find_dpll (since it's for the display pll) and rip out the now unnecessary forward declarations. Note that the parameters of ->find_dpll are still unchanged, but they eventually need to be moved over to just take in a pipe configuration. But currently a lot of things are still missing from the pipe configuration (reflock, output-specific dpll limits and preferences, downclocked dotclock). So this will happen in a later step. Note that intel_g4x_limit has a peculiar case where it selects intel_limits_i9xx_sdvo as the limit. This is pretty bogus and also not used since the only output types left are DP and native TV-out which both use special pre-tuned dpll values. v2: Re-add comment for the find_pll callback (requested by Paulo) and elaborate on why the transformation is correct for g4x platforms (to clarify a review question from Paulo). Double up on that by adding a WARN as suggested by Paulo Zanoni on irc. v3: Initialize limits to NULL since gcc is now unhappy. v4: v2/3 will blow up with a NULL dereference in ->find_dpll for dp and TV-out ports, spotted by Paulo on irc. So just give up on this madness for now, and leave this to be fixed in a later patch. v5: Since the ever-so-slight change for g4x might result in some dpll parameter computation failing spuriously where before it didn't for ports with preset dpll settings (DP & TV-out) override this. For paranoia also do it in the ilk+ code. Cc: Paulo Zanoni <przanoni@gmail.com> Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpu/drm/i915/i915_drv.h20
-rw-r--r--drivers/gpu/drm/i915/intel_display.c110
2 files changed, 53 insertions, 77 deletions
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index 9d86ce578384..215aa63e3f47 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -306,6 +306,8 @@ struct drm_i915_error_state {
306 306
307struct intel_crtc_config; 307struct intel_crtc_config;
308struct intel_crtc; 308struct intel_crtc;
309struct intel_limit;
310struct dpll;
309 311
310struct drm_i915_display_funcs { 312struct drm_i915_display_funcs {
311 bool (*fbc_enabled)(struct drm_device *dev); 313 bool (*fbc_enabled)(struct drm_device *dev);
@@ -313,6 +315,24 @@ struct drm_i915_display_funcs {
313 void (*disable_fbc)(struct drm_device *dev); 315 void (*disable_fbc)(struct drm_device *dev);
314 int (*get_display_clock_speed)(struct drm_device *dev); 316 int (*get_display_clock_speed)(struct drm_device *dev);
315 int (*get_fifo_size)(struct drm_device *dev, int plane); 317 int (*get_fifo_size)(struct drm_device *dev, int plane);
318 /**
319 * find_dpll() - Find the best values for the PLL
320 * @limit: limits for the PLL
321 * @crtc: current CRTC
322 * @target: target frequency in kHz
323 * @refclk: reference clock frequency in kHz
324 * @match_clock: if provided, @best_clock P divider must
325 * match the P divider from @match_clock
326 * used for LVDS downclocking
327 * @best_clock: best PLL values found
328 *
329 * Returns true on success, false on failure.
330 */
331 bool (*find_dpll)(const struct intel_limit *limit,
332 struct drm_crtc *crtc,
333 int target, int refclk,
334 struct dpll *match_clock,
335 struct dpll *best_clock);
316 void (*update_wm)(struct drm_device *dev); 336 void (*update_wm)(struct drm_device *dev);
317 void (*update_sprite_wm)(struct drm_device *dev, int pipe, 337 void (*update_sprite_wm)(struct drm_device *dev, int pipe,
318 uint32_t sprite_width, int pixel_size, 338 uint32_t sprite_width, int pixel_size,
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 5d22abe19b1f..537b8a44107d 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -59,24 +59,6 @@ typedef struct intel_limit intel_limit_t;
59struct intel_limit { 59struct intel_limit {
60 intel_range_t dot, vco, n, m, m1, m2, p, p1; 60 intel_range_t dot, vco, n, m, m1, m2, p, p1;
61 intel_p2_t p2; 61 intel_p2_t p2;
62 /**
63 * find_pll() - Find the best values for the PLL
64 * @limit: limits for the PLL
65 * @crtc: current CRTC
66 * @target: target frequency in kHz
67 * @refclk: reference clock frequency in kHz
68 * @match_clock: if provided, @best_clock P divider must
69 * match the P divider from @match_clock
70 * used for LVDS downclocking
71 * @best_clock: best PLL values found
72 *
73 * Returns true on success, false on failure.
74 */
75 bool (*find_pll)(const intel_limit_t *limit,
76 struct drm_crtc *crtc,
77 int target, int refclk,
78 intel_clock_t *match_clock,
79 intel_clock_t *best_clock);
80}; 62};
81 63
82/* FDI */ 64/* FDI */
@@ -92,23 +74,6 @@ intel_pch_rawclk(struct drm_device *dev)
92 return I915_READ(PCH_RAWCLK_FREQ) & RAWCLK_FREQ_MASK; 74 return I915_READ(PCH_RAWCLK_FREQ) & RAWCLK_FREQ_MASK;
93} 75}
94 76
95static bool
96intel_find_best_PLL(const intel_limit_t *limit, struct drm_crtc *crtc,
97 int target, int refclk, intel_clock_t *match_clock,
98 intel_clock_t *best_clock);
99static bool
100intel_pnv_find_best_PLL(const intel_limit_t *limit, struct drm_crtc *crtc,
101 int target, int refclk, intel_clock_t *match_clock,
102 intel_clock_t *best_clock);
103static bool
104intel_g4x_find_best_PLL(const intel_limit_t *limit, struct drm_crtc *crtc,
105 int target, int refclk, intel_clock_t *match_clock,
106 intel_clock_t *best_clock);
107static bool
108intel_vlv_find_best_pll(const intel_limit_t *limit, struct drm_crtc *crtc,
109 int target, int refclk, intel_clock_t *match_clock,
110 intel_clock_t *best_clock);
111
112static inline u32 /* units of 100MHz */ 77static inline u32 /* units of 100MHz */
113intel_fdi_link_freq(struct drm_device *dev) 78intel_fdi_link_freq(struct drm_device *dev)
114{ 79{
@@ -130,7 +95,6 @@ static const intel_limit_t intel_limits_i8xx_dvo = {
130 .p1 = { .min = 2, .max = 33 }, 95 .p1 = { .min = 2, .max = 33 },
131 .p2 = { .dot_limit = 165000, 96 .p2 = { .dot_limit = 165000,
132 .p2_slow = 4, .p2_fast = 2 }, 97 .p2_slow = 4, .p2_fast = 2 },
133 .find_pll = intel_find_best_PLL,
134}; 98};
135 99
136static const intel_limit_t intel_limits_i8xx_lvds = { 100static const intel_limit_t intel_limits_i8xx_lvds = {
@@ -144,7 +108,6 @@ static const intel_limit_t intel_limits_i8xx_lvds = {
144 .p1 = { .min = 1, .max = 6 }, 108 .p1 = { .min = 1, .max = 6 },
145 .p2 = { .dot_limit = 165000, 109 .p2 = { .dot_limit = 165000,
146 .p2_slow = 14, .p2_fast = 7 }, 110 .p2_slow = 14, .p2_fast = 7 },
147 .find_pll = intel_find_best_PLL,
148}; 111};
149 112
150static const intel_limit_t intel_limits_i9xx_sdvo = { 113static const intel_limit_t intel_limits_i9xx_sdvo = {
@@ -158,7 +121,6 @@ static const intel_limit_t intel_limits_i9xx_sdvo = {
158 .p1 = { .min = 1, .max = 8 }, 121 .p1 = { .min = 1, .max = 8 },
159 .p2 = { .dot_limit = 200000, 122 .p2 = { .dot_limit = 200000,
160 .p2_slow = 10, .p2_fast = 5 }, 123 .p2_slow = 10, .p2_fast = 5 },
161 .find_pll = intel_find_best_PLL,
162}; 124};
163 125
164static const intel_limit_t intel_limits_i9xx_lvds = { 126static const intel_limit_t intel_limits_i9xx_lvds = {
@@ -172,7 +134,6 @@ static const intel_limit_t intel_limits_i9xx_lvds = {
172 .p1 = { .min = 1, .max = 8 }, 134 .p1 = { .min = 1, .max = 8 },
173 .p2 = { .dot_limit = 112000, 135 .p2 = { .dot_limit = 112000,
174 .p2_slow = 14, .p2_fast = 7 }, 136 .p2_slow = 14, .p2_fast = 7 },
175 .find_pll = intel_find_best_PLL,
176}; 137};
177 138
178 139
@@ -189,7 +150,6 @@ static const intel_limit_t intel_limits_g4x_sdvo = {
189 .p2_slow = 10, 150 .p2_slow = 10,
190 .p2_fast = 10 151 .p2_fast = 10
191 }, 152 },
192 .find_pll = intel_g4x_find_best_PLL,
193}; 153};
194 154
195static const intel_limit_t intel_limits_g4x_hdmi = { 155static const intel_limit_t intel_limits_g4x_hdmi = {
@@ -203,7 +163,6 @@ static const intel_limit_t intel_limits_g4x_hdmi = {
203 .p1 = { .min = 1, .max = 8}, 163 .p1 = { .min = 1, .max = 8},
204 .p2 = { .dot_limit = 165000, 164 .p2 = { .dot_limit = 165000,
205 .p2_slow = 10, .p2_fast = 5 }, 165 .p2_slow = 10, .p2_fast = 5 },
206 .find_pll = intel_g4x_find_best_PLL,
207}; 166};
208 167
209static const intel_limit_t intel_limits_g4x_single_channel_lvds = { 168static const intel_limit_t intel_limits_g4x_single_channel_lvds = {
@@ -218,7 +177,6 @@ static const intel_limit_t intel_limits_g4x_single_channel_lvds = {
218 .p2 = { .dot_limit = 0, 177 .p2 = { .dot_limit = 0,
219 .p2_slow = 14, .p2_fast = 14 178 .p2_slow = 14, .p2_fast = 14
220 }, 179 },
221 .find_pll = intel_g4x_find_best_PLL,
222}; 180};
223 181
224static const intel_limit_t intel_limits_g4x_dual_channel_lvds = { 182static const intel_limit_t intel_limits_g4x_dual_channel_lvds = {
@@ -233,7 +191,6 @@ static const intel_limit_t intel_limits_g4x_dual_channel_lvds = {
233 .p2 = { .dot_limit = 0, 191 .p2 = { .dot_limit = 0,
234 .p2_slow = 7, .p2_fast = 7 192 .p2_slow = 7, .p2_fast = 7
235 }, 193 },
236 .find_pll = intel_g4x_find_best_PLL,
237}; 194};
238 195
239static const intel_limit_t intel_limits_pineview_sdvo = { 196static const intel_limit_t intel_limits_pineview_sdvo = {
@@ -249,7 +206,6 @@ static const intel_limit_t intel_limits_pineview_sdvo = {
249 .p1 = { .min = 1, .max = 8 }, 206 .p1 = { .min = 1, .max = 8 },
250 .p2 = { .dot_limit = 200000, 207 .p2 = { .dot_limit = 200000,
251 .p2_slow = 10, .p2_fast = 5 }, 208 .p2_slow = 10, .p2_fast = 5 },
252 .find_pll = intel_pnv_find_best_PLL,
253}; 209};
254 210
255static const intel_limit_t intel_limits_pineview_lvds = { 211static const intel_limit_t intel_limits_pineview_lvds = {
@@ -263,7 +219,6 @@ static const intel_limit_t intel_limits_pineview_lvds = {
263 .p1 = { .min = 1, .max = 8 }, 219 .p1 = { .min = 1, .max = 8 },
264 .p2 = { .dot_limit = 112000, 220 .p2 = { .dot_limit = 112000,
265 .p2_slow = 14, .p2_fast = 14 }, 221 .p2_slow = 14, .p2_fast = 14 },
266 .find_pll = intel_pnv_find_best_PLL,
267}; 222};
268 223
269/* Ironlake / Sandybridge 224/* Ironlake / Sandybridge
@@ -282,7 +237,6 @@ static const intel_limit_t intel_limits_ironlake_dac = {
282 .p1 = { .min = 1, .max = 8 }, 237 .p1 = { .min = 1, .max = 8 },
283 .p2 = { .dot_limit = 225000, 238 .p2 = { .dot_limit = 225000,
284 .p2_slow = 10, .p2_fast = 5 }, 239 .p2_slow = 10, .p2_fast = 5 },
285 .find_pll = intel_g4x_find_best_PLL,
286}; 240};
287 241
288static const intel_limit_t intel_limits_ironlake_single_lvds = { 242static const intel_limit_t intel_limits_ironlake_single_lvds = {
@@ -296,7 +250,6 @@ static const intel_limit_t intel_limits_ironlake_single_lvds = {
296 .p1 = { .min = 2, .max = 8 }, 250 .p1 = { .min = 2, .max = 8 },
297 .p2 = { .dot_limit = 225000, 251 .p2 = { .dot_limit = 225000,
298 .p2_slow = 14, .p2_fast = 14 }, 252 .p2_slow = 14, .p2_fast = 14 },
299 .find_pll = intel_g4x_find_best_PLL,
300}; 253};
301 254
302static const intel_limit_t intel_limits_ironlake_dual_lvds = { 255static const intel_limit_t intel_limits_ironlake_dual_lvds = {
@@ -310,7 +263,6 @@ static const intel_limit_t intel_limits_ironlake_dual_lvds = {
310 .p1 = { .min = 2, .max = 8 }, 263 .p1 = { .min = 2, .max = 8 },
311 .p2 = { .dot_limit = 225000, 264 .p2 = { .dot_limit = 225000,
312 .p2_slow = 7, .p2_fast = 7 }, 265 .p2_slow = 7, .p2_fast = 7 },
313 .find_pll = intel_g4x_find_best_PLL,
314}; 266};
315 267
316/* LVDS 100mhz refclk limits. */ 268/* LVDS 100mhz refclk limits. */
@@ -325,7 +277,6 @@ static const intel_limit_t intel_limits_ironlake_single_lvds_100m = {
325 .p1 = { .min = 2, .max = 8 }, 277 .p1 = { .min = 2, .max = 8 },
326 .p2 = { .dot_limit = 225000, 278 .p2 = { .dot_limit = 225000,
327 .p2_slow = 14, .p2_fast = 14 }, 279 .p2_slow = 14, .p2_fast = 14 },
328 .find_pll = intel_g4x_find_best_PLL,
329}; 280};
330 281
331static const intel_limit_t intel_limits_ironlake_dual_lvds_100m = { 282static const intel_limit_t intel_limits_ironlake_dual_lvds_100m = {
@@ -339,7 +290,6 @@ static const intel_limit_t intel_limits_ironlake_dual_lvds_100m = {
339 .p1 = { .min = 2, .max = 6 }, 290 .p1 = { .min = 2, .max = 6 },
340 .p2 = { .dot_limit = 225000, 291 .p2 = { .dot_limit = 225000,
341 .p2_slow = 7, .p2_fast = 7 }, 292 .p2_slow = 7, .p2_fast = 7 },
342 .find_pll = intel_g4x_find_best_PLL,
343}; 293};
344 294
345static const intel_limit_t intel_limits_vlv_dac = { 295static const intel_limit_t intel_limits_vlv_dac = {
@@ -353,7 +303,6 @@ static const intel_limit_t intel_limits_vlv_dac = {
353 .p1 = { .min = 1, .max = 3 }, 303 .p1 = { .min = 1, .max = 3 },
354 .p2 = { .dot_limit = 270000, 304 .p2 = { .dot_limit = 270000,
355 .p2_slow = 2, .p2_fast = 20 }, 305 .p2_slow = 2, .p2_fast = 20 },
356 .find_pll = intel_vlv_find_best_pll,
357}; 306};
358 307
359static const intel_limit_t intel_limits_vlv_hdmi = { 308static const intel_limit_t intel_limits_vlv_hdmi = {
@@ -367,7 +316,6 @@ static const intel_limit_t intel_limits_vlv_hdmi = {
367 .p1 = { .min = 2, .max = 3 }, 316 .p1 = { .min = 2, .max = 3 },
368 .p2 = { .dot_limit = 270000, 317 .p2 = { .dot_limit = 270000,
369 .p2_slow = 2, .p2_fast = 20 }, 318 .p2_slow = 2, .p2_fast = 20 },
370 .find_pll = intel_vlv_find_best_pll,
371}; 319};
372 320
373static const intel_limit_t intel_limits_vlv_dp = { 321static const intel_limit_t intel_limits_vlv_dp = {
@@ -381,7 +329,6 @@ static const intel_limit_t intel_limits_vlv_dp = {
381 .p1 = { .min = 1, .max = 3 }, 329 .p1 = { .min = 1, .max = 3 },
382 .p2 = { .dot_limit = 270000, 330 .p2 = { .dot_limit = 270000,
383 .p2_slow = 2, .p2_fast = 20 }, 331 .p2_slow = 2, .p2_fast = 20 },
384 .find_pll = intel_vlv_find_best_pll,
385}; 332};
386 333
387static const intel_limit_t *intel_ironlake_limit(struct drm_crtc *crtc, 334static const intel_limit_t *intel_ironlake_limit(struct drm_crtc *crtc,
@@ -537,7 +484,7 @@ static bool intel_PLL_is_valid(struct drm_device *dev,
537} 484}
538 485
539static bool 486static bool
540intel_find_best_PLL(const intel_limit_t *limit, struct drm_crtc *crtc, 487i9xx_find_best_dpll(const intel_limit_t *limit, struct drm_crtc *crtc,
541 int target, int refclk, intel_clock_t *match_clock, 488 int target, int refclk, intel_clock_t *match_clock,
542 intel_clock_t *best_clock) 489 intel_clock_t *best_clock)
543{ 490{
@@ -599,9 +546,9 @@ intel_find_best_PLL(const intel_limit_t *limit, struct drm_crtc *crtc,
599} 546}
600 547
601static bool 548static bool
602intel_pnv_find_best_PLL(const intel_limit_t *limit, struct drm_crtc *crtc, 549pnv_find_best_dpll(const intel_limit_t *limit, struct drm_crtc *crtc,
603 int target, int refclk, intel_clock_t *match_clock, 550 int target, int refclk, intel_clock_t *match_clock,
604 intel_clock_t *best_clock) 551 intel_clock_t *best_clock)
605{ 552{
606 struct drm_device *dev = crtc->dev; 553 struct drm_device *dev = crtc->dev;
607 intel_clock_t clock; 554 intel_clock_t clock;
@@ -661,9 +608,9 @@ intel_pnv_find_best_PLL(const intel_limit_t *limit, struct drm_crtc *crtc,
661} 608}
662 609
663static bool 610static bool
664intel_g4x_find_best_PLL(const intel_limit_t *limit, struct drm_crtc *crtc, 611g4x_find_best_dpll(const intel_limit_t *limit, struct drm_crtc *crtc,
665 int target, int refclk, intel_clock_t *match_clock, 612 int target, int refclk, intel_clock_t *match_clock,
666 intel_clock_t *best_clock) 613 intel_clock_t *best_clock)
667{ 614{
668 struct drm_device *dev = crtc->dev; 615 struct drm_device *dev = crtc->dev;
669 intel_clock_t clock; 616 intel_clock_t clock;
@@ -718,9 +665,9 @@ intel_g4x_find_best_PLL(const intel_limit_t *limit, struct drm_crtc *crtc,
718} 665}
719 666
720static bool 667static bool
721intel_vlv_find_best_pll(const intel_limit_t *limit, struct drm_crtc *crtc, 668vlv_find_best_dpll(const intel_limit_t *limit, struct drm_crtc *crtc,
722 int target, int refclk, intel_clock_t *match_clock, 669 int target, int refclk, intel_clock_t *match_clock,
723 intel_clock_t *best_clock) 670 intel_clock_t *best_clock)
724{ 671{
725 u32 p1, p2, m1, m2, vco, bestn, bestm1, bestm2, bestp1, bestp2; 672 u32 p1, p2, m1, m2, vco, bestn, bestm1, bestm2, bestp1, bestp2;
726 u32 m, n, fastclk; 673 u32 m, n, fastclk;
@@ -4911,9 +4858,9 @@ static int i9xx_crtc_mode_set(struct drm_crtc *crtc,
4911 * reflck * (5 * (m1 + 2) + (m2 + 2)) / (n + 2) / p1 / p2. 4858 * reflck * (5 * (m1 + 2) + (m2 + 2)) / (n + 2) / p1 / p2.
4912 */ 4859 */
4913 limit = intel_limit(crtc, refclk); 4860 limit = intel_limit(crtc, refclk);
4914 ok = limit->find_pll(limit, crtc, adjusted_mode->clock, refclk, NULL, 4861 ok = dev_priv->display.find_dpll(limit, crtc, adjusted_mode->clock,
4915 &clock); 4862 refclk, NULL, &clock);
4916 if (!ok) { 4863 if (!ok && !intel_crtc->config.clock_set) {
4917 DRM_ERROR("Couldn't find PLL settings for mode!\n"); 4864 DRM_ERROR("Couldn't find PLL settings for mode!\n");
4918 return -EINVAL; 4865 return -EINVAL;
4919 } 4866 }
@@ -4928,10 +4875,10 @@ static int i9xx_crtc_mode_set(struct drm_crtc *crtc,
4928 * by using the FP0/FP1. In such case we will disable the LVDS 4875 * by using the FP0/FP1. In such case we will disable the LVDS
4929 * downclock feature. 4876 * downclock feature.
4930 */ 4877 */
4931 has_reduced_clock = limit->find_pll(limit, crtc, 4878 has_reduced_clock =
4879 dev_priv->display.find_dpll(limit, crtc,
4932 dev_priv->lvds_downclock, 4880 dev_priv->lvds_downclock,
4933 refclk, 4881 refclk, &clock,
4934 &clock,
4935 &reduced_clock); 4882 &reduced_clock);
4936 } 4883 }
4937 /* Compat-code for transition, will disappear. */ 4884 /* Compat-code for transition, will disappear. */
@@ -5547,8 +5494,8 @@ static bool ironlake_compute_clocks(struct drm_crtc *crtc,
5547 * reflck * (5 * (m1 + 2) + (m2 + 2)) / (n + 2) / p1 / p2. 5494 * reflck * (5 * (m1 + 2) + (m2 + 2)) / (n + 2) / p1 / p2.
5548 */ 5495 */
5549 limit = intel_limit(crtc, refclk); 5496 limit = intel_limit(crtc, refclk);
5550 ret = limit->find_pll(limit, crtc, adjusted_mode->clock, refclk, NULL, 5497 ret = dev_priv->display.find_dpll(limit, crtc, adjusted_mode->clock,
5551 clock); 5498 refclk, NULL, clock);
5552 if (!ret) 5499 if (!ret)
5553 return false; 5500 return false;
5554 5501
@@ -5559,11 +5506,11 @@ static bool ironlake_compute_clocks(struct drm_crtc *crtc,
5559 * by using the FP0/FP1. In such case we will disable the LVDS 5506 * by using the FP0/FP1. In such case we will disable the LVDS
5560 * downclock feature. 5507 * downclock feature.
5561 */ 5508 */
5562 *has_reduced_clock = limit->find_pll(limit, crtc, 5509 *has_reduced_clock =
5563 dev_priv->lvds_downclock, 5510 dev_priv->display.find_dpll(limit, crtc,
5564 refclk, 5511 dev_priv->lvds_downclock,
5565 clock, 5512 refclk, clock,
5566 reduced_clock); 5513 reduced_clock);
5567 } 5514 }
5568 5515
5569 return true; 5516 return true;
@@ -5749,7 +5696,7 @@ static int ironlake_crtc_mode_set(struct drm_crtc *crtc,
5749 5696
5750 ok = ironlake_compute_clocks(crtc, adjusted_mode, &clock, 5697 ok = ironlake_compute_clocks(crtc, adjusted_mode, &clock,
5751 &has_reduced_clock, &reduced_clock); 5698 &has_reduced_clock, &reduced_clock);
5752 if (!ok) { 5699 if (!ok && !intel_crtc->config.clock_set) {
5753 DRM_ERROR("Couldn't find PLL settings for mode!\n"); 5700 DRM_ERROR("Couldn't find PLL settings for mode!\n");
5754 return -EINVAL; 5701 return -EINVAL;
5755 } 5702 }
@@ -9073,6 +9020,15 @@ static void intel_init_display(struct drm_device *dev)
9073{ 9020{
9074 struct drm_i915_private *dev_priv = dev->dev_private; 9021 struct drm_i915_private *dev_priv = dev->dev_private;
9075 9022
9023 if (HAS_PCH_SPLIT(dev) || IS_G4X(dev))
9024 dev_priv->display.find_dpll = g4x_find_best_dpll;
9025 else if (IS_VALLEYVIEW(dev))
9026 dev_priv->display.find_dpll = vlv_find_best_dpll;
9027 else if (IS_PINEVIEW(dev))
9028 dev_priv->display.find_dpll = pnv_find_best_dpll;
9029 else
9030 dev_priv->display.find_dpll = i9xx_find_best_dpll;
9031
9076 if (HAS_DDI(dev)) { 9032 if (HAS_DDI(dev)) {
9077 dev_priv->display.get_pipe_config = haswell_get_pipe_config; 9033 dev_priv->display.get_pipe_config = haswell_get_pipe_config;
9078 dev_priv->display.crtc_mode_set = haswell_crtc_mode_set; 9034 dev_priv->display.crtc_mode_set = haswell_crtc_mode_set;