[Intel-gfx] PATCH] drm/i915: Safely SDVO/HDMI detect sync up with 2D driver
Ma Ling
ling.ma at intel.com
Fri May 22 12:38:17 CEST 2009
SDVOC detect bit is only valid for HDMIC.
And for SDVO devices, SDVOB detect bit should be used
to probe all possible SDVO outputs
Signed-off-by: Ma Ling <ling.ma at intel.com>
---
drivers/gpu/drm/i915/intel_display.c | 18 ++++++------------
1 files changed, 6 insertions(+), 12 deletions(-)
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 3387cf3..b8e18d2 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -1875,8 +1875,7 @@ static void intel_setup_outputs(struct drm_device *dev)
intel_lvds_init(dev);
if (IS_I9XX(dev)) {
- int found;
- u32 reg;
+ bool found = false;
if (I915_READ(SDVOB) & SDVO_DETECTED) {
found = intel_sdvo_init(dev, SDVOB);
@@ -1884,17 +1883,12 @@ static void intel_setup_outputs(struct drm_device *dev)
intel_hdmi_init(dev, SDVOB);
}
- /* Before G4X SDVOC doesn't have its own detect register */
- if (IS_G4X(dev))
- reg = SDVOC;
- else
- reg = SDVOB;
-
- if (I915_READ(reg) & SDVO_DETECTED) {
+ if (I915_READ(SDVOB) & SDVO_DETECTED)
found = intel_sdvo_init(dev, SDVOC);
- if (!found && SUPPORTS_INTEGRATED_HDMI(dev))
- intel_hdmi_init(dev, SDVOC);
- }
+
+ if ((I915_READ(SDVOC) & SDVO_DETECTED) &&
+ !found && SUPPORTS_INTEGRATED_HDMI(dev))
+ intel_hdmi_init(dev, SDVOC);
} else
intel_dvo_init(dev);
--
1.5.4.4
More information about the Intel-gfx
mailing list