Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion drivers/gpu/drm/vc4/vc4_hdmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -692,6 +692,7 @@ static void vc4_hdmi_encoder_post_crtc_disable(struct drm_encoder *encoder,

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);
Expand Down Expand Up @@ -1201,6 +1202,7 @@ static void vc4_hdmi_encoder_post_crtc_enable(struct drm_encoder *encoder,
VC4_HDMI_RAM_PACKET_ENABLE);

spin_unlock_irqrestore(&vc4_hdmi->hw_lock, flags);
vc4_hdmi->output_enabled = true;

vc4_hdmi_set_infoframes(encoder);
}
Expand Down Expand Up @@ -1639,7 +1641,8 @@ static int vc4_hdmi_audio_prepare(struct device *dev, void *data,
spin_unlock_irqrestore(&vc4_hdmi->hw_lock, flags);

memcpy(&vc4_hdmi->audio.infoframe, &params->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);

Expand Down
6 changes: 6 additions & 0 deletions drivers/gpu/drm/vc4/vc4_hdmi.h
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,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.
Expand Down