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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxxxxxx>
> ---
>  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.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux