Commit 7e696e4cadcbeb5e7f794fe77f02a20e857feeb1
1 parent
7c2bb53110
Exists in
master
and in
13 other branches
drm/i915: ignore bios output config if not all outputs are on
Both Ville and QA rather immediately complained that with the new initial_config logic from Jesse not all outputs get enabled. Since the fbdev emulation pretty much tries to always enable as many outputs as possible (it even has hotplug handling and all that) fall back if more outputs could have been enabled. v2: Fix up my confusion about what enabled means - it's passed from the fbdev helper, we need to check for a non-zero connector->encoder link. Spotted by Ville. v3: Add some debug output as requested by Jesse for debugging fallback issues. Cc: Jesse Barnes <jbarnes@virtuousgeek.org> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=75552 Tested-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Showing 1 changed file with 23 additions and 0 deletions Side-by-side Diff
drivers/gpu/drm/i915/intel_fbdev.c
... | ... | @@ -290,6 +290,8 @@ |
290 | 290 | int i, j; |
291 | 291 | bool *save_enabled; |
292 | 292 | bool fallback = true; |
293 | + int num_connectors_enabled = 0; | |
294 | + int num_connectors_detected = 0; | |
293 | 295 | |
294 | 296 | /* |
295 | 297 | * If the user specified any force options, just bail here |
... | ... | @@ -324,6 +326,10 @@ |
324 | 326 | |
325 | 327 | fb_conn = fb_helper->connector_info[i]; |
326 | 328 | connector = fb_conn->connector; |
329 | + | |
330 | + if (connector->status == connector_status_connected) | |
331 | + num_connectors_detected++; | |
332 | + | |
327 | 333 | if (!enabled[i]) { |
328 | 334 | DRM_DEBUG_KMS("connector %d not enabled, skipping\n", |
329 | 335 | connector->base.id); |
... | ... | @@ -338,6 +344,8 @@ |
338 | 344 | continue; |
339 | 345 | } |
340 | 346 | |
347 | + num_connectors_enabled++; | |
348 | + | |
341 | 349 | new_crtc = intel_fb_helper_crtc(fb_helper, encoder->crtc); |
342 | 350 | |
343 | 351 | /* |
... | ... | @@ -347,6 +355,7 @@ |
347 | 355 | */ |
348 | 356 | for (j = 0; j < fb_helper->connector_count; j++) { |
349 | 357 | if (crtcs[j] == new_crtc) { |
358 | + DRM_DEBUG_KMS("fallback: cloned configuration\n"); | |
350 | 359 | fallback = true; |
351 | 360 | goto out; |
352 | 361 | } |
353 | 362 | |
... | ... | @@ -393,8 +402,22 @@ |
393 | 402 | fallback = false; |
394 | 403 | } |
395 | 404 | |
405 | + /* | |
406 | + * If the BIOS didn't enable everything it could, fall back to have the | |
407 | + * same user experiencing of lighting up as much as possible like the | |
408 | + * fbdev helper library. | |
409 | + */ | |
410 | + if (num_connectors_enabled != num_connectors_detected && | |
411 | + num_connectors_enabled < INTEL_INFO(dev)->num_pipes) { | |
412 | + DRM_DEBUG_KMS("fallback: Not all outputs enabled\n"); | |
413 | + DRM_DEBUG_KMS("Enabled: %i, detected: %i\n", num_connectors_enabled, | |
414 | + num_connectors_detected); | |
415 | + fallback = true; | |
416 | + } | |
417 | + | |
396 | 418 | out: |
397 | 419 | if (fallback) { |
420 | + DRM_DEBUG_KMS("Not using firmware configuration\n"); | |
398 | 421 | memcpy(enabled, save_enabled, dev->mode_config.num_connector); |
399 | 422 | kfree(save_enabled); |
400 | 423 | return false; |