All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: Chris Wilson <chris@chris-wilson.co.uk>, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 4/5] drm/i915/hdmi: Refactor force_audio -> has_audio coupling
Date: Wed, 3 Sep 2014 10:48:36 +0200	[thread overview]
Message-ID: <20140903084836.GI15520@phenom.ffwll.local> (raw)
In-Reply-To: <20140902190820.GI25238@nuc-i3427.alporthouse.com>

On Tue, Sep 02, 2014 at 08:08:20PM +0100, Chris Wilson wrote:
> On Tue, Sep 02, 2014 at 08:04:02PM +0100, Chris Wilson wrote:
> > The routines for deciding whether we have audio (depending upon
> > force_audio and the associated EDID) are common between detection and
> > set-property. Refactor the code to remove the duplication.
> > 
> > Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> > ---
> >  drivers/gpu/drm/i915/intel_hdmi.c | 60 ++++++++++++++++++---------------------
> >  1 file changed, 27 insertions(+), 33 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/i915/intel_hdmi.c b/drivers/gpu/drm/i915/intel_hdmi.c
> > index 3b21a769ef54..ad7b523d39a8 100644
> > --- a/drivers/gpu/drm/i915/intel_hdmi.c
> > +++ b/drivers/gpu/drm/i915/intel_hdmi.c
> > @@ -976,6 +976,30 @@ intel_hdmi_unset_edid(struct drm_connector *connector)
> >  }
> >  
> >  static bool
> > +intel_hdmi_update_audio(struct drm_connector *connector)
> > +{
> > +	struct intel_hdmi *intel_hdmi = intel_attached_hdmi(connector);
> > +	struct edid *edid = to_intel_connector(connector)->detect_edid;
> > +	bool has_audio, has_sink;
> > +	bool changed = false;
> > +
> > +	if (intel_hdmi->force_audio == HDMI_AUDIO_AUTO)
> > +		has_audio = drm_detect_monitor_audio(edid);
> > +	else
> > +		has_audio = intel_hdmi->force_audio == HDMI_AUDIO_ON;
> > +	changed |= intel_hdmi->has_audio |= has_audio;
> 
> Oh dear, it is obviously time to give up.

Aside of that I like the general direction, since we need to refactor this
stuff a bit anyway to make Thomas' EDID injection work for audio. And
hopefully we'll have atomic modeset this century so that we can finally
ditch all that fragile "has this set_prop resulted in an actual change"
logic ...

Pulled in the first 3 patches from this series, thanks.
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch

  reply	other threads:[~2014-09-03  8:48 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-02 19:03 [PATCH 1/5] drm/i915/dp: Refactor common eDP lid detection Chris Wilson
2014-09-02 19:04 ` [PATCH 2/5] drm/i915/dp: Cache EDID for a detection cycle Chris Wilson
2014-09-03  8:23   ` Jani Nikula
2014-09-03  8:45     ` Daniel Vetter
2014-09-03  8:53     ` Chris Wilson
2014-09-03 10:47       ` Jani Nikula
2014-09-02 19:04 ` [PATCH 3/5] drm/i915/hdmi: " Chris Wilson
2014-09-02 19:04 ` [PATCH 4/5] drm/i915/hdmi: Refactor force_audio -> has_audio coupling Chris Wilson
2014-09-02 19:08   ` Chris Wilson
2014-09-03  8:48     ` Daniel Vetter [this message]
2014-09-02 19:04 ` [PATCH 5/5] drm/i915/dp: " 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=20140903084836.GI15520@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --cc=chris@chris-wilson.co.uk \
    --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.