Commit 0374ffa5 authored by Jani Nikula's avatar Jani Nikula

drm/edid: parse display info has_audio similar to is_hdmi

Since we already iterate everything that's needed for determining audio,
reduce the need to call drm_detect_monitor_audio() by storing has_audio
to connector info.
Reviewed-by: default avatarAnkit Nautiyal <ankit.k.nautiyal@intel.com>
Acked-by: default avatarThomas Zimmermann <tzimmermann@suse.de>
Signed-off-by: default avatarJani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/391a93b25c6bcbb39854aaa2813570cfb1580ed9.1685437500.git.jani.nikula@intel.com
parent 88e96644
......@@ -6243,6 +6243,9 @@ static void drm_parse_cea_ext(struct drm_connector *connector,
info->color_formats |= DRM_COLOR_FORMAT_YCBCR444;
if (edid_ext[3] & EDID_CEA_YCRCB422)
info->color_formats |= DRM_COLOR_FORMAT_YCBCR422;
if (edid_ext[3] & EDID_BASIC_AUDIO)
info->has_audio = true;
}
drm_edid_iter_end(&edid_iter);
......@@ -6268,6 +6271,8 @@ static void drm_parse_cea_ext(struct drm_connector *connector,
drm_parse_hdr_metadata_block(connector, data);
else if (cea_db_tag(db) == CTA_DB_VIDEO)
parse_cta_vdb(connector, db);
else if (cea_db_tag(db) == CTA_DB_AUDIO)
info->has_audio = true;
}
cea_db_iter_end(&iter);
......@@ -6424,6 +6429,7 @@ static void drm_reset_display_info(struct drm_connector *connector)
info->max_tmds_clock = 0;
info->dvi_dual = false;
info->is_hdmi = false;
info->has_audio = false;
info->has_hdmi_infoframe = false;
info->rgb_quant_range_selectable = false;
memset(&info->hdmi, 0, sizeof(info->hdmi));
......
......@@ -658,6 +658,14 @@ struct drm_display_info {
*/
bool is_hdmi;
/**
* @has_audio: True if the sink supports audio.
*
* This field shall be used instead of calling
* drm_detect_monitor_audio() when possible.
*/
bool has_audio;
/**
* @has_hdmi_infoframe: Does the sink support the HDMI infoframe?
*/
......
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