Commit 4ae3d6c0 authored by Dom Cobley's avatar Dom Cobley Committed by Maxime Ripard

drm/vc4: hdmi: Skip writes to disabled packet RAM

This path actually occurs when audio is started during a hdmi mode set.
As the data will be written by vc4_hdmi_set_infoframes when packet RAM
is enabled again, don't treat as an error
Signed-off-by: default avatarDom Cobley <popcornmix@gmail.com>
Link: https://lore.kernel.org/r/20220613144800.326124-26-maxime@cerno.techSigned-off-by: default avatarMaxime Ripard <maxime@cerno.tech>
parent 05954270
...@@ -602,6 +602,8 @@ static void vc4_hdmi_set_audio_infoframe(struct drm_encoder *encoder) ...@@ -602,6 +602,8 @@ static void vc4_hdmi_set_audio_infoframe(struct drm_encoder *encoder)
union hdmi_infoframe frame; union hdmi_infoframe frame;
memcpy(&frame.audio, audio, sizeof(*audio)); memcpy(&frame.audio, audio, sizeof(*audio));
if (vc4_hdmi->packet_ram_enabled)
vc4_hdmi_write_infoframe(encoder, &frame); vc4_hdmi_write_infoframe(encoder, &frame);
} }
...@@ -742,6 +744,8 @@ static void vc4_hdmi_encoder_post_crtc_disable(struct drm_encoder *encoder, ...@@ -742,6 +744,8 @@ static void vc4_hdmi_encoder_post_crtc_disable(struct drm_encoder *encoder,
mutex_lock(&vc4_hdmi->mutex); mutex_lock(&vc4_hdmi->mutex);
vc4_hdmi->packet_ram_enabled = false;
spin_lock_irqsave(&vc4_hdmi->hw_lock, flags); spin_lock_irqsave(&vc4_hdmi->hw_lock, flags);
HDMI_WRITE(HDMI_RAM_PACKET_CONFIG, 0); HDMI_WRITE(HDMI_RAM_PACKET_CONFIG, 0);
...@@ -1352,6 +1356,7 @@ static void vc4_hdmi_encoder_post_crtc_enable(struct drm_encoder *encoder, ...@@ -1352,6 +1356,7 @@ static void vc4_hdmi_encoder_post_crtc_enable(struct drm_encoder *encoder,
VC4_HDMI_RAM_PACKET_ENABLE); VC4_HDMI_RAM_PACKET_ENABLE);
spin_unlock_irqrestore(&vc4_hdmi->hw_lock, flags); spin_unlock_irqrestore(&vc4_hdmi->hw_lock, flags);
vc4_hdmi->packet_ram_enabled = true;
vc4_hdmi_set_infoframes(encoder); vc4_hdmi_set_infoframes(encoder);
} }
......
...@@ -212,6 +212,12 @@ struct vc4_hdmi { ...@@ -212,6 +212,12 @@ struct vc4_hdmi {
*/ */
struct drm_display_mode saved_adjusted_mode; struct drm_display_mode saved_adjusted_mode;
/**
* @packet_ram_enabled: Is the HDMI controller packet RAM currently
* on? Protected by @mutex.
*/
bool packet_ram_enabled;
/** /**
* @scdc_enabled: Is the HDMI controller currently running with * @scdc_enabled: Is the HDMI controller currently running with
* the scrambler on? Protected by @mutex. * the scrambler on? Protected by @mutex.
......
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