* [PATCH] drm/i915: HDMI - Clear Audio Enable bit for Hot Plug unconditionally
@ 2012-09-13 2:56 Wang Xingchao
2012-09-13 2:58 ` Wang Xingchao
2012-09-13 3:13 ` Fengguang Wu
0 siblings, 2 replies; 4+ messages in thread
From: Wang Xingchao @ 2012-09-13 2:56 UTC (permalink / raw)
To: intel-gfx, alsa-devel
Cc: tiwai, daniel.vetter, Wang Xingchao, yakui.zhao, michael.fu,
fengguang.wu
Clear Audio Enable bit to trigger unsolicated event to notify Audio
Driver part the HDMI hot plug change. The patch fixed the bug when
remove HDMI cable the bit was not cleared correctly.
In intel_enable_hdmi(), if intel_hdmi->has_audio been true, the "Audio enable bit" will
be set to trigger unsolicated event to notify Alsa driver the change.
intel_hdmi->has_audio will be reset to false from intel_hdmi_detect() after
remove the hdmi cable, here's debug log:
[ 187.494153] [drm:output_poll_execute], [CONNECTOR:17:HDMI-A-1] status updated from 1 to 2
[ 187.525349] [drm:intel_hdmi_detect], HDMI: has_audio = 0
so when comes back to intel_disable_hdmi(), the "Audio enable bit" will not be cleared. And this
cause the eld infomation and pin presence doesnot update accordingly in alsa driver side.
This patch will also trigger unsolicated event to alsa driver to notify the hot plug event:
[ 187.853159] ALSA sound/pci/hda/patch_hdmi.c:772 HDMI hot plug event: Codec=3 Pin=5 Presence_Detect=0 ELD_Valid=1
[ 187.853268] ALSA sound/pci/hda/patch_hdmi.c:990 HDMI status: Codec=3 Pin=5 Presence_Detect=0 ELD_Valid=0
Signed-off-by: Wang Xingchao <xingchao.wang@intel.com>
---
drivers/gpu/drm/i915/intel_hdmi.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/i915/intel_hdmi.c b/drivers/gpu/drm/i915/intel_hdmi.c
index 5d02aad..d39ed58 100644
--- a/drivers/gpu/drm/i915/intel_hdmi.c
+++ b/drivers/gpu/drm/i915/intel_hdmi.c
@@ -676,8 +676,7 @@ static void intel_disable_hdmi(struct intel_encoder *encoder)
u32 temp;
u32 enable_bits = SDVO_ENABLE;
- if (intel_hdmi->has_audio)
- enable_bits |= SDVO_AUDIO_ENABLE;
+ enable_bits |= SDVO_AUDIO_ENABLE;
temp = I915_READ(intel_hdmi->sdvox_reg);
--
1.7.9.5
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] drm/i915: HDMI - Clear Audio Enable bit for Hot Plug unconditionally
2012-09-13 2:56 [PATCH] drm/i915: HDMI - Clear Audio Enable bit for Hot Plug unconditionally Wang Xingchao
@ 2012-09-13 2:58 ` Wang Xingchao
2012-09-13 3:13 ` Fengguang Wu
1 sibling, 0 replies; 4+ messages in thread
From: Wang Xingchao @ 2012-09-13 2:58 UTC (permalink / raw)
To: intel-gfx, alsa-devel
Cc: tiwai, daniel.vetter, fengguang.wu, yakui.zhao, michael.fu
Hi Daniel,
I tested this patch with drm-intel-next branch under ubuntu 12.04, the HDMI
hot plug could work correctly.
thanks
--xingchao
On Thu, Sep 13, 2012 at 10:56:16AM +0800, Wang Xingchao wrote:
> Clear Audio Enable bit to trigger unsolicated event to notify Audio
> Driver part the HDMI hot plug change. The patch fixed the bug when
> remove HDMI cable the bit was not cleared correctly.
>
> In intel_enable_hdmi(), if intel_hdmi->has_audio been true, the "Audio enable bit" will
> be set to trigger unsolicated event to notify Alsa driver the change.
>
> intel_hdmi->has_audio will be reset to false from intel_hdmi_detect() after
> remove the hdmi cable, here's debug log:
>
> [ 187.494153] [drm:output_poll_execute], [CONNECTOR:17:HDMI-A-1] status updated from 1 to 2
> [ 187.525349] [drm:intel_hdmi_detect], HDMI: has_audio = 0
>
> so when comes back to intel_disable_hdmi(), the "Audio enable bit" will not be cleared. And this
> cause the eld infomation and pin presence doesnot update accordingly in alsa driver side.
>
> This patch will also trigger unsolicated event to alsa driver to notify the hot plug event:
>
> [ 187.853159] ALSA sound/pci/hda/patch_hdmi.c:772 HDMI hot plug event: Codec=3 Pin=5 Presence_Detect=0 ELD_Valid=1
> [ 187.853268] ALSA sound/pci/hda/patch_hdmi.c:990 HDMI status: Codec=3 Pin=5 Presence_Detect=0 ELD_Valid=0
>
> Signed-off-by: Wang Xingchao <xingchao.wang@intel.com>
> ---
> drivers/gpu/drm/i915/intel_hdmi.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_hdmi.c b/drivers/gpu/drm/i915/intel_hdmi.c
> index 5d02aad..d39ed58 100644
> --- a/drivers/gpu/drm/i915/intel_hdmi.c
> +++ b/drivers/gpu/drm/i915/intel_hdmi.c
> @@ -676,8 +676,7 @@ static void intel_disable_hdmi(struct intel_encoder *encoder)
> u32 temp;
> u32 enable_bits = SDVO_ENABLE;
>
> - if (intel_hdmi->has_audio)
> - enable_bits |= SDVO_AUDIO_ENABLE;
> + enable_bits |= SDVO_AUDIO_ENABLE;
>
> temp = I915_READ(intel_hdmi->sdvox_reg);
>
> --
> 1.7.9.5
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] drm/i915: HDMI - Clear Audio Enable bit for Hot Plug unconditionally
2012-09-13 2:56 [PATCH] drm/i915: HDMI - Clear Audio Enable bit for Hot Plug unconditionally Wang Xingchao
2012-09-13 2:58 ` Wang Xingchao
@ 2012-09-13 3:13 ` Fengguang Wu
2012-09-13 3:37 ` Wang, Xingchao
1 sibling, 1 reply; 4+ messages in thread
From: Fengguang Wu @ 2012-09-13 3:13 UTC (permalink / raw)
To: Wang Xingchao
Cc: alsa-devel, tiwai, daniel.vetter, intel-gfx, yakui.zhao,
michael.fu
> u32 enable_bits = SDVO_ENABLE;
>
> - if (intel_hdmi->has_audio)
> - enable_bits |= SDVO_AUDIO_ENABLE;
> + enable_bits |= SDVO_AUDIO_ENABLE;
The two lines can be combined:
u32 enable_bits = SDVO_ENABLE | SDVO_AUDIO_ENABLE;
Thanks,
Fengguang
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] drm/i915: HDMI - Clear Audio Enable bit for Hot Plug unconditionally
2012-09-13 3:13 ` Fengguang Wu
@ 2012-09-13 3:37 ` Wang, Xingchao
0 siblings, 0 replies; 4+ messages in thread
From: Wang, Xingchao @ 2012-09-13 3:37 UTC (permalink / raw)
To: Wu, Fengguang
Cc: alsa-devel@alsa-project.org, tiwai@suse.de,
daniel.vetter@ffwll.ch, intel-gfx@lists.freedesktop.org,
Zhao, Yakui, Fu, Michael
> -----Original Message-----
> From: Wu, Fengguang
> Sent: Thursday, September 13, 2012 11:14 AM
> To: Wang, Xingchao
> Cc: intel-gfx@lists.freedesktop.org; alsa-devel@alsa-project.org;
> daniel.vetter@ffwll.ch; tiwai@suse.de; Zhao, Yakui; Fu, Michael
> Subject: Re: [PATCH] drm/i915: HDMI - Clear Audio Enable bit for Hot Plug
> unconditionally
>
> > u32 enable_bits = SDVO_ENABLE;
> >
> > - if (intel_hdmi->has_audio)
> > - enable_bits |= SDVO_AUDIO_ENABLE;
> > + enable_bits |= SDVO_AUDIO_ENABLE;
>
> The two lines can be combined:
>
> u32 enable_bits = SDVO_ENABLE | SDVO_AUDIO_ENABLE;
Looks better, I send out V2 patch for Daniel.
-- Xingchao
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2012-09-13 3:37 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-13 2:56 [PATCH] drm/i915: HDMI - Clear Audio Enable bit for Hot Plug unconditionally Wang Xingchao
2012-09-13 2:58 ` Wang Xingchao
2012-09-13 3:13 ` Fengguang Wu
2012-09-13 3:37 ` Wang, Xingchao
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).