aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu
diff options
context:
space:
mode:
authorZhenyu Wang <zhenyuw@linux.intel.com>2010-09-09 22:39:40 -0400
committerChris Wilson <chris@chris-wilson.co.uk>2010-10-19 04:17:50 -0400
commit2e3d6006aca163db3eeb931cec631974aaa3c293 (patch)
treeb2b3fe639cc44508f77c61e20c1af641593d85a7 /drivers/gpu
parenta9756bb5b25d5d997df0c5d8c95db01292191bea (diff)
drm/i915: Enable HDMI audio for monitor with audio support
Rely on monitor's audio capability to turn on audio output for HDMI. Tested-by: Wu Fengguang <fengguang.wu@intel.com> Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/i915/intel_hdmi.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/gpu/drm/i915/intel_hdmi.c b/drivers/gpu/drm/i915/intel_hdmi.c
index 9fb9501f2d07..2d918dc046ef 100644
--- a/drivers/gpu/drm/i915/intel_hdmi.c
+++ b/drivers/gpu/drm/i915/intel_hdmi.c
@@ -42,6 +42,7 @@ struct intel_hdmi {
42 u32 sdvox_reg; 42 u32 sdvox_reg;
43 int ddc_bus; 43 int ddc_bus;
44 bool has_hdmi_sink; 44 bool has_hdmi_sink;
45 bool has_audio;
45}; 46};
46 47
47static struct intel_hdmi *enc_to_intel_hdmi(struct drm_encoder *encoder) 48static struct intel_hdmi *enc_to_intel_hdmi(struct drm_encoder *encoder)
@@ -72,11 +73,12 @@ static void intel_hdmi_mode_set(struct drm_encoder *encoder,
72 if (adjusted_mode->flags & DRM_MODE_FLAG_PHSYNC) 73 if (adjusted_mode->flags & DRM_MODE_FLAG_PHSYNC)
73 sdvox |= SDVO_HSYNC_ACTIVE_HIGH; 74 sdvox |= SDVO_HSYNC_ACTIVE_HIGH;
74 75
75 if (intel_hdmi->has_hdmi_sink) { 76 /* Required on CPT */
77 if (intel_hdmi->has_hdmi_sink && HAS_PCH_CPT(dev))
78 sdvox |= HDMI_MODE_SELECT;
79
80 if (intel_hdmi->has_audio)
76 sdvox |= SDVO_AUDIO_ENABLE; 81 sdvox |= SDVO_AUDIO_ENABLE;
77 if (HAS_PCH_CPT(dev))
78 sdvox |= HDMI_MODE_SELECT;
79 }
80 82
81 if (intel_crtc->pipe == 1) { 83 if (intel_crtc->pipe == 1) {
82 if (HAS_PCH_CPT(dev)) 84 if (HAS_PCH_CPT(dev))
@@ -154,6 +156,7 @@ intel_hdmi_detect(struct drm_connector *connector, bool force)
154 enum drm_connector_status status = connector_status_disconnected; 156 enum drm_connector_status status = connector_status_disconnected;
155 157
156 intel_hdmi->has_hdmi_sink = false; 158 intel_hdmi->has_hdmi_sink = false;
159 intel_hdmi->has_audio = false;
157 edid = drm_get_edid(connector, 160 edid = drm_get_edid(connector,
158 &dev_priv->gmbus[intel_hdmi->ddc_bus].adapter); 161 &dev_priv->gmbus[intel_hdmi->ddc_bus].adapter);
159 162
@@ -161,6 +164,7 @@ intel_hdmi_detect(struct drm_connector *connector, bool force)
161 if (edid->input & DRM_EDID_INPUT_DIGITAL) { 164 if (edid->input & DRM_EDID_INPUT_DIGITAL) {
162 status = connector_status_connected; 165 status = connector_status_connected;
163 intel_hdmi->has_hdmi_sink = drm_detect_hdmi_monitor(edid); 166 intel_hdmi->has_hdmi_sink = drm_detect_hdmi_monitor(edid);
167 intel_hdmi->has_audio = drm_detect_monitor_audio(edid);
164 } 168 }
165 connector->display_info.raw_edid = NULL; 169 connector->display_info.raw_edid = NULL;
166 kfree(edid); 170 kfree(edid);