drm/i915/hdmi: Set sync polarity based on actual mode
authorAdam Jackson <ajax@redhat.com>
Fri, 16 Jul 2010 18:46:31 +0000 (14:46 -0400)
committerEric Anholt <eric@anholt.net>
Mon, 2 Aug 2010 02:38:08 +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_hdmi.c

index 83bd764b000e51cff80ac0a79a14b8cc5f05fcb4..197887ed1823fcc4e1023d3fbcc2900488b2796c 100644 (file)
@@ -54,10 +54,11 @@ static void intel_hdmi_mode_set(struct drm_encoder *encoder,
        struct intel_hdmi_priv *hdmi_priv = intel_encoder->dev_priv;
        u32 sdvox;
 
-       sdvox = SDVO_ENCODING_HDMI |
-               SDVO_BORDER_ENABLE |
-               SDVO_VSYNC_ACTIVE_HIGH |
-               SDVO_HSYNC_ACTIVE_HIGH;
+       sdvox = SDVO_ENCODING_HDMI | 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;
 
        if (hdmi_priv->has_hdmi_sink) {
                sdvox |= SDVO_AUDIO_ENABLE;