[PATCH v5] drm/bridge: lt9611uxc: support displays with up to 4 EDID blocks

From: vishnu . saini

Date: Sat Nov 21 2026 - 22:27:07 EST


From: Ravi Agola <raviagol@xxxxxxxxxxxxxxxx>

The LT9611UXC firmware buffers only two EDID blocks at a time, always at
the same offset (block % 2). Until now the driver read blocks 0 and 1 and
stopped there, so sinks with more than one extension block, such as the
Dell Curved Monitor U4021QW, could not be fully read.

To get blocks 2 and 3, set the EDID ready flag in register 0xb028. This
makes the bridge asynchronously fetch the next pair of blocks from the
sink into the same buffer. The bridge has no "fetch done" status, so the
driver polls the buffer until the new data shows up. Stale data is
detected from the EDID header:

- Block 0 always starts with the EDID header magic
(00 ff ff ff ff ff ff 00), so it is accepted once the magic is
present.
- Block 2 never carries the magic, so it is accepted once the header
left over from the previous block 0 is gone.

Poll for EDID availability up to 10 times at 100 ms intervals. This
provides sufficient margin for the observed EDID fetch latency, which
can reach 600-650 ms after the HPD interrupt.

Reset the edid_read flag on HPD disconnect so that the next connect
triggers a fresh EDID fetch.

Also increase the EDID wait time from 500 ms to 1000 ms. On the
Qualcomm rb3gen2 platform the EDID read interrupt sometimes arrives
600-650 ms after the HPD interrupt, which made the EDID read fail.

Signed-off-by: Ravi Agola <raviagol@xxxxxxxxxxxxxxxx>
Signed-off-by: Vishnu Saini <vishnu.saini@xxxxxxxxxxxxxxxx>
---
Changes in v5:
- Updated commit msg and comments [Jani Nikula]
- Rebased onto latest drm-misc-next.
- Link to v4: https://lore.kernel.org/r/20260922-lt9611usc_edid34_misc_next-v4-1-47d5315821fe@xxxxxxxxxxxxxxxx

Changes in v4:
- Rebased onto latest drm-misc-next.
- No functional changes; replied inline to the two Sashiko-bot
review comments on v3
- Link to v3: https://lore.kernel.org/r/20260722-lt9611usc_edid34_misc_next-v3-1-7ec2bba6ff8e@xxxxxxxxxxxxxxxx

Changes in v3:
- moved edid_read state change inside mutex lock [sashiko-bot]
- returned -ETIMEOUT when retry_cnt is exhausted without a match. [Sashiko-bot]
- Increased edid wait timeout from 500ms to 1000ms as edid interrupt is sometimes taking around 650ms time
- Link to v2: https://lore.kernel.org/r/20260624-lt9611usc_edid34_misc_next-v2-1-24ce3f5770b8@xxxxxxxxxxxxxxxx

Changes in v2:
- Removed memcpy and doing edid fetch everytime. Required an update in firmware as well for edid block0 reset.
- Verified patch with existing firmware V5.0.21, patch is not causing any regression if V5.0.21 firmware is used.
- Firmware V5.0.22 is required with this patch to support edid fetch on more than 2 edid block monitors.
- Link to v1: https://lore.kernel.org/r/20260517-lt9611usc_edid34_misc_next-v1-1-5e2fd8c6399b@xxxxxxxxxxxxxxxx
---
drivers/gpu/drm/bridge/lontium-lt9611uxc.c | 93 +++++++++++++++++++++++++-----
1 file changed, 78 insertions(+), 15 deletions(-)

diff --git a/drivers/gpu/drm/bridge/lontium-lt9611uxc.c b/drivers/gpu/drm/bridge/lontium-lt9611uxc.c
index b3bb7f2cebb3..d5924a8df1f9 100644
--- a/drivers/gpu/drm/bridge/lontium-lt9611uxc.c
+++ b/drivers/gpu/drm/bridge/lontium-lt9611uxc.c
@@ -28,7 +28,7 @@
#include <drm/display/drm_hdmi_audio_helper.h>

#define EDID_BLOCK_SIZE 128
-#define EDID_NUM_BLOCKS 2
+#define EDID_NUM_BLOCKS 4

#define FW_FILE "lt9611uxc_fw.bin"

@@ -167,6 +167,8 @@ static void lt9611uxc_hpd_work(struct work_struct *work)

mutex_lock(&lt9611uxc->ocm_lock);
connected = lt9611uxc->hdmi_connected;
+ if (!connected)
+ lt9611uxc->edid_read = false;
mutex_unlock(&lt9611uxc->ocm_lock);

drm_bridge_hpd_notify(&lt9611uxc->bridge,
@@ -380,13 +382,39 @@ lt9611uxc_bridge_detect(struct drm_bridge *bridge, struct drm_connector *connect
static int lt9611uxc_wait_for_edid(struct lt9611uxc *lt9611uxc)
{
return wait_event_interruptible_timeout(lt9611uxc->wq, lt9611uxc->edid_read,
- msecs_to_jiffies(500));
+ msecs_to_jiffies(1000));
+}
+
+static int lt9611uxc_read_edid_block(struct lt9611uxc *lt9611uxc, unsigned int block,
+ u8 *buf, size_t len)
+{
+ int ret;
+
+ lt9611uxc_lock(lt9611uxc);
+
+ regmap_write(lt9611uxc->regmap, 0xb00a, (block % 2) * EDID_BLOCK_SIZE);
+
+ ret = regmap_noinc_read(lt9611uxc->regmap, 0xb0b0, buf, len);
+ if (ret) {
+ dev_err(lt9611uxc->dev, "edid block %d read failed: %d\n", block, ret);
+ lt9611uxc_unlock(lt9611uxc);
+ return -EINVAL;
+ }
+ lt9611uxc_unlock(lt9611uxc);
+
+ return ret;
}

static int lt9611uxc_get_edid_block(void *data, u8 *buf, unsigned int block, size_t len)
{
struct lt9611uxc *lt9611uxc = data;
- int ret;
+ int ret = 0;
+ int retry_cnt = 10;
+ unsigned int edid_ready_flag = 0;
+ bool header_matched;
+ bool edid_valid = false;
+ const u8 edid_header[8] = { 0x00, 0xFF, 0xFF, 0xFF,
+ 0xFF, 0xFF, 0xFF, 0x00 };

if (len > EDID_BLOCK_SIZE)
return -EINVAL;
@@ -394,20 +422,55 @@ static int lt9611uxc_get_edid_block(void *data, u8 *buf, unsigned int block, siz
if (block >= EDID_NUM_BLOCKS)
return -EINVAL;

- lt9611uxc_lock(lt9611uxc);
-
- regmap_write(lt9611uxc->regmap, 0xb00b, 0x10);
-
- regmap_write(lt9611uxc->regmap, 0xb00a, block * EDID_BLOCK_SIZE);
-
- ret = regmap_noinc_read(lt9611uxc->regmap, 0xb0b0, buf, len);
- if (ret)
- dev_err(lt9611uxc->dev, "edid read failed: %d\n", ret);
+ if (block == 0 || block == 2) {
+
+ lt9611uxc_lock(lt9611uxc);
+
+ edid_ready_flag = (block == 0) ? BIT(0) : BIT(1);
+
+ /*
+ * The bridge only buffers 2 EDID blocks at a time. Writing
+ * 0xb028 re-triggers it to fetch a fresh pair of blocks
+ * (0+1, or 2+3) from the sink over DDC into that buffer, an
+ * asynchronous operation with no separate "fetch done" flag
+ * to wait on.
+ */
+ regmap_write(lt9611uxc->regmap, 0xb028, edid_ready_flag);
+
+ lt9611uxc_unlock(lt9611uxc);
+
+ do {
+ msleep(100);
+ ret = lt9611uxc_read_edid_block(lt9611uxc, block, buf, len);
+ if (ret)
+ break;
+ /*
+ * Poll for the fetch to complete: block 0 is only
+ * valid once it carries the EDID header magic, and
+ * block 2 (an extension block) is only valid once it
+ * no longer carries that same magic left over from
+ * the previous fetch at this buffer offset.
+ */
+ header_matched = (memcmp(edid_header, buf, 8) == 0);
+ edid_valid = (block == 0 && header_matched) ||
+ (block == 2 && !header_matched);
+ if (edid_valid)
+ break;
+
+ } while (retry_cnt-- > 0);
+
+ if (!ret && !edid_valid)
+ ret = -ETIMEDOUT;
+ } else {
+ ret = lt9611uxc_read_edid_block(lt9611uxc, block, buf, len);

- lt9611uxc_unlock(lt9611uxc);
+ lt9611uxc_lock(lt9611uxc);
+ regmap_write(lt9611uxc->regmap, 0xb028, 0x00);
+ lt9611uxc_unlock(lt9611uxc);
+ }

- return 0;
-};
+ return ret;
+}

static const struct drm_edid *lt9611uxc_bridge_edid_read(struct drm_bridge *bridge,
struct drm_connector *connector)

---
base-commit: c408466a4dfaee4b12587e926c5b85e68c8b3c40
change-id: 20260517-lt9611usc_edid34_misc_next-b02592de0b25

Best regards,
--
Vishnu Saini <vishnu.saini@xxxxxxxxxxxxxxxx>