aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEgbert Eich <eich@suse.de>2013-04-04 16:04:02 -0400
committerDaniel Vetter <daniel.vetter@ffwll.ch>2013-04-18 03:43:07 -0400
commit7a7d1fb79fb581553f4830498045de774a9659f8 (patch)
tree3912b4c1378331d4d370c09084afdbced7fc186d
parent999bcdea3206ea8a402c010f78060cd3da4f812c (diff)
drm/i915: Fix SDVO connector and encoder get_hw_state functions
The connector associated with the encoder is considered active when the output associtated with this connector is active on the encoder. The encoder itself is considered active when either there is an active output on it or the respective SDVO channel is active. Having active outputs when the SDVO channel is inactive seems to be inconsistent: such states can be found when intel_modeset_setup_hw_state() collects the hardware state set by the BIOS. This inconsistency will be fixed in intel_sanitize_crtc() (when intel_crtc_update_dpms() is called), this however only happens when the encoder is associated with a crtc. This patch also reverts: commit bd6946e87a98fea11907b2a47368e13044458a35 Author: Daniel Vetter <daniel.vetter@ffwll.ch> Date: Tue Apr 2 21:30:34 2013 +0200 drm/i915: Fix sdvo connector get_hw_state function Signed-off-by: Egbert Eich <eich@suse.de> Suggested-by: Daniel Vetter <daniel.vetter@ffwll.ch> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=63031 Cc: stable@vger.kernel.org Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
-rw-r--r--drivers/gpu/drm/i915/intel_sdvo.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/gpu/drm/i915/intel_sdvo.c b/drivers/gpu/drm/i915/intel_sdvo.c
index 298dc85ec32c..f6a9f4a0d7f0 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))
@@ -2746,7 +2744,6 @@ bool intel_sdvo_init(struct drm_device *dev, uint32_t sdvo_reg, bool is_sdvob)
2746 struct intel_sdvo *intel_sdvo; 2744 struct intel_sdvo *intel_sdvo;
2747 u32 hotplug_mask; 2745 u32 hotplug_mask;
2748 int i; 2746 int i;
2749
2750 intel_sdvo = kzalloc(sizeof(struct intel_sdvo), GFP_KERNEL); 2747 intel_sdvo = kzalloc(sizeof(struct intel_sdvo), GFP_KERNEL);
2751 if (!intel_sdvo) 2748 if (!intel_sdvo)
2752 return false; 2749 return false;