summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorZhenyu Wang <zhenyuw@linux.intel.com>2010-09-10 10:39:40 +0800
committerChris Wilson <chris@chris-wilson.co.uk>2010-10-19 09:17:50 +0100
commit2e3d6006aca163db3eeb931cec631974aaa3c293 (patch)
treeb2b3fe639cc44508f77c61e20c1af641593d85a7 /drivers
parenta9756bb5b25d5d997df0c5d8c95db01292191bea (diff)
downloadlinux-3.10-2e3d6006aca163db3eeb931cec631974aaa3c293.tar.gz
linux-3.10-2e3d6006aca163db3eeb931cec631974aaa3c293.tar.bz2
linux-3.10-2e3d6006aca163db3eeb931cec631974aaa3c293.zip
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')
-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 9fb9501f2d0..2d918dc046e 100644
--- a/drivers/gpu/drm/i915/intel_hdmi.c
+++ b/drivers/gpu/drm/i915/intel_hdmi.c
@@ -42,6 +42,7 @@ struct intel_hdmi {
u32 sdvox_reg;
int ddc_bus;
bool has_hdmi_sink;
+ bool has_audio;
};
static 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,
if (adjusted_mode->flags & DRM_MODE_FLAG_PHSYNC)
sdvox |= SDVO_HSYNC_ACTIVE_HIGH;
- if (intel_hdmi->has_hdmi_sink) {
+ /* Required on CPT */
+ if (intel_hdmi->has_hdmi_sink && HAS_PCH_CPT(dev))
+ sdvox |= HDMI_MODE_SELECT;
+
+ if (intel_hdmi->has_audio)
sdvox |= SDVO_AUDIO_ENABLE;
- if (HAS_PCH_CPT(dev))
- sdvox |= HDMI_MODE_SELECT;
- }
if (intel_crtc->pipe == 1) {
if (HAS_PCH_CPT(dev))
@@ -154,6 +156,7 @@ intel_hdmi_detect(struct drm_connector *connector, bool force)
enum drm_connector_status status = connector_status_disconnected;
intel_hdmi->has_hdmi_sink = false;
+ intel_hdmi->has_audio = false;
edid = drm_get_edid(connector,
&dev_priv->gmbus[intel_hdmi->ddc_bus].adapter);
@@ -161,6 +164,7 @@ intel_hdmi_detect(struct drm_connector *connector, bool force)
if (edid->input & DRM_EDID_INPUT_DIGITAL) {
status = connector_status_connected;
intel_hdmi->has_hdmi_sink = drm_detect_hdmi_monitor(edid);
+ intel_hdmi->has_audio = drm_detect_monitor_audio(edid);
}
connector->display_info.raw_edid = NULL;
kfree(edid);