drm/i915/sdvo: Set sync polarity based on actual mode
authorAdam Jackson <ajax@redhat.com>
Fri, 16 Jul 2010 18:46:32 +0000 (14:46 -0400)
committerEric Anholt <eric@anholt.net>
Mon, 2 Aug 2010 02:38:12 +0000 (19:38 -0700)
Signed-off-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
drivers/gpu/drm/i915/intel_sdvo.c

index 76993ac16cc1b1b84ca4c4ff102458ae47f76c80..8b2bfc005c593522bd6a3c893723c9a32526f899 100644 (file)
@@ -1237,9 +1237,11 @@ static void intel_sdvo_mode_set(struct drm_encoder *encoder,
 
        /* Set the SDVO control regs. */
        if (IS_I965G(dev)) {
-               sdvox |= SDVO_BORDER_ENABLE |
-                       SDVO_VSYNC_ACTIVE_HIGH |
-                       SDVO_HSYNC_ACTIVE_HIGH;
+               sdvox |= SDVO_BORDER_ENABLE;
+               if (adjusted_mode->flags & DRM_MODE_FLAG_PVSYNC)
+                       sdvox |= SDVO_VSYNC_ACTIVE_HIGH;
+               if (adjusted_mode->flags & DRM_MODE_FLAG_PHSYNC)
+                       sdvox |= SDVO_HSYNC_ACTIVE_HIGH;
        } else {
                sdvox |= I915_READ(sdvo_priv->sdvo_reg);
                switch (sdvo_priv->sdvo_reg) {