drm/i915: Fix HDMI mode select for Cougarpoint PCH
authorZhenyu Wang <zhenyuw@linux.intel.com>
Wed, 12 May 2010 03:02:14 +0000 (11:02 +0800)
committerEric Anholt <eric@anholt.net>
Wed, 26 May 2010 21:14:52 +0000 (14:14 -0700)
For real HDMI sink, CPT HDMI port has to set 'HDMI' mode flag
in order to make HDMI audio work correctly.

This is required patch for drm/i915 to enable HDMI audio on CPT PCH,
ALSA patch is at http://mailman.alsa-project.org/pipermail/alsa-devel/2010-May/027601.html

Tested-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
drivers/gpu/drm/i915/i915_reg.h
drivers/gpu/drm/i915/intel_hdmi.c

index df7224de0aed0be745c2d078c9f4c4c078a3faa5..881fbe9a17f29b50b3037cac94c6040d1188e0e0 100644 (file)
 #define  SDVO_ENCODING          (0)
 #define  TMDS_ENCODING          (2 << 10)
 #define  NULL_PACKET_VSYNC_ENABLE       (1 << 9)
+/* CPT */
+#define  HDMI_MODE_SELECT      (1 << 9)
+#define  DVI_MODE_SELECT       (0)
 #define  SDVOB_BORDER_ENABLE    (1 << 7)
 #define  AUDIO_ENABLE           (1 << 6)
 #define  VSYNC_ACTIVE_HIGH      (1 << 4)
index 65727f0a79a3440202e5f315762431d975b5a9cf..83bd764b000e51cff80ac0a79a14b8cc5f05fcb4 100644 (file)
@@ -59,8 +59,11 @@ static void intel_hdmi_mode_set(struct drm_encoder *encoder,
                SDVO_VSYNC_ACTIVE_HIGH |
                SDVO_HSYNC_ACTIVE_HIGH;
 
-       if (hdmi_priv->has_hdmi_sink)
+       if (hdmi_priv->has_hdmi_sink) {
                sdvox |= SDVO_AUDIO_ENABLE;
+               if (HAS_PCH_CPT(dev))
+                       sdvox |= HDMI_MODE_SELECT;
+       }
 
        if (intel_crtc->pipe == 1) {
                if (HAS_PCH_CPT(dev))