From: Takashi Iwai <tiwai@suse.de>
To: Anssi Hannula <anssi.hannula@iki.fi>
Cc: alsa-devel@alsa-project.org,
David Henningsson <david.henningsson@canonical.com>
Subject: Re: [PATCH 1/3] ALSA: hda - Delay HDMI presence reports while waiting for ELD information
Date: Thu, 07 Nov 2013 16:43:33 +0100 [thread overview]
Message-ID: <s5ha9hgtdy2.wl%tiwai@suse.de> (raw)
In-Reply-To: <527BB0EF.3010202@iki.fi>
At Thu, 07 Nov 2013 17:25:35 +0200,
Anssi Hannula wrote:
>
> 07.11.2013 14:38, David Henningsson kirjoitti:
> > From: Takashi Iwai <tiwai@suse.de>
> >
> > ---
> > sound/pci/hda/patch_hdmi.c | 17 ++++++++++++-----
> > 1 file changed, 12 insertions(+), 5 deletions(-)
> >
> > diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c
> > index e22323f..497e84d 100644
> > --- a/sound/pci/hda/patch_hdmi.c
> > +++ b/sound/pci/hda/patch_hdmi.c
> > @@ -1140,7 +1140,7 @@ static void hdmi_setup_audio_infoframe(struct hda_codec *codec,
> > * Unsolicited events
> > */
> >
> > -static void hdmi_present_sense(struct hdmi_spec_per_pin *per_pin, int repoll);
> > +static bool hdmi_present_sense(struct hdmi_spec_per_pin *per_pin, int repoll);
> >
> > static void hdmi_intrinsic_event(struct hda_codec *codec, unsigned int res)
> > {
> > @@ -1166,8 +1166,8 @@ static void hdmi_intrinsic_event(struct hda_codec *codec, unsigned int res)
> > if (pin_idx < 0)
> > return;
> >
> > - hdmi_present_sense(get_pin(spec, pin_idx), 1);
> > - snd_hda_jack_report_sync(codec);
> > + if (hdmi_present_sense(get_pin(spec, pin_idx), 1))
> > + snd_hda_jack_report_sync(codec);
> > }
> >
> > static void hdmi_non_intrinsic_event(struct hda_codec *codec, unsigned int res)
> > @@ -1475,7 +1475,7 @@ static int hdmi_read_pin_conn(struct hda_codec *codec, int pin_idx)
> > return 0;
> > }
> >
> > -static void hdmi_present_sense(struct hdmi_spec_per_pin *per_pin, int repoll)
> > +static bool hdmi_present_sense(struct hdmi_spec_per_pin *per_pin, int repoll)
> > {
> > struct hda_codec *codec = per_pin->codec;
> > struct hdmi_spec *spec = codec->spec;
> > @@ -1493,6 +1493,7 @@ static void hdmi_present_sense(struct hdmi_spec_per_pin *per_pin, int repoll)
> > int present = snd_hda_pin_sense(codec, pin_nid);
> > bool update_eld = false;
> > bool eld_changed = false;
> > + bool ret;
> >
> > mutex_lock(&per_pin->lock);
> > pin_eld->monitor_present = !!(present & AC_PINSENSE_PRESENCE);
> > @@ -1559,7 +1560,12 @@ static void hdmi_present_sense(struct hdmi_spec_per_pin *per_pin, int repoll)
> > SNDRV_CTL_EVENT_MASK_VALUE | SNDRV_CTL_EVENT_MASK_INFO,
> > &per_pin->eld_ctl->id);
> > unlock:
> > + if ((codec->vendor_id & 0xffff0000) == 0x10020000)
> > + ret = true; /* FIXME: implement fake ELD for AMD */
> > + else
> > + ret = !repoll || !pin_eld->monitor_present || pin_eld->eld_valid;
>
> Hmm, what is the reason for this special AMD handling?
>
> AFAICS the AMD behavior should be the same as generic codecs from the
> perspective of this code, i.e. the repolling mechanism, monitor_present
> and eld_valid work the same.
The patch was based on patch_hdmi.c before your patch, and eld_valid
hasn't been set correctly at that time. But, looking back at the
latest code again, it seems that we can remove this check since
snd_hdmi_get_eld_ati() should return the correct ELD.
I'm going to apply the below.
thanks,
Takashi
---
From: Takashi Iwai <tiwai@suse.de>
Subject: [PATCH] ALSA: hda - Get rid of AMD HDMI exception in hdmi_present_sense()
Since the recent fake ELD patches, we can remove the check for AMD
HDMI in hdmi_present_sense() and decide the return value from
eld_valid value.
Suggested by Anssi Hannula.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
sound/pci/hda/patch_hdmi.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c
index a96403a828af..e68792311bb2 100644
--- a/sound/pci/hda/patch_hdmi.c
+++ b/sound/pci/hda/patch_hdmi.c
@@ -1561,10 +1561,7 @@ static bool hdmi_present_sense(struct hdmi_spec_per_pin *per_pin, int repoll)
SNDRV_CTL_EVENT_MASK_VALUE | SNDRV_CTL_EVENT_MASK_INFO,
&per_pin->eld_ctl->id);
unlock:
- if ((codec->vendor_id & 0xffff0000) == 0x10020000)
- ret = true; /* AMD codecs create ELD by itself */
- else
- ret = !repoll || !pin_eld->monitor_present || pin_eld->eld_valid;
+ ret = !repoll || !pin_eld->monitor_present || pin_eld->eld_valid;
jack = snd_hda_jack_tbl_get(codec, pin_nid);
if (jack)
--
1.8.4.2
next prev parent reply other threads:[~2013-11-07 15:43 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-07 12:38 [PATCH 0/3] ALSA: hda - Delay HDMI presence reports while waiting for ELD information David Henningsson
2013-11-07 12:38 ` [PATCH 1/3] " David Henningsson
2013-11-07 15:25 ` Anssi Hannula
2013-11-07 15:43 ` Takashi Iwai [this message]
2013-11-07 12:38 ` [PATCH 2/3] ALSA: hda - Add a block_report flag to jacks David Henningsson
2013-11-07 12:38 ` [PATCH 3/3] ALSA: hda - block HDMI jack reports while repolling David Henningsson
2013-11-07 13:22 ` [PATCH 0/3] ALSA: hda - Delay HDMI presence reports while waiting for ELD information Takashi Iwai
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=s5ha9hgtdy2.wl%tiwai@suse.de \
--to=tiwai@suse.de \
--cc=alsa-devel@alsa-project.org \
--cc=anssi.hannula@iki.fi \
--cc=david.henningsson@canonical.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;
as well as URLs for NNTP newsgroup(s).