1 From 68522ed7c1135fd5ea5b4541d557bdbdcba80669 Mon Sep 17 00:00:00 2001
2 From: popcornmix <popcornmix@gmail.com>
3 Date: Wed, 8 Dec 2021 15:57:15 +0000
4 Subject: [PATCH] vc4/drm: Ignore vc4_hdmi->output_enabled for allowing
7 Otherwise we reject audio playback when switching hdmi modes
9 Signed-off-by: Dom Cobley <popcornmix@gmail.com>
11 drivers/gpu/drm/vc4/vc4_hdmi.c | 29 ++---------------------------
12 drivers/gpu/drm/vc4/vc4_hdmi.h | 6 ------
13 2 files changed, 2 insertions(+), 33 deletions(-)
15 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c
16 +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c
17 @@ -210,6 +210,7 @@ vc4_hdmi_connector_detect(struct drm_con
21 + vc4_hdmi->encoder.hdmi_monitor = false;
23 if (connector->status != connector_status_connected) {
24 struct edid *edid = drm_get_edid(connector, vc4_hdmi->ddc);
25 @@ -730,15 +731,6 @@ static void vc4_hdmi_encoder_post_crtc_p
26 mutex_unlock(&vc4_hdmi->mutex);
29 -static void vc4_hdmi_encoder_disable(struct drm_encoder *encoder)
31 - struct vc4_hdmi *vc4_hdmi = encoder_to_vc4_hdmi(encoder);
33 - mutex_lock(&vc4_hdmi->mutex);
34 - vc4_hdmi->output_enabled = false;
35 - mutex_unlock(&vc4_hdmi->mutex);
38 static void vc4_hdmi_csc_setup(struct vc4_hdmi *vc4_hdmi, bool enable)
41 @@ -1218,15 +1210,6 @@ static void vc4_hdmi_encoder_post_crtc_e
42 mutex_unlock(&vc4_hdmi->mutex);
45 -static void vc4_hdmi_encoder_enable(struct drm_encoder *encoder)
47 - struct vc4_hdmi *vc4_hdmi = encoder_to_vc4_hdmi(encoder);
49 - mutex_lock(&vc4_hdmi->mutex);
50 - vc4_hdmi->output_enabled = true;
51 - mutex_unlock(&vc4_hdmi->mutex);
54 static void vc4_hdmi_encoder_atomic_mode_set(struct drm_encoder *encoder,
55 struct drm_crtc_state *crtc_state,
56 struct drm_connector_state *conn_state)
57 @@ -1320,8 +1303,6 @@ static const struct drm_encoder_helper_f
58 .atomic_check = vc4_hdmi_encoder_atomic_check,
59 .atomic_mode_set = vc4_hdmi_encoder_atomic_mode_set,
60 .mode_valid = vc4_hdmi_encoder_mode_valid,
61 - .disable = vc4_hdmi_encoder_disable,
62 - .enable = vc4_hdmi_encoder_enable,
65 static u32 vc4_hdmi_channel_map(struct vc4_hdmi *vc4_hdmi, u32 channel_mask)
66 @@ -1421,16 +1402,10 @@ static bool vc4_hdmi_audio_can_stream(st
67 lockdep_assert_held(&vc4_hdmi->mutex);
70 - * If the controller is disabled, prevent any ALSA output.
72 - if (!vc4_hdmi->output_enabled)
76 * If the encoder is currently in DVI mode, treat the codec DAI
79 - if (!(HDMI_READ(HDMI_RAM_PACKET_CONFIG) & VC4_HDMI_RAM_PACKET_ENABLE))
80 + if (!vc4_hdmi->encoder.hdmi_monitor)
84 --- a/drivers/gpu/drm/vc4/vc4_hdmi.h
85 +++ b/drivers/gpu/drm/vc4/vc4_hdmi.h
86 @@ -209,12 +209,6 @@ struct vc4_hdmi {
87 struct drm_display_mode saved_adjusted_mode;
90 - * @output_enabled: Is the HDMI controller currently active?
91 - * Protected by @mutex.
93 - bool output_enabled;
96 * @scdc_enabled: Is the HDMI controller currently running with
97 * the scrambler on? Protected by @mutex.