Commit d84a0f32 authored by Chris Wilson's avatar Chris Wilson Committed by Daniel Vetter

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: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Cc: Jesse Barnes <jbarnes@virtuousgeek.org>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: default avatarRodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
parent e80f14b6
...@@ -332,24 +332,6 @@ static bool intel_fb_initial_config(struct drm_fb_helper *fb_helper, ...@@ -332,24 +332,6 @@ static bool intel_fb_initial_config(struct drm_fb_helper *fb_helper,
int num_connectors_enabled = 0; int num_connectors_enabled = 0;
int num_connectors_detected = 0; int num_connectors_detected = 0;
/*
* If the user specified any force options, just bail here
* and use that config.
*/
for (i = 0; i < fb_helper->connector_count; i++) {
struct drm_fb_helper_connector *fb_conn;
struct drm_connector *connector;
fb_conn = fb_helper->connector_info[i];
connector = fb_conn->connector;
if (!enabled[i])
continue;
if (connector->force != DRM_FORCE_UNSPECIFIED)
return false;
}
save_enabled = kcalloc(dev->mode_config.num_connector, sizeof(bool), save_enabled = kcalloc(dev->mode_config.num_connector, sizeof(bool),
GFP_KERNEL); GFP_KERNEL);
if (!save_enabled) if (!save_enabled)
...@@ -375,8 +357,18 @@ static bool intel_fb_initial_config(struct drm_fb_helper *fb_helper, ...@@ -375,8 +357,18 @@ static bool intel_fb_initial_config(struct drm_fb_helper *fb_helper,
continue; continue;
} }
if (connector->force == DRM_FORCE_OFF) {
DRM_DEBUG_KMS("connector %s is disabled by user, skipping\n",
connector->name);
enabled[i] = false;
continue;
}
encoder = connector->encoder; encoder = connector->encoder;
if (!encoder || WARN_ON(!encoder->crtc)) { if (!encoder || WARN_ON(!encoder->crtc)) {
if (connector->force > DRM_FORCE_OFF)
goto bail;
DRM_DEBUG_KMS("connector %s has no encoder or crtc, skipping\n", DRM_DEBUG_KMS("connector %s has no encoder or crtc, skipping\n",
connector->name); connector->name);
enabled[i] = false; enabled[i] = false;
...@@ -395,8 +387,7 @@ static bool intel_fb_initial_config(struct drm_fb_helper *fb_helper, ...@@ -395,8 +387,7 @@ static bool intel_fb_initial_config(struct drm_fb_helper *fb_helper,
for (j = 0; j < fb_helper->connector_count; j++) { for (j = 0; j < fb_helper->connector_count; j++) {
if (crtcs[j] == new_crtc) { if (crtcs[j] == new_crtc) {
DRM_DEBUG_KMS("fallback: cloned configuration\n"); DRM_DEBUG_KMS("fallback: cloned configuration\n");
fallback = true; goto bail;
goto out;
} }
} }
...@@ -467,8 +458,8 @@ static bool intel_fb_initial_config(struct drm_fb_helper *fb_helper, ...@@ -467,8 +458,8 @@ static bool intel_fb_initial_config(struct drm_fb_helper *fb_helper,
fallback = true; fallback = true;
} }
out:
if (fallback) { if (fallback) {
bail:
DRM_DEBUG_KMS("Not using firmware configuration\n"); DRM_DEBUG_KMS("Not using firmware configuration\n");
memcpy(enabled, save_enabled, dev->mode_config.num_connector); memcpy(enabled, save_enabled, dev->mode_config.num_connector);
kfree(save_enabled); kfree(save_enabled);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment