mirror of
https://github.com/torvalds/linux.git
synced 2026-05-24 23:22:31 +02:00
drm/i915/audio: use eld_mutex to protect access to connector->eld
Reading access to connector->eld can happen at the same time the drm_edid_to_eld() updates the data. Take the newly added eld_mutex in order to protect connector->eld from concurrent access. Reviewed-by: Maxime Ripard <mripard@kernel.org> Reviewed-by: Jani Nikula <jani.nikula@intel.com> Acked-by: Jani Nikula <jani.nikula@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20241206-drm-connector-eld-mutex-v2-6-c9bce1ee8bea@linaro.org Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
This commit is contained in:
parent
5e8436d334
commit
5db44dd152
|
|
@ -699,10 +699,12 @@ bool intel_audio_compute_config(struct intel_encoder *encoder,
|
|||
const struct drm_display_mode *adjusted_mode =
|
||||
&crtc_state->hw.adjusted_mode;
|
||||
|
||||
mutex_lock(&connector->eld_mutex);
|
||||
if (!connector->eld[0]) {
|
||||
drm_dbg_kms(&i915->drm,
|
||||
"Bogus ELD on [CONNECTOR:%d:%s]\n",
|
||||
connector->base.id, connector->name);
|
||||
mutex_unlock(&connector->eld_mutex);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -710,6 +712,7 @@ bool intel_audio_compute_config(struct intel_encoder *encoder,
|
|||
memcpy(crtc_state->eld, connector->eld, sizeof(crtc_state->eld));
|
||||
|
||||
crtc_state->eld[6] = drm_av_sync_delay(connector, adjusted_mode) / 2;
|
||||
mutex_unlock(&connector->eld_mutex);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user