aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/intel_hdmi.c
diff options
context:
space:
mode:
authorWu Fengguang <fengguang.wu@intel.com>2012-02-13 22:45:36 -0500
committerDaniel Vetter <daniel.vetter@ffwll.ch>2012-02-14 04:03:18 -0500
commitb1d7e4b41fd0f72ea8149056778db5d737739305 (patch)
treed87dcbde66dfa08193af2184ec98aa16a17a4dce /drivers/gpu/drm/i915/intel_hdmi.c
parent8ac5a6d5b56700c006baa94272b63f2d3fdf6b06 (diff)
drm/i915: add a "force-dvi" HDMI audio mode
When HDMI-DVI converter is used, it's not only necessary to turn off audio, but also to disable HDMI_MODE_SELECT and video infoframe. Since the DVI mode is mainly tied to audio functionality from end user POV, add a new "force-dvi" audio mode: xrandr --output HDMI1 --set audio force-dvi Note that most users won't need to set this and happily rely on the EDID based DVI auto detection. Reported-by: Andrea Arcangeli <aarcange@redhat.com> Signed-off-by: Wu Fengguang <fengguang.wu@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/i915/intel_hdmi.c')
-rw-r--r--drivers/gpu/drm/i915/intel_hdmi.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/drivers/gpu/drm/i915/intel_hdmi.c b/drivers/gpu/drm/i915/intel_hdmi.c
index 086288e85fad..cae3e5f17a49 100644
--- a/drivers/gpu/drm/i915/intel_hdmi.c
+++ b/drivers/gpu/drm/i915/intel_hdmi.c
@@ -44,7 +44,7 @@ struct intel_hdmi {
44 uint32_t color_range; 44 uint32_t color_range;
45 bool has_hdmi_sink; 45 bool has_hdmi_sink;
46 bool has_audio; 46 bool has_audio;
47 int force_audio; 47 enum hdmi_force_audio force_audio;
48 void (*write_infoframe)(struct drm_encoder *encoder, 48 void (*write_infoframe)(struct drm_encoder *encoder,
49 struct dip_infoframe *frame); 49 struct dip_infoframe *frame);
50}; 50};
@@ -339,7 +339,9 @@ intel_hdmi_detect(struct drm_connector *connector, bool force)
339 if (edid) { 339 if (edid) {
340 if (edid->input & DRM_EDID_INPUT_DIGITAL) { 340 if (edid->input & DRM_EDID_INPUT_DIGITAL) {
341 status = connector_status_connected; 341 status = connector_status_connected;
342 intel_hdmi->has_hdmi_sink = drm_detect_hdmi_monitor(edid); 342 if (intel_hdmi->force_audio != HDMI_AUDIO_OFF_DVI)
343 intel_hdmi->has_hdmi_sink =
344 drm_detect_hdmi_monitor(edid);
343 intel_hdmi->has_audio = drm_detect_monitor_audio(edid); 345 intel_hdmi->has_audio = drm_detect_monitor_audio(edid);
344 } 346 }
345 connector->display_info.raw_edid = NULL; 347 connector->display_info.raw_edid = NULL;
@@ -347,8 +349,9 @@ intel_hdmi_detect(struct drm_connector *connector, bool force)
347 } 349 }
348 350
349 if (status == connector_status_connected) { 351 if (status == connector_status_connected) {
350 if (intel_hdmi->force_audio) 352 if (intel_hdmi->force_audio != HDMI_AUDIO_AUTO)
351 intel_hdmi->has_audio = intel_hdmi->force_audio > 0; 353 intel_hdmi->has_audio =
354 (intel_hdmi->force_audio == HDMI_AUDIO_ON);
352 } 355 }
353 356
354 return status; 357 return status;
@@ -402,7 +405,7 @@ intel_hdmi_set_property(struct drm_connector *connector,
402 return ret; 405 return ret;
403 406
404 if (property == dev_priv->force_audio_property) { 407 if (property == dev_priv->force_audio_property) {
405 int i = val; 408 enum hdmi_force_audio i = val;
406 bool has_audio; 409 bool has_audio;
407 410
408 if (i == intel_hdmi->force_audio) 411 if (i == intel_hdmi->force_audio)
@@ -410,13 +413,13 @@ intel_hdmi_set_property(struct drm_connector *connector,
410 413
411 intel_hdmi->force_audio = i; 414 intel_hdmi->force_audio = i;
412 415
413 if (i == 0) 416 if (i == HDMI_AUDIO_AUTO)
414 has_audio = intel_hdmi_detect_audio(connector); 417 has_audio = intel_hdmi_detect_audio(connector);
415 else 418 else
416 has_audio = i > 0; 419 has_audio = (i == HDMI_AUDIO_ON);
417 420
418 if (has_audio == intel_hdmi->has_audio) 421 if (i == HDMI_AUDIO_OFF_DVI)
419 return 0; 422 intel_hdmi->has_hdmi_sink = 0;
420 423
421 intel_hdmi->has_audio = has_audio; 424 intel_hdmi->has_audio = has_audio;
422 goto done; 425 goto done;