Skip to content

Commit

Permalink
drm/connector: hdmi: allow disabling Audio Infoframe
Browse files Browse the repository at this point in the history
Add drm_atomic_helper_connector_hdmi_disable_audio_infoframe(), an API
to allow the driver disable sending the Audio Infoframe. This is to be
used by the drivers if setup of the infoframes is not tightly coupled
with the audio functionality and just disabling the audio playback
doesn't stop the HDMI hardware from sending the Infoframe.

Acked-by: Maxime Ripard <mripard@kernel.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20240607-bridge-hdmi-connector-v5-1-ab384e6021af@linaro.org
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
  • Loading branch information
Dmitry Baryshkov committed Jun 12, 2024
1 parent 8e11b23 commit 000d194
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
36 changes: 36 additions & 0 deletions drivers/gpu/drm/display/drm_hdmi_state_helper.c
Original file line number Diff line number Diff line change
Expand Up @@ -714,3 +714,39 @@ drm_atomic_helper_connector_hdmi_update_audio_infoframe(struct drm_connector *co
return ret;
}
EXPORT_SYMBOL(drm_atomic_helper_connector_hdmi_update_audio_infoframe);

/**
* drm_atomic_helper_connector_hdmi_disable_audio_infoframe - Stop sending the Audio Infoframe
* @connector: A pointer to the HDMI connector
*
* This function is meant for HDMI connector drivers to stop sending their
* audio infoframe. It will typically be used in one of the ALSA hooks
* (most likely shutdown).
*
* Returns:
* Zero on success, error code on failure.
*/
int
drm_atomic_helper_connector_hdmi_disable_audio_infoframe(struct drm_connector *connector)
{
struct drm_connector_hdmi_infoframe *infoframe =
&connector->hdmi.infoframes.audio;
struct drm_display_info *info = &connector->display_info;
int ret;

if (!info->is_hdmi)
return 0;

mutex_lock(&connector->hdmi.infoframes.lock);

infoframe->set = false;

ret = clear_infoframe(connector, infoframe);

memset(&infoframe->data, 0, sizeof(infoframe->data));

mutex_unlock(&connector->hdmi.infoframes.lock);

return ret;
}
EXPORT_SYMBOL(drm_atomic_helper_connector_hdmi_disable_audio_infoframe);
1 change: 1 addition & 0 deletions include/drm/display/drm_hdmi_state_helper.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ int drm_atomic_helper_connector_hdmi_check(struct drm_connector *connector,

int drm_atomic_helper_connector_hdmi_update_audio_infoframe(struct drm_connector *connector,
struct hdmi_audio_infoframe *frame);
int drm_atomic_helper_connector_hdmi_disable_audio_infoframe(struct drm_connector *connector);
int drm_atomic_helper_connector_hdmi_update_infoframes(struct drm_connector *connector,
struct drm_atomic_state *state);

Expand Down

0 comments on commit 000d194

Please sign in to comment.