Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Wu Fengguang <fengguang.wu@intel.com>
To: Andrea Arcangeli <aarcange@redhat.com>
Cc: intel-gfx@lists.freedesktop.org, Wang Zhenyu <zhenyu.z.wang@intel.com>
Subject: [PATCH] drm/i915: add an "off-dvi" HDMI audio mode
Date: Fri, 6 Jan 2012 11:26:40 +0800	[thread overview]
Message-ID: <20120106032640.GA6171@localhost> (raw)
In-Reply-To: <20111231131113.GC4172@redhat.com>

Andrea,

Would you test this patch at convenient time?

Thanks,
Fengguang

---
Subject: drm/i915: add an "off-dvi" HDMI audio mode
Date: Fri Jan 06 11:04:00 CST 2012

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 "off-dvi" audio mode:

	xrandr --output HDMI1 --set audio off-dvi

Reported-by: Andrea Arcangeli <aarcange@redhat.com>
Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
---
 drivers/gpu/drm/i915/i915_drv.h    |    7 +++++++
 drivers/gpu/drm/i915/intel_hdmi.c  |    8 +++++---
 drivers/gpu/drm/i915/intel_modes.c |    4 +++-
 3 files changed, 15 insertions(+), 4 deletions(-)

--- linux.orig/drivers/gpu/drm/i915/i915_drv.h	2011-12-22 10:53:26.000000000 +0800
+++ linux/drivers/gpu/drm/i915/i915_drv.h	2012-01-06 11:20:03.000000000 +0800
@@ -736,6 +736,13 @@ typedef struct drm_i915_private {
 	atomic_t forcewake_count;
 } drm_i915_private_t;
 
+enum hdmi_force_audio {
+	HDMI_AUDIO_OFF_DVI = -2,	/* no aux data for HDMI-DVI converter */
+	HDMI_AUDIO_OFF,			/* force turn off HDMI audio */
+	HDMI_AUDIO_AUTO,		/* trust EDID */
+	HDMI_AUDIO_ON,			/* force turn on HDMI audio */
+};
+
 enum i915_cache_level {
 	I915_CACHE_NONE,
 	I915_CACHE_LLC,
--- linux.orig/drivers/gpu/drm/i915/intel_hdmi.c	2011-12-22 10:53:27.000000000 +0800
+++ linux/drivers/gpu/drm/i915/intel_hdmi.c	2012-01-06 11:03:56.000000000 +0800
@@ -335,7 +335,9 @@ intel_hdmi_detect(struct drm_connector *
 	if (edid) {
 		if (edid->input & DRM_EDID_INPUT_DIGITAL) {
 			status = connector_status_connected;
-			intel_hdmi->has_hdmi_sink = drm_detect_hdmi_monitor(edid);
+			if (intel_hdmi->force_audio != HDMI_AUDIO_OFF_DVI)
+				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;
@@ -411,8 +413,8 @@ intel_hdmi_set_property(struct drm_conne
 		else
 			has_audio = i > 0;
 
-		if (has_audio == intel_hdmi->has_audio)
-			return 0;
+		if (i == HDMI_AUDIO_OFF_DVI)
+			intel_hdmi->has_hdmi_sink = 0;
 
 		intel_hdmi->has_audio = has_audio;
 		goto done;
--- linux.orig/drivers/gpu/drm/i915/intel_modes.c	2011-12-22 10:53:27.000000000 +0800
+++ linux/drivers/gpu/drm/i915/intel_modes.c	2012-01-06 11:21:19.000000000 +0800
@@ -84,6 +84,7 @@ int intel_ddc_get_modes(struct drm_conne
 }
 
 static const char *force_audio_names[] = {
+	"off-dvi",
 	"off",
 	"auto",
 	"on",
@@ -106,7 +107,8 @@ intel_attach_force_audio_property(struct
 			return;
 
 		for (i = 0; i < ARRAY_SIZE(force_audio_names); i++)
-			drm_property_add_enum(prop, i, i-1, force_audio_names[i]);
+			drm_property_add_enum(prop, i, i-2,
+					      force_audio_names[i]);
 
 		dev_priv->force_audio_property = prop;
 	}

  parent reply	other threads:[~2012-01-06  3:26 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1325272048-28597-1-git-send-email-aarcange@redhat.com>
2011-12-31  1:28 ` force DVI mode without audio Wu Fengguang
     [not found]   ` <20111231122010.GA4172@redhat.com>
2011-12-31 12:49     ` Wu Fengguang
     [not found]       ` <20111231131113.GC4172@redhat.com>
2012-01-06  3:26         ` Wu Fengguang [this message]
2012-01-06 15:08           ` [PATCH] drm/i915: add an "off-dvi" HDMI audio mode Jesse Barnes
2012-01-07 13:39             ` Wu Fengguang
2012-01-11  7:01               ` Wu Fengguang
     [not found]             ` <20120106161257.GI28604@redhat.com>
2012-01-07 13:44               ` Wu Fengguang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120106032640.GA6171@localhost \
    --to=fengguang.wu@intel.com \
    --cc=aarcange@redhat.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=zhenyu.z.wang@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox