All of lore.kernel.org
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: dri-devel@lists.freedesktop.org
Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
Subject: [PATCH v8 03/54] drm/edid: Add flag to drm_display_info to identify HDMI sinks
Date: Wed, 26 Feb 2020 13:24:23 +0200	[thread overview]
Message-ID: <20200226112514.12455-4-laurent.pinchart@ideasonboard.com> (raw)
In-Reply-To: <20200226112514.12455-1-laurent.pinchart@ideasonboard.com>

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: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Andrzej Hajda <a.hajda@samsung.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Tested-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.com>
---
 Documentation/gpu/todo.rst  | 14 ++++++++++++++
 drivers/gpu/drm/drm_edid.c  |  6 ++++++
 include/drm/drm_connector.h |  8 ++++++++
 3 files changed, 28 insertions(+)

diff --git a/Documentation/gpu/todo.rst b/Documentation/gpu/todo.rst
index 370ac678106e..ccf5e8e34222 100644
--- a/Documentation/gpu/todo.rst
+++ b/Documentation/gpu/todo.rst
@@ -407,6 +407,20 @@ Contact: Daniel Vetter
 
 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
 =================
 
diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
index 5f3bc3486fde..ad41764a4ebe 100644
--- a/drivers/gpu/drm/drm_edid.c
+++ b/drivers/gpu/drm/drm_edid.c
@@ -4647,6 +4647,9 @@ EXPORT_SYMBOL(drm_av_sync_delay);
  *
  * 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.
  */
 bool drm_detect_hdmi_monitor(struct edid *edid)
@@ -4881,6 +4884,8 @@ drm_parse_hdmi_vsdb_video(struct drm_connector *connector, const u8 *db)
 	struct drm_display_info *info = &connector->display_info;
 	u8 len = cea_db_payload_len(db);
 
+	info->is_hdmi = true;
+
 	if (len >= 6)
 		info->dvi_dual = db[6] & 1;
 	if (len >= 7)
@@ -4949,6 +4954,7 @@ drm_reset_display_info(struct drm_connector *connector)
 	info->cea_rev = 0;
 	info->max_tmds_clock = 0;
 	info->dvi_dual = false;
+	info->is_hdmi = false;
 	info->has_hdmi_infoframe = false;
 	info->rgb_quant_range_selectable = false;
 	memset(&info->hdmi, 0, sizeof(info->hdmi));
diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h
index c3bd5262db9c..0df7a95ca5d9 100644
--- a/include/drm/drm_connector.h
+++ b/include/drm/drm_connector.h
@@ -434,6 +434,14 @@ struct drm_display_info {
 	 */
 	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?
 	 */
-- 
Regards,

Laurent Pinchart

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  parent reply	other threads:[~2020-02-26 11:26 UTC|newest]

Thread overview: 56+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-26 11:24 [PATCH v8 00/54] drm/omap: Replace custom display drivers with drm_bridge and drm_panel Laurent Pinchart
2020-02-26 11:24 ` [PATCH v8 01/54] video: hdmi: Change return type of hdmi_avi_infoframe_init() to void Laurent Pinchart
2020-02-26 11:24 ` [PATCH v8 02/54] drm/connector: Add helper to get a connector type name Laurent Pinchart
2020-02-26 11:24 ` Laurent Pinchart [this message]
2020-02-26 11:24 ` [PATCH v8 04/54] drm/bridge: Document the drm_encoder.bridge_chain field as private Laurent Pinchart
2020-02-26 11:24 ` [PATCH v8 05/54] drm/bridge: Fix atomic state ops documentation Laurent Pinchart
2020-02-26 11:24 ` [PATCH v8 06/54] drm/bridge: Improve overview documentation Laurent Pinchart
2020-02-26 11:24 ` [PATCH v8 07/54] drm/bridge: Add connector-related bridge operations and data Laurent Pinchart
2020-02-26 11:24 ` [PATCH v8 08/54] drm/bridge: Add interlace_allowed flag to drm_bridge Laurent Pinchart
2020-02-26 11:24 ` [PATCH v8 09/54] drm/bridge: Extend bridge API to disable connector creation Laurent Pinchart
2020-02-26 11:24 ` [PATCH v8 10/54] drm/bridge: dumb-vga-dac: Rename internal symbols to simple-bridge Laurent Pinchart
2020-02-26 11:24 ` [PATCH v8 11/54] drm/bridge: dumb-vga-dac: Rename driver " Laurent Pinchart
2020-02-26 11:24 ` [PATCH v8 12/54] drm/bridge: simple-bridge: Add support for non-VGA bridges Laurent Pinchart
2020-02-26 11:24 ` [PATCH v8 13/54] drm/bridge: simple-bridge: Add support for enable GPIO Laurent Pinchart
2020-02-26 11:24 ` [PATCH v8 14/54] drm/bridge: simple-bridge: Add support for the TI OPA362 Laurent Pinchart
2020-02-26 11:24 ` [PATCH v8 15/54] drm/bridge: Add bridge driver for display connectors Laurent Pinchart
2020-02-26 11:24 ` [PATCH v8 16/54] drm/bridge: Add driver for the TI TPD12S015 HDMI level shifter Laurent Pinchart
2020-02-26 11:24 ` [PATCH v8 17/54] drm/bridge: panel: Implement bridge connector operations Laurent Pinchart
2020-02-26 11:24 ` [PATCH v8 18/54] drm/bridge: tfp410: Replace manual connector handling with bridge Laurent Pinchart
2020-02-26 11:24 ` [PATCH v8 19/54] drm/bridge: tfp410: Allow operation without drm_connector Laurent Pinchart
2020-02-26 11:24 ` [PATCH v8 20/54] drm: Add helper to create a connector for a chain of bridges Laurent Pinchart
2020-02-26 11:24 ` [PATCH v8 21/54] drm/omap: dss: Cleanup DSS ports on initialisation failure Laurent Pinchart
2020-02-26 11:24 ` [PATCH v8 22/54] drm/omap: Simplify HDMI mode and infoframe configuration Laurent Pinchart
2020-02-26 11:24 ` [PATCH v8 23/54] drm/omap: Factor out display type to connector type conversion Laurent Pinchart
2020-02-26 11:24 ` [PATCH v8 24/54] drm/omap: Use the drm_panel_bridge API Laurent Pinchart
2020-02-26 11:24 ` [PATCH v8 25/54] drm/omap: dss: Fix output next device lookup in DT Laurent Pinchart
2020-02-26 11:24 ` [PATCH v8 26/54] drm/omap: Add infrastructure to support drm_bridge local to DSS outputs Laurent Pinchart
2020-02-26 11:24 ` [PATCH v8 27/54] drm/omap: dss: Make omap_dss_device_ops optional Laurent Pinchart
2020-02-26 11:24 ` [PATCH v8 28/54] drm/omap: hdmi: Allocate EDID in the .read_edid() operation Laurent Pinchart
2020-02-26 11:24 ` [PATCH v8 29/54] drm/omap: hdmi4: Rework EDID read to isolate data read Laurent Pinchart
2020-02-26 11:24 ` [PATCH v8 30/54] drm/omap: hdmi5: " Laurent Pinchart
2020-02-26 11:24 ` [PATCH v8 31/54] drm/omap: hdmi4: Register a drm_bridge for EDID read Laurent Pinchart
2020-02-26 11:24 ` [PATCH v8 32/54] drm/omap: hdmi5: " Laurent Pinchart
2020-02-26 11:24 ` [PATCH v8 33/54] drm/omap: hdmi4: Move mode set, enable and disable operations to bridge Laurent Pinchart
2020-02-26 11:24 ` [PATCH v8 34/54] drm/omap: hdmi5: " Laurent Pinchart
2020-02-26 11:24 ` [PATCH v8 35/54] drm/omap: hdmi4: Implement drm_bridge .hpd_notify() operation Laurent Pinchart
2020-02-26 11:24 ` [PATCH v8 36/54] drm/omap: dss: Remove .set_hdmi_mode() and .set_infoframe() operations Laurent Pinchart
2020-02-26 11:24 ` [PATCH v8 37/54] drm/omap: venc: Register a drm_bridge Laurent Pinchart
2020-02-26 11:24 ` [PATCH v8 38/54] drm/omap: Create connector for bridges Laurent Pinchart
2020-02-26 11:24 ` [PATCH v8 39/54] drm/omap: Switch the HDMI and VENC outputs to drm_bridge Laurent Pinchart
2020-02-26 11:25 ` [PATCH v8 40/54] drm/omap: Remove HPD, detect and EDID omapdss operations Laurent Pinchart
2020-02-26 11:25 ` [PATCH v8 41/54] drm/omap: hdmi: Remove omap_dss_device operations Laurent Pinchart
2020-02-26 11:25 ` [PATCH v8 42/54] drm/omap: venc: " Laurent Pinchart
2020-02-26 11:25 ` [PATCH v8 43/54] drm/omap: hdmi4: Simplify EDID read Laurent Pinchart
2020-02-26 11:25 ` [PATCH v8 44/54] drm/omap: hdmi5: " Laurent Pinchart
2020-02-26 11:25 ` [PATCH v8 45/54] drm/omap: dpi: Sort includes alphabetically Laurent Pinchart
2020-02-26 11:25 ` [PATCH v8 46/54] drm/omap: dpi: Reorder functions in sections Laurent Pinchart
2020-02-26 11:25 ` [PATCH v8 47/54] drm/omap: dpi: Simplify clock setting API Laurent Pinchart
2020-02-26 11:25 ` [PATCH v8 48/54] drm/omap: dpi: Register a drm_bridge Laurent Pinchart
2020-02-26 11:25 ` [PATCH v8 49/54] drm/omap: sdi: Sort includes alphabetically Laurent Pinchart
2020-02-26 11:25 ` [PATCH v8 50/54] drm/omap: sdi: Register a drm_bridge Laurent Pinchart
2020-02-26 11:25 ` [PATCH v8 51/54] drm/omap: Hardcode omap_connector type to DSI Laurent Pinchart
2020-02-26 11:25 ` [PATCH v8 52/54] drm/omap: dss: Inline the omapdss_display_get() function Laurent Pinchart
2020-02-26 11:25 ` [PATCH v8 53/54] drm/omap: dss: Remove unused omapdss_of_find_connected_device() function Laurent Pinchart
2020-02-26 11:25 ` [PATCH v8 54/54] drm/omap: dss: Remove unused omap_dss_device operations Laurent Pinchart
2020-02-26 11:54 ` [PATCH v8 00/54] drm/omap: Replace custom display drivers with drm_bridge and drm_panel Tomi Valkeinen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200226112514.12455-4-laurent.pinchart@ideasonboard.com \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=tomi.valkeinen@ti.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.