[PATCH 01/15] drm/i915/display: move audio funcs under audio sub-struct

Jani Nikula
2026-04-29T10:25:07Z

Move audio related functions under audio sub-struct of struct
intel_display.

The funcs sub-struct of struct intel_display seems unnecessary. Instead
of display->funcs.FEATURE, prefer display->FEATURE.funcs.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
drivers/gpu/drm/i915/display/intel_audio.c | 22 ++++++++-----------
.../gpu/drm/i915/display/intel_display_core.h | 6 ++---
.../gpu/drm/i915/display/intel_display_irq.c | 4 ++++
3 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_audio.c b/drivers/gpu/drm/i915/display/intel_audio.c
index 081627e0d917..2a6476ccc85b 100644
--- a/drivers/gpu/drm/i915/display/intel_audio.c
+++ b/drivers/gpu/drm/i915/display/intel_audio.c
@@ -754,10 +754,8 @@ void intel_audio_codec_enable(struct intel_encoder *encoder,
crtc->base.base.id, crtc->base.name,
drm_eld_size(crtc_state->eld));

- if (display->funcs.audio)
- display->funcs.audio->audio_codec_enable(encoder,
- crtc_state,
- conn_state);
+ if (display->audio.funcs)
+ display->audio.funcs->audio_codec_enable(encoder, crtc_state, conn_state);

mutex_lock(&display->audio.mutex);

@@ -813,10 +811,8 @@ void intel_audio_codec_disable(struct intel_encoder *encoder,
encoder->base.base.id, encoder->base.name,
crtc->base.base.id, crtc->base.name);

- if (display->funcs.audio)
- display->funcs.audio->audio_codec_disable(encoder,
- old_crtc_state,
- old_conn_state);
+ if (display->audio.funcs)
+ display->audio.funcs->audio_codec_disable(encoder, old_crtc_state, old_conn_state);

mutex_lock(&display->audio.mutex);

@@ -864,8 +860,8 @@ void intel_audio_codec_get_config(struct intel_encoder *encoder,
if (!crtc_state->has_audio)
return;

- if (display->funcs.audio)
- display->funcs.audio->audio_codec_get_config(encoder, crtc_state);
+ if (display->audio.funcs)
+ display->audio.funcs->audio_codec_get_config(encoder, crtc_state);
}

static const struct intel_audio_funcs g4x_audio_funcs = {
@@ -893,12 +889,12 @@ static const struct intel_audio_funcs hsw_audio_funcs = {
void intel_audio_hooks_init(struct intel_display *display)
{
if (display->platform.g4x)
- display->funcs.audio = &g4x_audio_funcs;
+ display->audio.funcs = &g4x_audio_funcs;
else if (display->platform.valleyview || display->platform.cherryview ||
HAS_PCH_CPT(display) || HAS_PCH_IBX(display))
- display->funcs.audio = &ibx_audio_funcs;
+ display->audio.funcs = &ibx_audio_funcs;
else if (display->platform.haswell || DISPLAY_VER(display) >= 8)
- display->funcs.audio = &hsw_audio_funcs;
+ display->audio.funcs = &hsw_audio_funcs;
}

struct aud_ts_cdclk_m_n {
diff --git a/drivers/gpu/drm/i915/display/intel_display_core.h b/drivers/gpu/drm/i915/display/intel_display_core.h
index c5a07090cba6..c61990ca9e29 100644
--- a/drivers/gpu/drm/i915/display/intel_display_core.h
+++ b/drivers/gpu/drm/i915/display/intel_display_core.h
@@ -100,6 +100,9 @@ struct intel_audio_state {
};

struct intel_audio {
+ /* internal display audio functions */
+ const struct intel_audio_funcs *funcs;
+
/* hda/i915 audio component */
struct i915_audio_component *component;
bool component_registered;
@@ -319,9 +322,6 @@ struct intel_display {

/* Display internal color functions */
const struct intel_color_funcs *color;
-
- /* Display internal audio functions */
- const struct intel_audio_funcs *audio;
} funcs;

struct {
diff --git a/drivers/gpu/drm/i915/display/intel_display_irq.c b/drivers/gpu/drm/i915/display/intel_display_irq.c
index 70c1bba7c0a8..b5bfdebc66ca 100644
--- a/drivers/gpu/drm/i915/display/intel_display_irq.c
+++ b/drivers/gpu/drm/i915/display/intel_display_irq.c
@@ -2458,6 +2458,10 @@ void dg1_de_irq_postinstall(struct intel_display *display)
intel_de_write(display, GEN11_DISPLAY_INT_CTL, GEN11_DISPLAY_IRQ_ENABLE);
}

+struct intel_display_irq_funcs {
+ void (*reset)(struct intel_display *display);
+};
+
void intel_display_irq_init(struct intel_display *display)
{
spin_lock_init(&display->irq.lock);
--
2.47.3