Commit a92d083d authored by Laurent Pinchart's avatar Laurent Pinchart Committed by Tomi Valkeinen

drm/edid: Add flag to drm_display_info to identify HDMI sinks

The drm_display_info structure contains many fields related to HDMI
sinks, but none that identifies if a sink compliant with CEA-861 (EDID)
shall be treated as an HDMI sink or a DVI sink. Add such a flag, and
populate it according to section 8.3.3 ("DVI/HDMI Device
Discrimination") of the HDMI v1.3 specification.
Signed-off-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: default avatarAndrzej Hajda <a.hajda@samsung.com>
Reviewed-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: default avatarBoris Brezillon <boris.brezillon@collabora.com>
Acked-by: default avatarSam Ravnborg <sam@ravnborg.org>
Tested-by: default avatarSebastian Reichel <sebastian.reichel@collabora.com>
Reviewed-by: default avatarSebastian Reichel <sebastian.reichel@collabora.com>
Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200226112514.12455-4-laurent.pinchart@ideasonboard.com
parent b35f90f2
...@@ -407,6 +407,20 @@ Contact: Daniel Vetter ...@@ -407,6 +407,20 @@ Contact: Daniel Vetter
Level: Intermediate Level: Intermediate
Replace drm_detect_hdmi_monitor() with drm_display_info.is_hdmi
---------------------------------------------------------------
Once EDID is parsed, the monitor HDMI support information is available through
drm_display_info.is_hdmi. Many drivers still call drm_detect_hdmi_monitor() to
retrieve the same information, which is less efficient.
Audit each individual driver calling drm_detect_hdmi_monitor() and switch to
drm_display_info.is_hdmi if applicable.
Contact: Laurent Pinchart, respective driver maintainers
Level: Intermediate
Core refactorings Core refactorings
================= =================
......
...@@ -4647,6 +4647,9 @@ EXPORT_SYMBOL(drm_av_sync_delay); ...@@ -4647,6 +4647,9 @@ EXPORT_SYMBOL(drm_av_sync_delay);
* *
* Parse the CEA extension according to CEA-861-B. * Parse the CEA extension according to CEA-861-B.
* *
* Drivers that have added the modes parsed from EDID to drm_display_info
* should use &drm_display_info.is_hdmi instead of calling this function.
*
* Return: True if the monitor is HDMI, false if not or unknown. * Return: True if the monitor is HDMI, false if not or unknown.
*/ */
bool drm_detect_hdmi_monitor(struct edid *edid) bool drm_detect_hdmi_monitor(struct edid *edid)
...@@ -4881,6 +4884,8 @@ drm_parse_hdmi_vsdb_video(struct drm_connector *connector, const u8 *db) ...@@ -4881,6 +4884,8 @@ drm_parse_hdmi_vsdb_video(struct drm_connector *connector, const u8 *db)
struct drm_display_info *info = &connector->display_info; struct drm_display_info *info = &connector->display_info;
u8 len = cea_db_payload_len(db); u8 len = cea_db_payload_len(db);
info->is_hdmi = true;
if (len >= 6) if (len >= 6)
info->dvi_dual = db[6] & 1; info->dvi_dual = db[6] & 1;
if (len >= 7) if (len >= 7)
...@@ -4949,6 +4954,7 @@ drm_reset_display_info(struct drm_connector *connector) ...@@ -4949,6 +4954,7 @@ drm_reset_display_info(struct drm_connector *connector)
info->cea_rev = 0; info->cea_rev = 0;
info->max_tmds_clock = 0; info->max_tmds_clock = 0;
info->dvi_dual = false; info->dvi_dual = false;
info->is_hdmi = false;
info->has_hdmi_infoframe = false; info->has_hdmi_infoframe = false;
info->rgb_quant_range_selectable = false; info->rgb_quant_range_selectable = false;
memset(&info->hdmi, 0, sizeof(info->hdmi)); memset(&info->hdmi, 0, sizeof(info->hdmi));
......
...@@ -434,6 +434,14 @@ struct drm_display_info { ...@@ -434,6 +434,14 @@ struct drm_display_info {
*/ */
bool dvi_dual; bool dvi_dual;
/**
* @is_hdmi: True if the sink is an HDMI device.
*
* This field shall be used instead of calling
* drm_detect_hdmi_monitor() when possible.
*/
bool is_hdmi;
/** /**
* @has_hdmi_infoframe: Does the sink support the HDMI infoframe? * @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