[Intel-gfx] [PATCH 4/5] drm/i915/hdmi: Refactor force_audio -> has_audio coupling

Daniel Vetter daniel at ffwll.ch
Wed Sep 3 10:48:36 CEST 2014


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 at 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



More information about the Intel-gfx mailing list