drm/i915: Read the right SDVO register when detecting SVDO/HDMI.
authorKristian Høgsberg <krh@redhat.com>
Fri, 13 Mar 2009 19:42:14 +0000 (15:42 -0400)
committerEric Anholt <eric@anholt.net>
Fri, 27 Mar 2009 21:45:14 +0000 (14:45 -0700)
This fixes incorrect detection of the second SDVO/HDMI output on G4X, and
extra boot time on pre-G4X.

Signed-off-by: Kristian Høgsberg <krh@redhat.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
drivers/gpu/drm/i915/intel_display.c

index 8e29545273b6799e720faf43831d094b55e679e6..0d40b4b6979e8802a11454154284d270fbe0b4ea 100644 (file)
@@ -1735,13 +1735,21 @@ static void intel_setup_outputs(struct drm_device *dev)
 
        if (IS_I9XX(dev)) {
                int found;
+               u32 reg;
 
                if (I915_READ(SDVOB) & SDVO_DETECTED) {
                        found = intel_sdvo_init(dev, SDVOB);
                        if (!found && SUPPORTS_INTEGRATED_HDMI(dev))
                                intel_hdmi_init(dev, SDVOB);
                }
-               if (!IS_G4X(dev) || (I915_READ(SDVOB) & SDVO_DETECTED)) {
+
+               /* 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) {
                        found = intel_sdvo_init(dev, SDVOC);
                        if (!found && SUPPORTS_INTEGRATED_HDMI(dev))
                                intel_hdmi_init(dev, SDVOC);