diff options
Diffstat (limited to 'drivers/gpu/drm/i915/intel_sdvo.c')
-rw-r--r-- | drivers/gpu/drm/i915/intel_sdvo.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/drivers/gpu/drm/i915/intel_sdvo.c b/drivers/gpu/drm/i915/intel_sdvo.c index 298dc85ec32c..a618a6a45a77 100644 --- a/drivers/gpu/drm/i915/intel_sdvo.c +++ b/drivers/gpu/drm/i915/intel_sdvo.c | |||
@@ -1231,12 +1231,8 @@ static bool intel_sdvo_connector_get_hw_state(struct intel_connector *connector) | |||
1231 | struct intel_sdvo_connector *intel_sdvo_connector = | 1231 | struct intel_sdvo_connector *intel_sdvo_connector = |
1232 | to_intel_sdvo_connector(&connector->base); | 1232 | to_intel_sdvo_connector(&connector->base); |
1233 | struct intel_sdvo *intel_sdvo = intel_attached_sdvo(&connector->base); | 1233 | struct intel_sdvo *intel_sdvo = intel_attached_sdvo(&connector->base); |
1234 | struct drm_i915_private *dev_priv = intel_sdvo->base.base.dev->dev_private; | ||
1235 | u16 active_outputs; | 1234 | u16 active_outputs; |
1236 | 1235 | ||
1237 | if (!(I915_READ(intel_sdvo->sdvo_reg) & SDVO_ENABLE)) | ||
1238 | return false; | ||
1239 | |||
1240 | intel_sdvo_get_active_outputs(intel_sdvo, &active_outputs); | 1236 | intel_sdvo_get_active_outputs(intel_sdvo, &active_outputs); |
1241 | 1237 | ||
1242 | if (active_outputs & intel_sdvo_connector->output_flag) | 1238 | if (active_outputs & intel_sdvo_connector->output_flag) |
@@ -1251,11 +1247,13 @@ static bool intel_sdvo_get_hw_state(struct intel_encoder *encoder, | |||
1251 | struct drm_device *dev = encoder->base.dev; | 1247 | struct drm_device *dev = encoder->base.dev; |
1252 | struct drm_i915_private *dev_priv = dev->dev_private; | 1248 | struct drm_i915_private *dev_priv = dev->dev_private; |
1253 | struct intel_sdvo *intel_sdvo = to_intel_sdvo(&encoder->base); | 1249 | struct intel_sdvo *intel_sdvo = to_intel_sdvo(&encoder->base); |
1250 | u16 active_outputs; | ||
1254 | u32 tmp; | 1251 | u32 tmp; |
1255 | 1252 | ||
1256 | tmp = I915_READ(intel_sdvo->sdvo_reg); | 1253 | tmp = I915_READ(intel_sdvo->sdvo_reg); |
1254 | intel_sdvo_get_active_outputs(intel_sdvo, &active_outputs); | ||
1257 | 1255 | ||
1258 | if (!(tmp & SDVO_ENABLE)) | 1256 | if (!(tmp & SDVO_ENABLE) && (active_outputs == 0)) |
1259 | return false; | 1257 | return false; |
1260 | 1258 | ||
1261 | if (HAS_PCH_CPT(dev)) | 1259 | if (HAS_PCH_CPT(dev)) |
@@ -2276,7 +2274,6 @@ intel_sdvo_dvi_init(struct intel_sdvo *intel_sdvo, int device) | |||
2276 | connector = &intel_connector->base; | 2274 | connector = &intel_connector->base; |
2277 | if (intel_sdvo_get_hotplug_support(intel_sdvo) & | 2275 | if (intel_sdvo_get_hotplug_support(intel_sdvo) & |
2278 | intel_sdvo_connector->output_flag) { | 2276 | intel_sdvo_connector->output_flag) { |
2279 | connector->polled = DRM_CONNECTOR_POLL_HPD; | ||
2280 | intel_sdvo->hotplug_active |= intel_sdvo_connector->output_flag; | 2277 | intel_sdvo->hotplug_active |= intel_sdvo_connector->output_flag; |
2281 | /* Some SDVO devices have one-shot hotplug interrupts. | 2278 | /* Some SDVO devices have one-shot hotplug interrupts. |
2282 | * Ensure that they get re-enabled when an interrupt happens. | 2279 | * Ensure that they get re-enabled when an interrupt happens. |
@@ -2284,7 +2281,7 @@ intel_sdvo_dvi_init(struct intel_sdvo *intel_sdvo, int device) | |||
2284 | intel_encoder->hot_plug = intel_sdvo_enable_hotplug; | 2281 | intel_encoder->hot_plug = intel_sdvo_enable_hotplug; |
2285 | intel_sdvo_enable_hotplug(intel_encoder); | 2282 | intel_sdvo_enable_hotplug(intel_encoder); |
2286 | } else { | 2283 | } else { |
2287 | connector->polled = DRM_CONNECTOR_POLL_CONNECT | DRM_CONNECTOR_POLL_DISCONNECT; | 2284 | intel_connector->polled = DRM_CONNECTOR_POLL_CONNECT | DRM_CONNECTOR_POLL_DISCONNECT; |
2288 | } | 2285 | } |
2289 | encoder->encoder_type = DRM_MODE_ENCODER_TMDS; | 2286 | encoder->encoder_type = DRM_MODE_ENCODER_TMDS; |
2290 | connector->connector_type = DRM_MODE_CONNECTOR_DVID; | 2287 | connector->connector_type = DRM_MODE_CONNECTOR_DVID; |
@@ -2353,7 +2350,7 @@ intel_sdvo_analog_init(struct intel_sdvo *intel_sdvo, int device) | |||
2353 | 2350 | ||
2354 | intel_connector = &intel_sdvo_connector->base; | 2351 | intel_connector = &intel_sdvo_connector->base; |
2355 | connector = &intel_connector->base; | 2352 | connector = &intel_connector->base; |
2356 | connector->polled = DRM_CONNECTOR_POLL_CONNECT; | 2353 | intel_connector->polled = DRM_CONNECTOR_POLL_CONNECT; |
2357 | encoder->encoder_type = DRM_MODE_ENCODER_DAC; | 2354 | encoder->encoder_type = DRM_MODE_ENCODER_DAC; |
2358 | connector->connector_type = DRM_MODE_CONNECTOR_VGA; | 2355 | connector->connector_type = DRM_MODE_CONNECTOR_VGA; |
2359 | 2356 | ||
@@ -2746,7 +2743,6 @@ bool intel_sdvo_init(struct drm_device *dev, uint32_t sdvo_reg, bool is_sdvob) | |||
2746 | struct intel_sdvo *intel_sdvo; | 2743 | struct intel_sdvo *intel_sdvo; |
2747 | u32 hotplug_mask; | 2744 | u32 hotplug_mask; |
2748 | int i; | 2745 | int i; |
2749 | |||
2750 | intel_sdvo = kzalloc(sizeof(struct intel_sdvo), GFP_KERNEL); | 2746 | intel_sdvo = kzalloc(sizeof(struct intel_sdvo), GFP_KERNEL); |
2751 | if (!intel_sdvo) | 2747 | if (!intel_sdvo) |
2752 | return false; | 2748 | return false; |