Skip to content

Commit

Permalink
drm/edid: parse display info has_audio similar to is_hdmi
Browse files Browse the repository at this point in the history
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: Ankit Nautiyal <[email protected]>
Acked-by: Thomas Zimmermann <[email protected]>
Signed-off-by: Jani Nikula <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/391a93b25c6bcbb39854aaa2813570cfb1580ed9.1685437500.git.jani.nikula@intel.com
  • Loading branch information
jnikula committed Jun 2, 2023
1 parent 88e9664 commit 0374ffa
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
6 changes: 6 additions & 0 deletions drivers/gpu/drm/drm_edid.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -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);

Expand Down Expand Up @@ -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));
Expand Down
8 changes: 8 additions & 0 deletions include/drm/drm_connector.h
Original file line number Diff line number Diff line change
Expand Up @@ -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?
*/
Expand Down

0 comments on commit 0374ffa

Please sign in to comment.