|
@@ -630,10 +630,13 @@ static enum drm_connector_status
|
|
intel_crt_detect(struct drm_connector *connector, bool force)
|
|
intel_crt_detect(struct drm_connector *connector, bool force)
|
|
{
|
|
{
|
|
struct drm_device *dev = connector->dev;
|
|
struct drm_device *dev = connector->dev;
|
|
|
|
+ struct drm_i915_private *dev_priv = dev->dev_private;
|
|
struct intel_crt *crt = intel_attached_crt(connector);
|
|
struct intel_crt *crt = intel_attached_crt(connector);
|
|
enum drm_connector_status status;
|
|
enum drm_connector_status status;
|
|
struct intel_load_detect_pipe tmp;
|
|
struct intel_load_detect_pipe tmp;
|
|
|
|
|
|
|
|
+ intel_runtime_pm_get(dev_priv);
|
|
|
|
+
|
|
DRM_DEBUG_KMS("[CONNECTOR:%d:%s] force=%d\n",
|
|
DRM_DEBUG_KMS("[CONNECTOR:%d:%s] force=%d\n",
|
|
connector->base.id, drm_get_connector_name(connector),
|
|
connector->base.id, drm_get_connector_name(connector),
|
|
force);
|
|
force);
|
|
@@ -645,23 +648,30 @@ intel_crt_detect(struct drm_connector *connector, bool force)
|
|
*/
|
|
*/
|
|
if (intel_crt_detect_hotplug(connector)) {
|
|
if (intel_crt_detect_hotplug(connector)) {
|
|
DRM_DEBUG_KMS("CRT detected via hotplug\n");
|
|
DRM_DEBUG_KMS("CRT detected via hotplug\n");
|
|
- return connector_status_connected;
|
|
|
|
|
|
+ status = connector_status_connected;
|
|
|
|
+ goto out;
|
|
} else
|
|
} else
|
|
DRM_DEBUG_KMS("CRT not detected via hotplug\n");
|
|
DRM_DEBUG_KMS("CRT not detected via hotplug\n");
|
|
}
|
|
}
|
|
|
|
|
|
- if (intel_crt_detect_ddc(connector))
|
|
|
|
- return connector_status_connected;
|
|
|
|
|
|
+ if (intel_crt_detect_ddc(connector)) {
|
|
|
|
+ status = connector_status_connected;
|
|
|
|
+ goto out;
|
|
|
|
+ }
|
|
|
|
|
|
/* Load detection is broken on HPD capable machines. Whoever wants a
|
|
/* Load detection is broken on HPD capable machines. Whoever wants a
|
|
* broken monitor (without edid) to work behind a broken kvm (that fails
|
|
* broken monitor (without edid) to work behind a broken kvm (that fails
|
|
* to have the right resistors for HP detection) needs to fix this up.
|
|
* to have the right resistors for HP detection) needs to fix this up.
|
|
* For now just bail out. */
|
|
* For now just bail out. */
|
|
- if (I915_HAS_HOTPLUG(dev))
|
|
|
|
- return connector_status_disconnected;
|
|
|
|
|
|
+ if (I915_HAS_HOTPLUG(dev)) {
|
|
|
|
+ status = connector_status_disconnected;
|
|
|
|
+ goto out;
|
|
|
|
+ }
|
|
|
|
|
|
- if (!force)
|
|
|
|
- return connector->status;
|
|
|
|
|
|
+ if (!force) {
|
|
|
|
+ status = connector->status;
|
|
|
|
+ goto out;
|
|
|
|
+ }
|
|
|
|
|
|
/* for pre-945g platforms use load detect */
|
|
/* for pre-945g platforms use load detect */
|
|
if (intel_get_load_detect_pipe(connector, NULL, &tmp)) {
|
|
if (intel_get_load_detect_pipe(connector, NULL, &tmp)) {
|
|
@@ -673,6 +683,8 @@ intel_crt_detect(struct drm_connector *connector, bool force)
|
|
} else
|
|
} else
|
|
status = connector_status_unknown;
|
|
status = connector_status_unknown;
|
|
|
|
|
|
|
|
+out:
|
|
|
|
+ intel_runtime_pm_put(dev_priv);
|
|
return status;
|
|
return status;
|
|
}
|
|
}
|
|
|
|
|