All of lore.kernel.org
 help / color / mirror / Atom feed
From: Zhenyu Wang <zhenyuw@linux.intel.com>
To: dri-devel@lists.freedesktop.org
Cc: intel-gfx@lists.freedesktop.org, fengguang.wu@intel.com
Subject: [PATCH 4/4] drm/i915: add new param to force audio on or off for HDMI/DP port
Date: Sun, 19 Sep 2010 14:52:09 +0800	[thread overview]
Message-ID: <1284879129-19720-5-git-send-email-zhenyuw@linux.intel.com> (raw)
In-Reply-To: <1284879129-19720-1-git-send-email-zhenyuw@linux.intel.com>

Two reasons to add this param, one is for some AV device requiring
HDMI input for audio, but some device might not have sane EDID info
to enable audio on HDMI port. Another is for testing purpose.

Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>
---
 drivers/gpu/drm/i915/i915_drv.c   |    3 +++
 drivers/gpu/drm/i915/i915_drv.h   |    1 +
 drivers/gpu/drm/i915/intel_dp.c   |    3 ++-
 drivers/gpu/drm/i915/intel_hdmi.c |    3 ++-
 4 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
index dffc1bc..95277e5 100644
--- a/drivers/gpu/drm/i915/i915_drv.c
+++ b/drivers/gpu/drm/i915/i915_drv.c
@@ -48,6 +48,9 @@ module_param_named(powersave, i915_powersave, int, 0400);
 unsigned int i915_lvds_downclock = 0;
 module_param_named(lvds_downclock, i915_lvds_downclock, int, 0400);
 
+unsigned int i915_force_audio = -1;
+module_param_named(force_audio, i915_force_audio, int, 0400);
+
 static struct drm_driver driver;
 extern int intel_agp_enabled;
 
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index b0692c4..495182e 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -844,6 +844,7 @@ extern int i915_max_ioctl;
 extern unsigned int i915_fbpercrtc;
 extern unsigned int i915_powersave;
 extern unsigned int i915_lvds_downclock;
+extern unsigned int i915_force_audio;
 
 extern int i915_suspend(struct drm_device *dev, pm_message_t state);
 extern int i915_resume(struct drm_device *dev);
diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index 81fca1e..77b45e7 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -736,7 +736,8 @@ intel_dp_mode_set(struct drm_encoder *encoder, struct drm_display_mode *mode,
 		intel_dp->DP |= DP_PORT_WIDTH_4;
 		break;
 	}
-	if (intel_dp->has_audio)
+	if (i915_force_audio == 1 ||
+	    (i915_force_audio != 0 && intel_dp->has_audio))
 		intel_dp->DP |= DP_AUDIO_OUTPUT_ENABLE;
 
 	memset(intel_dp->link_configuration, 0, DP_LINK_CONFIGURATION_SIZE);
diff --git a/drivers/gpu/drm/i915/intel_hdmi.c b/drivers/gpu/drm/i915/intel_hdmi.c
index 90184e6..20af171 100644
--- a/drivers/gpu/drm/i915/intel_hdmi.c
+++ b/drivers/gpu/drm/i915/intel_hdmi.c
@@ -76,7 +76,8 @@ static void intel_hdmi_mode_set(struct drm_encoder *encoder,
 	if (intel_hdmi->has_hdmi_sink && HAS_PCH_CPT(dev))
 		sdvox |= HDMI_MODE_SELECT;
 
-	if (intel_hdmi->has_audio)
+	if (i915_force_audio == 1 ||
+	    (i915_force_audio != 0 && intel_hdmi->has_audio))
 		sdvox |= SDVO_AUDIO_ENABLE;
 
 	if (intel_crtc->pipe == 1) {
-- 
1.7.1

  parent reply	other threads:[~2010-09-19  6:52 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-19  6:52 [PATCH 0/4] updated patches for KMS audio Zhenyu Wang
2010-09-19  6:52 ` [PATCH 1/4] drm/edid: add helper function to detect monitor audio capability Zhenyu Wang
2010-09-19  7:38   ` [Intel-gfx] " Chris Wilson
2010-09-19  7:56     ` Zhenyu Wang
2010-10-19  7:24       ` Ben Skeggs
2010-09-19  6:52 ` [PATCH 2/4] drm/i915: Enable DisplayPort audio Zhenyu Wang
2010-09-19  7:43   ` Chris Wilson
2010-09-19  7:57     ` Zhenyu Wang
2010-09-19  6:52 ` [PATCH 3/4] drm/i915: Enable HDMI audio for monitor with audio support Zhenyu Wang
2010-09-19  6:52 ` Zhenyu Wang [this message]
2010-09-19  8:14   ` [PATCH 4/4] drm/i915: add new param to force audio on or off for HDMI/DP port Chris Wilson
2010-09-19  8:22     ` Zhenyu Wang
2010-09-19  8:57       ` Chris Wilson
2010-09-20 19:42 ` [PATCH 0/4] updated patches for KMS audio Adam Jackson
2010-10-14 10:24 ` Chris Wilson

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=1284879129-19720-5-git-send-email-zhenyuw@linux.intel.com \
    --to=zhenyuw@linux.intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=fengguang.wu@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.