Re: [PATCH 2/3] drm/i915: abstract ddi being audio enabled

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

 



On Mon, 28 Nov 2016, libin.yang@xxxxxxxxx wrote:
> From: Libin Yang <libin.yang@xxxxxxxxx>
>
> Prepare for using the same code for judging ddi being audio enabled.
> No functional changes.
>
> Signed-off-by: Libin Yang <libin.yang@xxxxxxxxx>
> Signed-off-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@xxxxxxxxx>
> Reviewed-by: Lyude <cpaul@xxxxxxxxxx>
> Signed-off-by: Rodrigo Vivi <rodrigo.vivi@xxxxxxxxx>

Same thing about Rodrigo's sob.

Reviewed-by: Jani Nikula <jani.nikula@xxxxxxxxx>

> ---
>  drivers/gpu/drm/i915/intel_ddi.c | 20 +++++++++++++++-----
>  drivers/gpu/drm/i915/intel_drv.h |  2 ++
>  2 files changed, 17 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_ddi.c b/drivers/gpu/drm/i915/intel_ddi.c
> index 0d680da..e5410be 100644
> --- a/drivers/gpu/drm/i915/intel_ddi.c
> +++ b/drivers/gpu/drm/i915/intel_ddi.c
> @@ -1950,6 +1950,19 @@ void intel_ddi_prepare_link_retrain(struct intel_dp *intel_dp)
>  	udelay(600);
>  }
>  
> +bool intel_ddi_is_audio_enabled(struct drm_i915_private *dev_priv,
> +				 struct intel_crtc *intel_crtc)
> +{
> +	u32 temp;
> +
> +	if (intel_display_power_is_enabled(dev_priv, POWER_DOMAIN_AUDIO)) {
> +		temp = I915_READ(HSW_AUD_PIN_ELD_CP_VLD);
> +		if (temp & AUDIO_OUTPUT_ENABLE(intel_crtc->pipe))
> +			return true;
> +	}
> +	return false;
> +}
> +
>  void intel_ddi_get_config(struct intel_encoder *encoder,
>  			  struct intel_crtc_state *pipe_config)
>  {
> @@ -2015,11 +2028,8 @@ void intel_ddi_get_config(struct intel_encoder *encoder,
>  		break;
>  	}
>  
> -	if (intel_display_power_is_enabled(dev_priv, POWER_DOMAIN_AUDIO)) {
> -		temp = I915_READ(HSW_AUD_PIN_ELD_CP_VLD);
> -		if (temp & AUDIO_OUTPUT_ENABLE(intel_crtc->pipe))
> -			pipe_config->has_audio = true;
> -	}
> +	pipe_config->has_audio =
> +		intel_ddi_is_audio_enabled(dev_priv, intel_crtc);
>  
>  	if (encoder->type == INTEL_OUTPUT_EDP && dev_priv->vbt.edp.bpp &&
>  	    pipe_config->pipe_bpp > dev_priv->vbt.edp.bpp) {
> diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
> index 9bbe5c5..9346660 100644
> --- a/drivers/gpu/drm/i915/intel_drv.h
> +++ b/drivers/gpu/drm/i915/intel_drv.h
> @@ -1175,6 +1175,8 @@ bool intel_ddi_pll_select(struct intel_crtc *crtc,
>  void intel_ddi_set_pipe_settings(struct drm_crtc *crtc);
>  void intel_ddi_prepare_link_retrain(struct intel_dp *intel_dp);
>  bool intel_ddi_connector_get_hw_state(struct intel_connector *intel_connector);
> +bool intel_ddi_is_audio_enabled(struct drm_i915_private *dev_priv,
> +				 struct intel_crtc *intel_crtc);
>  void intel_ddi_get_config(struct intel_encoder *encoder,
>  			  struct intel_crtc_state *pipe_config);
>  struct intel_encoder *

-- 
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://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