diff options
Diffstat (limited to 'drivers/gpu/drm/i915/intel_fbdev.c')
-rw-r--r-- | drivers/gpu/drm/i915/intel_fbdev.c | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/drivers/gpu/drm/i915/intel_fbdev.c b/drivers/gpu/drm/i915/intel_fbdev.c index f2183b554cbc..850cf7d6578c 100644 --- a/drivers/gpu/drm/i915/intel_fbdev.c +++ b/drivers/gpu/drm/i915/intel_fbdev.c | |||
@@ -324,6 +324,7 @@ intel_fb_helper_crtc(struct drm_fb_helper *fb_helper, struct drm_crtc *crtc) | |||
324 | static bool intel_fb_initial_config(struct drm_fb_helper *fb_helper, | 324 | static bool intel_fb_initial_config(struct drm_fb_helper *fb_helper, |
325 | struct drm_fb_helper_crtc **crtcs, | 325 | struct drm_fb_helper_crtc **crtcs, |
326 | struct drm_display_mode **modes, | 326 | struct drm_display_mode **modes, |
327 | struct drm_fb_offset *offsets, | ||
327 | bool *enabled, int width, int height) | 328 | bool *enabled, int width, int height) |
328 | { | 329 | { |
329 | struct drm_device *dev = fb_helper->dev; | 330 | struct drm_device *dev = fb_helper->dev; |
@@ -332,6 +333,8 @@ static bool intel_fb_initial_config(struct drm_fb_helper *fb_helper, | |||
332 | bool fallback = true; | 333 | bool fallback = true; |
333 | int num_connectors_enabled = 0; | 334 | int num_connectors_enabled = 0; |
334 | int num_connectors_detected = 0; | 335 | int num_connectors_detected = 0; |
336 | uint64_t conn_configured = 0, mask; | ||
337 | int pass = 0; | ||
335 | 338 | ||
336 | save_enabled = kcalloc(dev->mode_config.num_connector, sizeof(bool), | 339 | save_enabled = kcalloc(dev->mode_config.num_connector, sizeof(bool), |
337 | GFP_KERNEL); | 340 | GFP_KERNEL); |
@@ -339,7 +342,8 @@ static bool intel_fb_initial_config(struct drm_fb_helper *fb_helper, | |||
339 | return false; | 342 | return false; |
340 | 343 | ||
341 | memcpy(save_enabled, enabled, dev->mode_config.num_connector); | 344 | memcpy(save_enabled, enabled, dev->mode_config.num_connector); |
342 | 345 | mask = (1 << fb_helper->connector_count) - 1; | |
346 | retry: | ||
343 | for (i = 0; i < fb_helper->connector_count; i++) { | 347 | for (i = 0; i < fb_helper->connector_count; i++) { |
344 | struct drm_fb_helper_connector *fb_conn; | 348 | struct drm_fb_helper_connector *fb_conn; |
345 | struct drm_connector *connector; | 349 | struct drm_connector *connector; |
@@ -349,12 +353,19 @@ static bool intel_fb_initial_config(struct drm_fb_helper *fb_helper, | |||
349 | fb_conn = fb_helper->connector_info[i]; | 353 | fb_conn = fb_helper->connector_info[i]; |
350 | connector = fb_conn->connector; | 354 | connector = fb_conn->connector; |
351 | 355 | ||
356 | if (conn_configured & (1 << i)) | ||
357 | continue; | ||
358 | |||
359 | if (pass == 0 && !connector->has_tile) | ||
360 | continue; | ||
361 | |||
352 | if (connector->status == connector_status_connected) | 362 | if (connector->status == connector_status_connected) |
353 | num_connectors_detected++; | 363 | num_connectors_detected++; |
354 | 364 | ||
355 | if (!enabled[i]) { | 365 | if (!enabled[i]) { |
356 | DRM_DEBUG_KMS("connector %s not enabled, skipping\n", | 366 | DRM_DEBUG_KMS("connector %s not enabled, skipping\n", |
357 | connector->name); | 367 | connector->name); |
368 | conn_configured |= (1 << i); | ||
358 | continue; | 369 | continue; |
359 | } | 370 | } |
360 | 371 | ||
@@ -373,6 +384,7 @@ static bool intel_fb_initial_config(struct drm_fb_helper *fb_helper, | |||
373 | DRM_DEBUG_KMS("connector %s has no encoder or crtc, skipping\n", | 384 | DRM_DEBUG_KMS("connector %s has no encoder or crtc, skipping\n", |
374 | connector->name); | 385 | connector->name); |
375 | enabled[i] = false; | 386 | enabled[i] = false; |
387 | conn_configured |= (1 << i); | ||
376 | continue; | 388 | continue; |
377 | } | 389 | } |
378 | 390 | ||
@@ -400,8 +412,8 @@ static bool intel_fb_initial_config(struct drm_fb_helper *fb_helper, | |||
400 | 412 | ||
401 | /* try for preferred next */ | 413 | /* try for preferred next */ |
402 | if (!modes[i]) { | 414 | if (!modes[i]) { |
403 | DRM_DEBUG_KMS("looking for preferred mode on connector %s\n", | 415 | DRM_DEBUG_KMS("looking for preferred mode on connector %s %d\n", |
404 | connector->name); | 416 | connector->name, connector->has_tile); |
405 | modes[i] = drm_has_preferred_mode(fb_conn, width, | 417 | modes[i] = drm_has_preferred_mode(fb_conn, width, |
406 | height); | 418 | height); |
407 | } | 419 | } |
@@ -444,6 +456,12 @@ static bool intel_fb_initial_config(struct drm_fb_helper *fb_helper, | |||
444 | modes[i]->flags & DRM_MODE_FLAG_INTERLACE ? "i" :""); | 456 | modes[i]->flags & DRM_MODE_FLAG_INTERLACE ? "i" :""); |
445 | 457 | ||
446 | fallback = false; | 458 | fallback = false; |
459 | conn_configured |= (1 << i); | ||
460 | } | ||
461 | |||
462 | if ((conn_configured & mask) != mask) { | ||
463 | pass++; | ||
464 | goto retry; | ||
447 | } | 465 | } |
448 | 466 | ||
449 | /* | 467 | /* |