Commit 7b75709a authored by Dave Airlie's avatar Dave Airlie Committed by Jani Nikula

drm/i915: split audio functions from display vtable

These are only used internally in the audio code
Reviewed-by: default avatarJani Nikula <jani.nikula@intel.com>
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
Signed-off-by: default avatarJani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/d12257cc7685a9b52618f7da444ba1fc8848b4db.1632869550.git.jani.nikula@intel.com
parent 082800ab
...@@ -848,8 +848,8 @@ void intel_audio_codec_enable(struct intel_encoder *encoder, ...@@ -848,8 +848,8 @@ void intel_audio_codec_enable(struct intel_encoder *encoder,
connector->eld[6] = drm_av_sync_delay(connector, adjusted_mode) / 2; connector->eld[6] = drm_av_sync_delay(connector, adjusted_mode) / 2;
if (dev_priv->display.audio_codec_enable) if (dev_priv->audio_funcs.audio_codec_enable)
dev_priv->display.audio_codec_enable(encoder, dev_priv->audio_funcs.audio_codec_enable(encoder,
crtc_state, crtc_state,
conn_state); conn_state);
...@@ -893,8 +893,8 @@ void intel_audio_codec_disable(struct intel_encoder *encoder, ...@@ -893,8 +893,8 @@ void intel_audio_codec_disable(struct intel_encoder *encoder,
enum port port = encoder->port; enum port port = encoder->port;
enum pipe pipe = crtc->pipe; enum pipe pipe = crtc->pipe;
if (dev_priv->display.audio_codec_disable) if (dev_priv->audio_funcs.audio_codec_disable)
dev_priv->display.audio_codec_disable(encoder, dev_priv->audio_funcs.audio_codec_disable(encoder,
old_crtc_state, old_crtc_state,
old_conn_state); old_conn_state);
...@@ -922,17 +922,17 @@ void intel_audio_codec_disable(struct intel_encoder *encoder, ...@@ -922,17 +922,17 @@ void intel_audio_codec_disable(struct intel_encoder *encoder,
void intel_init_audio_hooks(struct drm_i915_private *dev_priv) void intel_init_audio_hooks(struct drm_i915_private *dev_priv)
{ {
if (IS_G4X(dev_priv)) { if (IS_G4X(dev_priv)) {
dev_priv->display.audio_codec_enable = g4x_audio_codec_enable; dev_priv->audio_funcs.audio_codec_enable = g4x_audio_codec_enable;
dev_priv->display.audio_codec_disable = g4x_audio_codec_disable; dev_priv->audio_funcs.audio_codec_disable = g4x_audio_codec_disable;
} else if (IS_VALLEYVIEW(dev_priv) || IS_CHERRYVIEW(dev_priv)) { } else if (IS_VALLEYVIEW(dev_priv) || IS_CHERRYVIEW(dev_priv)) {
dev_priv->display.audio_codec_enable = ilk_audio_codec_enable; dev_priv->audio_funcs.audio_codec_enable = ilk_audio_codec_enable;
dev_priv->display.audio_codec_disable = ilk_audio_codec_disable; dev_priv->audio_funcs.audio_codec_disable = ilk_audio_codec_disable;
} else if (IS_HASWELL(dev_priv) || DISPLAY_VER(dev_priv) >= 8) { } else if (IS_HASWELL(dev_priv) || DISPLAY_VER(dev_priv) >= 8) {
dev_priv->display.audio_codec_enable = hsw_audio_codec_enable; dev_priv->audio_funcs.audio_codec_enable = hsw_audio_codec_enable;
dev_priv->display.audio_codec_disable = hsw_audio_codec_disable; dev_priv->audio_funcs.audio_codec_disable = hsw_audio_codec_disable;
} else if (HAS_PCH_SPLIT(dev_priv)) { } else if (HAS_PCH_SPLIT(dev_priv)) {
dev_priv->display.audio_codec_enable = ilk_audio_codec_enable; dev_priv->audio_funcs.audio_codec_enable = ilk_audio_codec_enable;
dev_priv->display.audio_codec_disable = ilk_audio_codec_disable; dev_priv->audio_funcs.audio_codec_disable = ilk_audio_codec_disable;
} }
} }
......
...@@ -364,6 +364,15 @@ struct intel_color_funcs { ...@@ -364,6 +364,15 @@ struct intel_color_funcs {
void (*read_luts)(struct intel_crtc_state *crtc_state); void (*read_luts)(struct intel_crtc_state *crtc_state);
}; };
struct intel_audio_funcs {
void (*audio_codec_enable)(struct intel_encoder *encoder,
const struct intel_crtc_state *crtc_state,
const struct drm_connector_state *conn_state);
void (*audio_codec_disable)(struct intel_encoder *encoder,
const struct intel_crtc_state *old_crtc_state,
const struct drm_connector_state *old_conn_state);
};
struct drm_i915_display_funcs { struct drm_i915_display_funcs {
void (*get_cdclk)(struct drm_i915_private *dev_priv, void (*get_cdclk)(struct drm_i915_private *dev_priv,
struct intel_cdclk_config *cdclk_config); struct intel_cdclk_config *cdclk_config);
...@@ -386,12 +395,7 @@ struct drm_i915_display_funcs { ...@@ -386,12 +395,7 @@ struct drm_i915_display_funcs {
struct intel_crtc *crtc); struct intel_crtc *crtc);
void (*commit_modeset_enables)(struct intel_atomic_state *state); void (*commit_modeset_enables)(struct intel_atomic_state *state);
void (*commit_modeset_disables)(struct intel_atomic_state *state); void (*commit_modeset_disables)(struct intel_atomic_state *state);
void (*audio_codec_enable)(struct intel_encoder *encoder,
const struct intel_crtc_state *crtc_state,
const struct drm_connector_state *conn_state);
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 (*hpd_irq_setup)(struct drm_i915_private *dev_priv); void (*hpd_irq_setup)(struct drm_i915_private *dev_priv);
...@@ -977,6 +981,9 @@ struct drm_i915_private { ...@@ -977,6 +981,9 @@ struct drm_i915_private {
/* Display internal color functions */ /* Display internal color functions */
struct intel_color_funcs color_funcs; struct intel_color_funcs color_funcs;
/* Display internal audio functions */
struct intel_audio_funcs audio_funcs;
/* PCH chipset type */ /* PCH chipset type */
enum intel_pch pch_type; enum intel_pch pch_type;
unsigned short pch_id; unsigned short pch_id;
......
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