diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2014-08-18 13:35:29 -0400 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2014-09-03 05:03:55 -0400 |
commit | d84a0f3280c48fa28857de59a47e2fbf8753969f (patch) | |
tree | 1853d70744f3d67d5a4a99236bc17f0ffa658d39 /drivers/gpu/drm/i915/intel_fbdev.c | |
parent | e80f14b6d36e3e07111cf2ab084ef8dd5d015ce2 (diff) |
drm/i915: honour forced connector modes
In the move over to use BIOS connector configs, we lost the ability to
force a specific set of connectors on or off. Try to remedy that by
dropping back to the old behavior if we detect a hard coded connector
config that tries to enable a connector (disabling is easy!).
Based on earlier patches by Jesse Barnes.
v2: Remove Jesse's patch
Reported-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Jesse Barnes <jbarnes@virtuousgeek.org>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/i915/intel_fbdev.c')
-rw-r--r-- | drivers/gpu/drm/i915/intel_fbdev.c | 33 |
1 files changed, 12 insertions, 21 deletions
diff --git a/drivers/gpu/drm/i915/intel_fbdev.c b/drivers/gpu/drm/i915/intel_fbdev.c index cf052a39558d..b992133824f2 100644 --- a/drivers/gpu/drm/i915/intel_fbdev.c +++ b/drivers/gpu/drm/i915/intel_fbdev.c | |||
@@ -332,24 +332,6 @@ static bool intel_fb_initial_config(struct drm_fb_helper *fb_helper, | |||
332 | int num_connectors_enabled = 0; | 332 | int num_connectors_enabled = 0; |
333 | int num_connectors_detected = 0; | 333 | int num_connectors_detected = 0; |
334 | 334 | ||
335 | /* | ||
336 | * If the user specified any force options, just bail here | ||
337 | * and use that config. | ||
338 | */ | ||
339 | for (i = 0; i < fb_helper->connector_count; i++) { | ||
340 | struct drm_fb_helper_connector *fb_conn; | ||
341 | struct drm_connector *connector; | ||
342 | |||
343 | fb_conn = fb_helper->connector_info[i]; | ||
344 | connector = fb_conn->connector; | ||
345 | |||
346 | if (!enabled[i]) | ||
347 | continue; | ||
348 | |||
349 | if (connector->force != DRM_FORCE_UNSPECIFIED) | ||
350 | return false; | ||
351 | } | ||
352 | |||
353 | save_enabled = kcalloc(dev->mode_config.num_connector, sizeof(bool), | 335 | save_enabled = kcalloc(dev->mode_config.num_connector, sizeof(bool), |
354 | GFP_KERNEL); | 336 | GFP_KERNEL); |
355 | if (!save_enabled) | 337 | if (!save_enabled) |
@@ -375,8 +357,18 @@ static bool intel_fb_initial_config(struct drm_fb_helper *fb_helper, | |||
375 | continue; | 357 | continue; |
376 | } | 358 | } |
377 | 359 | ||
360 | if (connector->force == DRM_FORCE_OFF) { | ||
361 | DRM_DEBUG_KMS("connector %s is disabled by user, skipping\n", | ||
362 | connector->name); | ||
363 | enabled[i] = false; | ||
364 | continue; | ||
365 | } | ||
366 | |||
378 | encoder = connector->encoder; | 367 | encoder = connector->encoder; |
379 | if (!encoder || WARN_ON(!encoder->crtc)) { | 368 | if (!encoder || WARN_ON(!encoder->crtc)) { |
369 | if (connector->force > DRM_FORCE_OFF) | ||
370 | goto bail; | ||
371 | |||
380 | DRM_DEBUG_KMS("connector %s has no encoder or crtc, skipping\n", | 372 | DRM_DEBUG_KMS("connector %s has no encoder or crtc, skipping\n", |
381 | connector->name); | 373 | connector->name); |
382 | enabled[i] = false; | 374 | enabled[i] = false; |
@@ -395,8 +387,7 @@ static bool intel_fb_initial_config(struct drm_fb_helper *fb_helper, | |||
395 | for (j = 0; j < fb_helper->connector_count; j++) { | 387 | for (j = 0; j < fb_helper->connector_count; j++) { |
396 | if (crtcs[j] == new_crtc) { | 388 | if (crtcs[j] == new_crtc) { |
397 | DRM_DEBUG_KMS("fallback: cloned configuration\n"); | 389 | DRM_DEBUG_KMS("fallback: cloned configuration\n"); |
398 | fallback = true; | 390 | goto bail; |
399 | goto out; | ||
400 | } | 391 | } |
401 | } | 392 | } |
402 | 393 | ||
@@ -467,8 +458,8 @@ static bool intel_fb_initial_config(struct drm_fb_helper *fb_helper, | |||
467 | fallback = true; | 458 | fallback = true; |
468 | } | 459 | } |
469 | 460 | ||
470 | out: | ||
471 | if (fallback) { | 461 | if (fallback) { |
462 | bail: | ||
472 | DRM_DEBUG_KMS("Not using firmware configuration\n"); | 463 | DRM_DEBUG_KMS("Not using firmware configuration\n"); |
473 | memcpy(enabled, save_enabled, dev->mode_config.num_connector); | 464 | memcpy(enabled, save_enabled, dev->mode_config.num_connector); |
474 | kfree(save_enabled); | 465 | kfree(save_enabled); |