[PATCH 4/5] HACK: drm/edid: probe and log displayid DDC address

Jani Nikula jani.nikula at intel.com
Fri Dec 15 09:11:18 UTC 2023


Signed-off-by: Jani Nikula <jani.nikula at intel.com>
---
 drivers/gpu/drm/drm_edid.c | 25 +++++++++++++++++++++++--
 1 file changed, 23 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
index d25fd4b1adb2..a2264aee692c 100644
--- a/drivers/gpu/drm/drm_edid.c
+++ b/drivers/gpu/drm/drm_edid.c
@@ -2632,6 +2632,25 @@ drm_probe_ddc(struct i2c_adapter *adapter)
 }
 EXPORT_SYMBOL(drm_probe_ddc);
 
+static bool drm_probe_displayid(struct i2c_adapter *adapter)
+{
+	struct ddc_read_block_context context = {
+		.adapter = adapter,
+		.addr = DDC_ADDR2,
+	};
+	u8 block[EDID_LENGTH];
+	int ret;
+
+	ret = ddc_read_block(&context, block, 0, sizeof(block));
+	if (ret)
+		return false;
+
+	print_hex_dump(KERN_INFO, "displayid: ", DUMP_PREFIX_OFFSET, 16, 1,
+		       block, sizeof(block), true);
+
+	return true;
+}
+
 /**
  * drm_get_edid - get EDID data, if available
  * @connector: connector we're probing
@@ -2654,7 +2673,8 @@ struct edid *drm_get_edid(struct drm_connector *connector,
 	if (connector->force == DRM_FORCE_OFF)
 		return NULL;
 
-	if (connector->force == DRM_FORCE_UNSPECIFIED && !drm_probe_ddc(adapter))
+	if (connector->force == DRM_FORCE_UNSPECIFIED &&
+	    !drm_probe_displayid(adapter) && !drm_probe_ddc(adapter))
 		return NULL;
 
 	edid = _drm_do_get_edid(connector, ddc_read_block, &context, NULL);
@@ -2739,7 +2759,8 @@ const struct drm_edid *drm_edid_read_ddc(struct drm_connector *connector,
 	if (connector->force == DRM_FORCE_OFF)
 		return NULL;
 
-	if (connector->force == DRM_FORCE_UNSPECIFIED && !drm_probe_ddc(adapter))
+	if (connector->force == DRM_FORCE_UNSPECIFIED &&
+	    !drm_probe_displayid(adapter) && !drm_probe_ddc(adapter))
 		return NULL;
 
 	drm_edid = drm_edid_read_custom(connector, ddc_read_block, &context);
-- 
2.39.2



More information about the Intel-gfx-trybot mailing list