Commit 8ec47de2 authored by Ville Syrjälä's avatar Ville Syrjälä

drm/i915: Pass around crtc and connector states for audio

Explicitly pass the crtc and connector states into the audio
code enable/disable hooks, and plumb them all the way down.

This gets rid of almost all crtc->config and encoder->crtc
uses. The one place where we still use them is
i915_audio_component_sync_audio_rate() since that gets called from
the audio driver and we don't have explicit states around then.

Cc: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20171030184654.17429-1-ville.syrjala@linux.intel.comReviewed-by: default avatarJani Nikula <jani.nikula@intel.com>
parent 4ab09d0e
...@@ -726,10 +726,12 @@ struct drm_i915_display_funcs { ...@@ -726,10 +726,12 @@ struct drm_i915_display_funcs {
void (*crtc_disable)(struct intel_crtc_state *old_crtc_state, void (*crtc_disable)(struct intel_crtc_state *old_crtc_state,
struct drm_atomic_state *old_state); struct drm_atomic_state *old_state);
void (*update_crtcs)(struct drm_atomic_state *state); void (*update_crtcs)(struct drm_atomic_state *state);
void (*audio_codec_enable)(struct drm_connector *connector, void (*audio_codec_enable)(struct intel_encoder *encoder,
struct intel_encoder *encoder, const struct intel_crtc_state *crtc_state,
const struct drm_display_mode *adjusted_mode); const struct drm_connector_state *conn_state);
void (*audio_codec_disable)(struct intel_encoder *encoder); void (*audio_codec_disable)(struct intel_encoder *encoder,
const struct intel_crtc_state *old_crtc_state,
const struct drm_connector_state *old_conn_state);
void (*fdi_link_train)(struct intel_crtc *crtc, void (*fdi_link_train)(struct intel_crtc *crtc,
const struct intel_crtc_state *crtc_state); const struct intel_crtc_state *crtc_state);
void (*init_clock_gating)(struct drm_i915_private *dev_priv); void (*init_clock_gating)(struct drm_i915_private *dev_priv);
......
This diff is collapsed.
...@@ -2425,7 +2425,8 @@ static void intel_disable_ddi_dp(struct intel_encoder *encoder, ...@@ -2425,7 +2425,8 @@ static void intel_disable_ddi_dp(struct intel_encoder *encoder,
struct intel_dp *intel_dp = enc_to_intel_dp(&encoder->base); struct intel_dp *intel_dp = enc_to_intel_dp(&encoder->base);
if (old_crtc_state->has_audio) if (old_crtc_state->has_audio)
intel_audio_codec_disable(encoder); intel_audio_codec_disable(encoder,
old_crtc_state, old_conn_state);
intel_edp_drrs_disable(intel_dp, old_crtc_state); intel_edp_drrs_disable(intel_dp, old_crtc_state);
intel_psr_disable(intel_dp, old_crtc_state); intel_psr_disable(intel_dp, old_crtc_state);
...@@ -2437,7 +2438,8 @@ static void intel_disable_ddi_hdmi(struct intel_encoder *encoder, ...@@ -2437,7 +2438,8 @@ static void intel_disable_ddi_hdmi(struct intel_encoder *encoder,
const struct drm_connector_state *old_conn_state) const struct drm_connector_state *old_conn_state)
{ {
if (old_crtc_state->has_audio) if (old_crtc_state->has_audio)
intel_audio_codec_disable(encoder); intel_audio_codec_disable(encoder,
old_crtc_state, old_conn_state);
intel_hdmi_handle_sink_scrambling(encoder, intel_hdmi_handle_sink_scrambling(encoder,
old_conn_state->connector, old_conn_state->connector,
......
...@@ -2708,7 +2708,8 @@ static void intel_disable_dp(struct intel_encoder *encoder, ...@@ -2708,7 +2708,8 @@ static void intel_disable_dp(struct intel_encoder *encoder,
struct intel_dp *intel_dp = enc_to_intel_dp(&encoder->base); struct intel_dp *intel_dp = enc_to_intel_dp(&encoder->base);
if (old_crtc_state->has_audio) if (old_crtc_state->has_audio)
intel_audio_codec_disable(encoder); intel_audio_codec_disable(encoder,
old_crtc_state, old_conn_state);
/* Make sure the panel is off before trying to change the mode. But also /* Make sure the panel is off before trying to change the mode. But also
* ensure that we have vdd while we switch off the panel. */ * ensure that we have vdd while we switch off the panel. */
......
...@@ -149,7 +149,8 @@ static void intel_mst_disable_dp(struct intel_encoder *encoder, ...@@ -149,7 +149,8 @@ static void intel_mst_disable_dp(struct intel_encoder *encoder,
DRM_ERROR("failed to update payload %d\n", ret); DRM_ERROR("failed to update payload %d\n", ret);
} }
if (old_crtc_state->has_audio) if (old_crtc_state->has_audio)
intel_audio_codec_disable(encoder); intel_audio_codec_disable(encoder,
old_crtc_state, old_conn_state);
} }
static void intel_mst_post_disable_dp(struct intel_encoder *encoder, static void intel_mst_post_disable_dp(struct intel_encoder *encoder,
......
...@@ -1311,7 +1311,9 @@ void intel_init_audio_hooks(struct drm_i915_private *dev_priv); ...@@ -1311,7 +1311,9 @@ void intel_init_audio_hooks(struct drm_i915_private *dev_priv);
void intel_audio_codec_enable(struct intel_encoder *encoder, void intel_audio_codec_enable(struct intel_encoder *encoder,
const struct intel_crtc_state *crtc_state, const struct intel_crtc_state *crtc_state,
const struct drm_connector_state *conn_state); const struct drm_connector_state *conn_state);
void intel_audio_codec_disable(struct intel_encoder *encoder); void intel_audio_codec_disable(struct intel_encoder *encoder,
const struct intel_crtc_state *old_crtc_state,
const struct drm_connector_state *old_conn_state);
void i915_audio_component_init(struct drm_i915_private *dev_priv); void i915_audio_component_init(struct drm_i915_private *dev_priv);
void i915_audio_component_cleanup(struct drm_i915_private *dev_priv); void i915_audio_component_cleanup(struct drm_i915_private *dev_priv);
void intel_audio_init(struct drm_i915_private *dev_priv); void intel_audio_init(struct drm_i915_private *dev_priv);
......
...@@ -1206,7 +1206,8 @@ static void g4x_disable_hdmi(struct intel_encoder *encoder, ...@@ -1206,7 +1206,8 @@ static void g4x_disable_hdmi(struct intel_encoder *encoder,
const struct drm_connector_state *old_conn_state) const struct drm_connector_state *old_conn_state)
{ {
if (old_crtc_state->has_audio) if (old_crtc_state->has_audio)
intel_audio_codec_disable(encoder); intel_audio_codec_disable(encoder,
old_crtc_state, old_conn_state);
intel_disable_hdmi(encoder, old_crtc_state, old_conn_state); intel_disable_hdmi(encoder, old_crtc_state, old_conn_state);
} }
...@@ -1216,7 +1217,8 @@ static void pch_disable_hdmi(struct intel_encoder *encoder, ...@@ -1216,7 +1217,8 @@ static void pch_disable_hdmi(struct intel_encoder *encoder,
const struct drm_connector_state *old_conn_state) const struct drm_connector_state *old_conn_state)
{ {
if (old_crtc_state->has_audio) if (old_crtc_state->has_audio)
intel_audio_codec_disable(encoder); intel_audio_codec_disable(encoder,
old_crtc_state, old_conn_state);
} }
static void pch_post_disable_hdmi(struct intel_encoder *encoder, static void pch_post_disable_hdmi(struct intel_encoder *encoder,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment