Skip to content

Commit 07e823c

Browse files
committed
drm/i915: Implement audio fastset
There's no real reason why we'd need a full modeset for audio changes. So let's allow audio to be toggled during fastset. In case the ELD changes while has_audio isn't changing state we force both audio disable and enable so the new ELD gets propagated to the audio driver. Reviewed-by: Jani Nikula <jani.nikula@intel.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20231121054324.9988-12-ville.syrjala@linux.intel.com
1 parent 109e1e8 commit 07e823c

1 file changed

Lines changed: 10 additions & 22 deletions

File tree

drivers/gpu/drm/i915/display/intel_display.c

Lines changed: 10 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -995,7 +995,9 @@ static bool audio_enabling(const struct intel_crtc_state *old_crtc_state,
995995
if (!new_crtc_state->hw.active)
996996
return false;
997997

998-
return is_enabling(has_audio, old_crtc_state, new_crtc_state);
998+
return is_enabling(has_audio, old_crtc_state, new_crtc_state) ||
999+
(new_crtc_state->has_audio &&
1000+
memcmp(old_crtc_state->eld, new_crtc_state->eld, MAX_ELD_BYTES) != 0);
9991001
}
10001002

10011003
static bool audio_disabling(const struct intel_crtc_state *old_crtc_state,
@@ -1004,7 +1006,9 @@ static bool audio_disabling(const struct intel_crtc_state *old_crtc_state,
10041006
if (!old_crtc_state->hw.active)
10051007
return false;
10061008

1007-
return is_disabling(has_audio, old_crtc_state, new_crtc_state);
1009+
return is_disabling(has_audio, old_crtc_state, new_crtc_state) ||
1010+
(old_crtc_state->has_audio &&
1011+
memcmp(old_crtc_state->eld, new_crtc_state->eld, MAX_ELD_BYTES) != 0);
10081012
}
10091013

10101014
#undef is_disabling
@@ -4956,23 +4960,6 @@ intel_pipe_config_compare(const struct intel_crtc_state *current_config,
49564960
} \
49574961
} while (0)
49584962

4959-
/*
4960-
* Checks state where we only read out the enabling, but not the entire
4961-
* state itself (like full infoframes or ELD for audio). These states
4962-
* require a full modeset on bootup to fix up.
4963-
*/
4964-
#define PIPE_CONF_CHECK_BOOL_INCOMPLETE(name) do { \
4965-
if (!fixup_inherited || (!current_config->name && !pipe_config->name)) { \
4966-
PIPE_CONF_CHECK_BOOL(name); \
4967-
} else { \
4968-
pipe_config_mismatch(fastset, crtc, __stringify(name), \
4969-
"unable to verify whether state matches exactly, forcing modeset (expected %s, found %s)", \
4970-
str_yes_no(current_config->name), \
4971-
str_yes_no(pipe_config->name)); \
4972-
ret = false; \
4973-
} \
4974-
} while (0)
4975-
49764963
#define PIPE_CONF_CHECK_P(name) do { \
49774964
if (current_config->name != pipe_config->name) { \
49784965
pipe_config_mismatch(fastset, crtc, __stringify(name), \
@@ -5160,8 +5147,10 @@ intel_pipe_config_compare(const struct intel_crtc_state *current_config,
51605147
PIPE_CONF_CHECK_BOOL(enhanced_framing);
51615148
PIPE_CONF_CHECK_BOOL(fec_enable);
51625149

5163-
PIPE_CONF_CHECK_BOOL_INCOMPLETE(has_audio);
5164-
PIPE_CONF_CHECK_BUFFER(eld, MAX_ELD_BYTES);
5150+
if (!fastset) {
5151+
PIPE_CONF_CHECK_BOOL(has_audio);
5152+
PIPE_CONF_CHECK_BUFFER(eld, MAX_ELD_BYTES);
5153+
}
51655154

51665155
PIPE_CONF_CHECK_X(gmch_pfit.control);
51675156
/* pfit ratios are autocomputed by the hw on gen4+ */
@@ -5331,7 +5320,6 @@ intel_pipe_config_compare(const struct intel_crtc_state *current_config,
53315320
#undef PIPE_CONF_CHECK_X
53325321
#undef PIPE_CONF_CHECK_I
53335322
#undef PIPE_CONF_CHECK_BOOL
5334-
#undef PIPE_CONF_CHECK_BOOL_INCOMPLETE
53355323
#undef PIPE_CONF_CHECK_P
53365324
#undef PIPE_CONF_CHECK_FLAGS
53375325
#undef PIPE_CONF_CHECK_COLOR_LUT

0 commit comments

Comments
 (0)