From: Daniel Vetter Subject: Re: [PATCH v3 2/2] drm/i915/hsw: add flag has_audio in crtc config Date: Tue, 24 Sep 2013 14:48:12 +0200 Message-ID: <20130924124812.GR13668@phenom.ffwll.local> References: <1379998897-9997-1-git-send-email-mengdong.lin@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail-ea0-f172.google.com (mail-ea0-f172.google.com [209.85.215.172]) by gabe.freedesktop.org (Postfix) with ESMTP id 87C9EE75F0 for ; Tue, 24 Sep 2013 05:47:59 -0700 (PDT) Received: by mail-ea0-f172.google.com with SMTP id r16so2477505ead.31 for ; Tue, 24 Sep 2013 05:47:58 -0700 (PDT) Content-Disposition: inline In-Reply-To: <1379998897-9997-1-git-send-email-mengdong.lin@intel.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org To: mengdong.lin@intel.com Cc: intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org On Tue, Sep 24, 2013 at 01:01:37AM -0400, mengdong.lin@intel.com wrote: > From: Mengdong Lin > > This patch adds a flag "has_audio" for audio presence in intel_crtc->config. > HMDI and DP encoders set this flag in their computer_config() if the external > monitor supports audio. Later audio sequence will check this flag. > > Signed-off-by: Mengdong Lin [snip] > diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c > index 26e162b..4bc125e 100644 > --- a/drivers/gpu/drm/i915/intel_dp.c > +++ b/drivers/gpu/drm/i915/intel_dp.c > @@ -764,6 +764,8 @@ found: > > intel_dp_set_clock(encoder, pipe_config, intel_dp->link_bw); > > + pipe_config->has_audio = intel_dp->has_audio; > + This should only be set when we actually have an audio-capable monitor and want to enable the audio output on the port. Furthermore you need to add hw state readout support for this boolean to haswell_get_pipe_config and also the relevant state check code to intel_pipe_config_compare (by adding PIPE_CONF_CHECK_I(has_audio)). Same applies to the intel_hdmi.c part ofc. Cheers, Daniel > return true; > } > > diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h > index b7d6e09..2bdc23c 100644 > --- a/drivers/gpu/drm/i915/intel_drv.h > +++ b/drivers/gpu/drm/i915/intel_drv.h > @@ -290,6 +290,7 @@ struct intel_crtc_config { > struct intel_link_m_n fdi_m_n; > > bool ips_enabled; > + bool has_audio; > }; > > struct intel_crtc { > @@ -303,7 +304,6 @@ struct intel_crtc { > * some outputs connected to this crtc. > */ > bool active; > - bool eld_vld; > bool primary_disabled; /* is the crtc obscured by a plane? */ > bool lowfreq_avail; > struct intel_overlay *overlay; > diff --git a/drivers/gpu/drm/i915/intel_hdmi.c b/drivers/gpu/drm/i915/intel_hdmi.c > index 2fd3fd5..09c9d69 100644 > --- a/drivers/gpu/drm/i915/intel_hdmi.c > +++ b/drivers/gpu/drm/i915/intel_hdmi.c > @@ -864,6 +864,8 @@ bool intel_hdmi_compute_config(struct intel_encoder *encoder, > return false; > } > > + pipe_config->has_audio = intel_hdmi->has_audio; > + > return true; > } > > -- > 1.8.1.2 > > _______________________________________________ > Intel-gfx mailing list > Intel-gfx@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/intel-gfx -- Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch