2022-05-16 21:40:32 +00:00
|
|
|
From f0206374000464f8284826d3bdc50b2fc7c5ea71 Mon Sep 17 00:00:00 2001
|
|
|
|
From: Dom Cobley <popcornmix@gmail.com>
|
|
|
|
Date: Fri, 10 Dec 2021 18:03:18 +0000
|
|
|
|
Subject: [PATCH] drm/vc4: 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: Dom Cobley <popcornmix@gmail.com>
|
|
|
|
---
|
|
|
|
drivers/gpu/drm/vc4/vc4_hdmi.c | 5 ++++-
|
|
|
|
drivers/gpu/drm/vc4/vc4_hdmi.h | 6 ++++++
|
|
|
|
2 files changed, 10 insertions(+), 1 deletion(-)
|
|
|
|
|
|
|
|
--- a/drivers/gpu/drm/vc4/vc4_hdmi.c
|
|
|
|
+++ b/drivers/gpu/drm/vc4/vc4_hdmi.c
|
2022-05-18 14:32:03 +00:00
|
|
|
@@ -685,6 +685,7 @@ static void vc4_hdmi_encoder_post_crtc_d
|
2022-05-16 21:40:32 +00:00
|
|
|
|
|
|
|
mutex_lock(&vc4_hdmi->mutex);
|
|
|
|
|
|
|
|
+ vc4_hdmi->output_enabled = false;
|
|
|
|
spin_lock_irqsave(&vc4_hdmi->hw_lock, flags);
|
|
|
|
|
|
|
|
HDMI_WRITE(HDMI_RAM_PACKET_CONFIG, 0);
|
2022-05-18 14:32:03 +00:00
|
|
|
@@ -1201,6 +1202,7 @@ static void vc4_hdmi_encoder_post_crtc_e
|
2022-05-16 21:40:32 +00:00
|
|
|
VC4_HDMI_RAM_PACKET_ENABLE);
|
|
|
|
|
|
|
|
spin_unlock_irqrestore(&vc4_hdmi->hw_lock, flags);
|
|
|
|
+ vc4_hdmi->output_enabled = true;
|
|
|
|
|
|
|
|
vc4_hdmi_set_infoframes(encoder);
|
|
|
|
}
|
2022-05-18 14:32:03 +00:00
|
|
|
@@ -1606,7 +1608,8 @@ static int vc4_hdmi_audio_prepare(struct
|
2022-05-16 21:40:32 +00:00
|
|
|
spin_unlock_irqrestore(&vc4_hdmi->hw_lock, flags);
|
|
|
|
|
|
|
|
memcpy(&vc4_hdmi->audio.infoframe, ¶ms->cea, sizeof(params->cea));
|
|
|
|
- vc4_hdmi_set_audio_infoframe(encoder);
|
|
|
|
+ if (vc4_hdmi->output_enabled)
|
|
|
|
+ vc4_hdmi_set_audio_infoframe(encoder);
|
|
|
|
|
|
|
|
mutex_unlock(&vc4_hdmi->mutex);
|
|
|
|
|
|
|
|
--- a/drivers/gpu/drm/vc4/vc4_hdmi.h
|
|
|
|
+++ b/drivers/gpu/drm/vc4/vc4_hdmi.h
|
|
|
|
@@ -209,6 +209,12 @@ struct vc4_hdmi {
|
|
|
|
struct drm_display_mode saved_adjusted_mode;
|
|
|
|
|
|
|
|
/**
|
|
|
|
+ * @output_enabled: Is the HDMI controller currently active?
|
|
|
|
+ * Protected by @mutex.
|
|
|
|
+ */
|
|
|
|
+ bool output_enabled;
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
* @scdc_enabled: Is the HDMI controller currently running with
|
|
|
|
* the scrambler on? Protected by @mutex.
|
|
|
|
*/
|