aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorLibin Yang <libin.yang@intel.com>2016-11-28 07:07:06 -0500
committerJani Nikula <jani.nikula@intel.com>2016-11-29 10:41:46 -0500
commit9935f7fa2854355203e3976762eecfb218079aac (patch)
tree0033c2fe603c8f61c91ef1b642ce916bb1cebe9c /drivers
parent9a148a96fc3a654ddcf142a7ab7db37b972ba5d8 (diff)
drm/i915: abstract ddi being audio enabled
Prepare for using the same code for judging ddi being audio enabled. No functional changes. Signed-off-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com> Signed-off-by: Libin Yang <libin.yang@intel.com> Reviewed-by: Lyude <cpaul@redhat.com> Reviewed-by: Jani Nikula <jani.nikula@intel.com> Signed-off-by: Jani Nikula <jani.nikula@intel.com> Link: http://patchwork.freedesktop.org/patch/msgid/1480334827-112273-2-git-send-email-libin.yang@intel.com
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpu/drm/i915/intel_ddi.c20
-rw-r--r--drivers/gpu/drm/i915/intel_drv.h2
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 f8e939d17160..8b47efa37e47 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)
1950 udelay(600); 1950 udelay(600);
1951} 1951}
1952 1952
1953bool intel_ddi_is_audio_enabled(struct drm_i915_private *dev_priv,
1954 struct intel_crtc *intel_crtc)
1955{
1956 u32 temp;
1957
1958 if (intel_display_power_is_enabled(dev_priv, POWER_DOMAIN_AUDIO)) {
1959 temp = I915_READ(HSW_AUD_PIN_ELD_CP_VLD);
1960 if (temp & AUDIO_OUTPUT_ENABLE(intel_crtc->pipe))
1961 return true;
1962 }
1963 return false;
1964}
1965
1953void intel_ddi_get_config(struct intel_encoder *encoder, 1966void intel_ddi_get_config(struct intel_encoder *encoder,
1954 struct intel_crtc_state *pipe_config) 1967 struct intel_crtc_state *pipe_config)
1955{ 1968{
@@ -2015,11 +2028,8 @@ void intel_ddi_get_config(struct intel_encoder *encoder,
2015 break; 2028 break;
2016 } 2029 }
2017 2030
2018 if (intel_display_power_is_enabled(dev_priv, POWER_DOMAIN_AUDIO)) { 2031 pipe_config->has_audio =
2019 temp = I915_READ(HSW_AUD_PIN_ELD_CP_VLD); 2032 intel_ddi_is_audio_enabled(dev_priv, intel_crtc);
2020 if (temp & AUDIO_OUTPUT_ENABLE(intel_crtc->pipe))
2021 pipe_config->has_audio = true;
2022 }
2023 2033
2024 if (encoder->type == INTEL_OUTPUT_EDP && dev_priv->vbt.edp.bpp && 2034 if (encoder->type == INTEL_OUTPUT_EDP && dev_priv->vbt.edp.bpp &&
2025 pipe_config->pipe_bpp > dev_priv->vbt.edp.bpp) { 2035 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 7f43c2f7d9d6..460f3742ebd7 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,
1175void intel_ddi_set_pipe_settings(struct drm_crtc *crtc); 1175void intel_ddi_set_pipe_settings(struct drm_crtc *crtc);
1176void intel_ddi_prepare_link_retrain(struct intel_dp *intel_dp); 1176void intel_ddi_prepare_link_retrain(struct intel_dp *intel_dp);
1177bool intel_ddi_connector_get_hw_state(struct intel_connector *intel_connector); 1177bool intel_ddi_connector_get_hw_state(struct intel_connector *intel_connector);
1178bool intel_ddi_is_audio_enabled(struct drm_i915_private *dev_priv,
1179 struct intel_crtc *intel_crtc);
1178void intel_ddi_get_config(struct intel_encoder *encoder, 1180void intel_ddi_get_config(struct intel_encoder *encoder,
1179 struct intel_crtc_state *pipe_config); 1181 struct intel_crtc_state *pipe_config);
1180struct intel_encoder * 1182struct intel_encoder *