aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEgbert Eich2013-04-04 15:04:02 -0500
committerGreg Kroah-Hartman2013-05-11 15:54:01 -0500
commit1501dd0e01575bda28dccc92a1b260abf3d29038 (patch)
treeb92df9a1693d37af2039e29601ce47550a35d420
parentc86622fb778dc8b5b7e1dc7b1492541f59b3d1fc (diff)
downloadkernel-omap-1501dd0e01575bda28dccc92a1b260abf3d29038.tar.gz
kernel-omap-1501dd0e01575bda28dccc92a1b260abf3d29038.tar.xz
kernel-omap-1501dd0e01575bda28dccc92a1b260abf3d29038.zip
drm/i915: Fix SDVO connector and encoder get_hw_state functions
commit 7a7d1fb79fb581553f4830498045de774a9659f8 upstream. 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 Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-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 dfb5068a4e29..506c331281d7 100644
--- a/drivers/gpu/drm/i915/intel_sdvo.c
+++ b/drivers/gpu/drm/i915/intel_sdvo.c
@@ -1197,12 +1197,8 @@ static bool intel_sdvo_connector_get_hw_state(struct intel_connector *connector)
1197 struct intel_sdvo_connector *intel_sdvo_connector = 1197 struct intel_sdvo_connector *intel_sdvo_connector =
1198 to_intel_sdvo_connector(&connector->base); 1198 to_intel_sdvo_connector(&connector->base);
1199 struct intel_sdvo *intel_sdvo = intel_attached_sdvo(&connector->base); 1199 struct intel_sdvo *intel_sdvo = intel_attached_sdvo(&connector->base);
1200 struct drm_i915_private *dev_priv = intel_sdvo->base.base.dev->dev_private;
1201 u16 active_outputs; 1200 u16 active_outputs;
1202 1201
1203 if (!(I915_READ(intel_sdvo->sdvo_reg) & SDVO_ENABLE))
1204 return false;
1205
1206 intel_sdvo_get_active_outputs(intel_sdvo, &active_outputs); 1202 intel_sdvo_get_active_outputs(intel_sdvo, &active_outputs);
1207 1203
1208 if (active_outputs & intel_sdvo_connector->output_flag) 1204 if (active_outputs & intel_sdvo_connector->output_flag)
@@ -1217,11 +1213,13 @@ static bool intel_sdvo_get_hw_state(struct intel_encoder *encoder,
1217 struct drm_device *dev = encoder->base.dev; 1213 struct drm_device *dev = encoder->base.dev;
1218 struct drm_i915_private *dev_priv = dev->dev_private; 1214 struct drm_i915_private *dev_priv = dev->dev_private;
1219 struct intel_sdvo *intel_sdvo = to_intel_sdvo(&encoder->base); 1215 struct intel_sdvo *intel_sdvo = to_intel_sdvo(&encoder->base);
1216 u16 active_outputs;
1220 u32 tmp; 1217 u32 tmp;
1221 1218
1222 tmp = I915_READ(intel_sdvo->sdvo_reg); 1219 tmp = I915_READ(intel_sdvo->sdvo_reg);
1220 intel_sdvo_get_active_outputs(intel_sdvo, &active_outputs);
1223 1221
1224 if (!(tmp & SDVO_ENABLE)) 1222 if (!(tmp & SDVO_ENABLE) && (active_outputs == 0))
1225 return false; 1223 return false;
1226 1224
1227 if (HAS_PCH_CPT(dev)) 1225 if (HAS_PCH_CPT(dev))
@@ -2708,7 +2706,6 @@ bool intel_sdvo_init(struct drm_device *dev, uint32_t sdvo_reg, bool is_sdvob)
2708 struct intel_sdvo *intel_sdvo; 2706 struct intel_sdvo *intel_sdvo;
2709 u32 hotplug_mask; 2707 u32 hotplug_mask;
2710 int i; 2708 int i;
2711
2712 intel_sdvo = kzalloc(sizeof(struct intel_sdvo), GFP_KERNEL); 2709 intel_sdvo = kzalloc(sizeof(struct intel_sdvo), GFP_KERNEL);
2713 if (!intel_sdvo) 2710 if (!intel_sdvo)
2714 return false; 2711 return false;