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

Jani Nikula jani.nikula at intel.com
Thu Dec 14 09:23:07 UTC 2023


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

diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
index d25fd4b1adb2..a117a3c7a813 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);
-- 
2.39.2



More information about the Intel-gfx-trybot mailing list