* [PATCH] drm/i915/hdmi: preserve cached EDID on DDC failure when connector is forced
@ 2026-10-24 12:06 Aman Sharma
2026-10-24 12:33 ` [PATCH v2] " Aman Sharma
0 siblings, 1 reply; 3+ messages in thread
From: Aman Sharma @ 2026-10-24 12:06 UTC (permalink / raw)
To: intel-gfx, dri-devel
Cc: Jani Nikula, Rodrigo Vivi, Joonas Lahtinen, Tvrtko Ursulin,
David Airlie, Simona Vetter, linux-kernel, Aman Sharma
When an HDMI connector is forced enabled (e.g. via video=HDMI-A-1:e for
laptop clamshell operation) and the external monitor enters DPMS standby,
some monitors (such as the BenQ GW2790Q) power down their internal DDC/I2C
controller, causing SCDC/EDID reads to fail with -ENXIO (-6).
Currently, intel_hdmi_force() unconditionally calls intel_hdmi_unset_edid()
before calling intel_hdmi_set_edid(). When drm_edid_read_ddc() returns NULL
during monitor standby, the connector's cached detect_edid is wiped out and
drm_helper_probe_single_connector_modes() falls back to the 1024x768 VESA
no-EDID mode. When the monitor wakes back up, because the connector status
remained forced to connector_status_connected, no hotplug state transition
occurs and the display remains stuck at 1024x768 until a manual mode probe
(such as toggling the laptop lid) is triggered.
Fix this by retaining the previously cached detect_edid when a DDC read
fails on a forced-on connector. When the monitor is awake or a different
monitor is plugged in, drm_edid_read_ddc() succeeds and replaces the
cached EDID normally.
Signed-off-by: Aman Sharma <amansharma6122002@gmail.com>
---
drivers/gpu/drm/i915/display/intel_hdmi.c | 18 +++++++++++++++---
1 file changed, 15 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/i915/display/intel_hdmi.c b/drivers/gpu/drm/i915/display/intel_hdmi.c
index b6fa1a1558b8..140d98a61a9c 100644
--- a/drivers/gpu/drm/i915/display/intel_hdmi.c
+++ b/drivers/gpu/drm/i915/display/intel_hdmi.c
@@ -2570,6 +2570,18 @@ intel_hdmi_set_edid(struct drm_connector *_connector)
intel_gmbus_force_bit(ddc, false);
}
+ /*
+ * If the connector is forced on (e.g. video=HDMI-A-1:e) and the sink's
+ * DDC/I2C bus is powered down during DPMS standby, keep the previously
+ * cached EDID rather than wiping it and falling back to 1024x768.
+ */
+ if (!drm_edid && connector->base.force && connector->detect_edid) {
+ intel_display_power_put(display, POWER_DOMAIN_GMBUS, wakeref);
+ return true;
+ }
+
+ drm_edid_free(connector->detect_edid);
+
/* Below we depend on display info having been updated */
drm_edid_connector_update(&connector->base, drm_edid);
@@ -2638,10 +2650,10 @@ intel_hdmi_force(struct drm_connector *_connector)
if (!intel_display_driver_check_access(display))
return;
- intel_hdmi_unset_edid(&connector->base);
-
- if (connector->base.status != connector_status_connected)
+ if (connector->base.status != connector_status_connected) {
+ intel_hdmi_unset_edid(&connector->base);
return;
+ }
intel_hdmi_set_edid(&connector->base);
}
--
2.43.0
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH v2] drm/i915/hdmi: preserve cached EDID on DDC failure when connector is forced
2026-10-24 12:06 [PATCH] drm/i915/hdmi: preserve cached EDID on DDC failure when connector is forced Aman Sharma
@ 2026-10-24 12:33 ` Aman Sharma
2026-10-24 12:53 ` [PATCH v3] " Aman Sharma
0 siblings, 1 reply; 3+ messages in thread
From: Aman Sharma @ 2026-10-24 12:33 UTC (permalink / raw)
To: intel-gfx, dri-devel
Cc: Jani Nikula, Rodrigo Vivi, Joonas Lahtinen, Tvrtko Ursulin,
David Airlie, Simona Vetter, linux-kernel, Aman Sharma
When an HDMI connector is forced enabled (e.g. via video=HDMI-A-1:e for
laptop clamshell operation) and the external monitor enters DPMS standby,
some monitors (such as the BenQ GW2790Q) power down their internal DDC/I2C
controller, causing SCDC/EDID reads to fail with -ENXIO (-6).
Currently, intel_hdmi_detect() and intel_hdmi_force() unconditionally call
intel_hdmi_unset_edid() before calling intel_hdmi_set_edid(). When
drm_edid_read_ddc() returns NULL during monitor standby, the connector's
cached detect_edid is wiped out and
drm_helper_probe_single_connector_modes() falls back to the 1024x768 VESA
no-EDID mode. When the monitor wakes back up, because the connector status
remained forced to connector_status_connected, no hotplug state transition
occurs and the display remains stuck at 1024x768 until a manual mode probe
(such as toggling the laptop lid) is triggered.
Fix this by moving intel_hdmi_unset_edid() into intel_hdmi_set_edid() after
checking whether a forced connector already has a valid cached EDID
(detect_edid and edid_blob_ptr) when DDC fails, and only clearing
detect_edid on Gen11+ digital port disconnect when the connector is not
forced. When the monitor is awake or a different monitor is plugged in,
drm_edid_read_ddc() succeeds, resets the previous EDID and dp_dual_mode
state via intel_hdmi_unset_edid(), and updates the connector with the new
EDID.
v2:
- Move intel_hdmi_unset_edid() into intel_hdmi_set_edid() so hotplug
detection via intel_hdmi_detect() also preserves the cached EDID on
forced connectors and resets dp_dual_mode when updating EDID.
- Clear detect_edid on Gen11+ disconnect when the connector is unforced,
and verify edid_blob_ptr is non-NULL before retaining detect_edid.
Signed-off-by: Aman Sharma <amansharma6122002@gmail.com>
---
drivers/gpu/drm/i915/display/intel_hdmi.c | 25 +++++++++++++++++------
1 file changed, 19 insertions(+), 6 deletions(-)
diff --git a/drivers/gpu/drm/i915/display/intel_hdmi.c b/drivers/gpu/drm/i915/display/intel_hdmi.c
index b6fa1a1558b8..89ab9a790a41 100644
--- a/drivers/gpu/drm/i915/display/intel_hdmi.c
+++ b/drivers/gpu/drm/i915/display/intel_hdmi.c
@@ -2570,6 +2570,19 @@ intel_hdmi_set_edid(struct drm_connector *_connector)
intel_gmbus_force_bit(ddc, false);
}
+ /*
+ * If the connector is forced on (e.g. video=HDMI-A-1:e) and the sink's
+ * DDC/I2C bus is powered down during DPMS standby, keep the previously
+ * cached EDID rather than wiping it and falling back to 1024x768.
+ */
+ if (!drm_edid && connector->base.force &&
+ connector->detect_edid && connector->base.edid_blob_ptr) {
+ intel_display_power_put(display, POWER_DOMAIN_GMBUS, wakeref);
+ return true;
+ }
+
+ intel_hdmi_unset_edid(&connector->base);
+
/* Below we depend on display info having been updated */
drm_edid_connector_update(&connector->base, drm_edid);
@@ -2611,10 +2624,11 @@ intel_hdmi_detect(struct drm_connector *_connector, bool force)
wakeref = intel_display_power_get(display, POWER_DOMAIN_GMBUS);
if (DISPLAY_VER(display) >= 11 &&
- !intel_digital_port_connected(encoder))
+ !intel_digital_port_connected(encoder)) {
+ if (!connector->base.force)
+ intel_hdmi_unset_edid(&connector->base);
goto out;
-
- intel_hdmi_unset_edid(&connector->base);
+ }
if (intel_hdmi_set_edid(&connector->base))
status = connector_status_connected;
@@ -2638,10 +2652,10 @@ intel_hdmi_force(struct drm_connector *_connector)
if (!intel_display_driver_check_access(display))
return;
- intel_hdmi_unset_edid(&connector->base);
-
- if (connector->base.status != connector_status_connected)
+ if (connector->base.status != connector_status_connected) {
+ intel_hdmi_unset_edid(&connector->base);
return;
+ }
intel_hdmi_set_edid(&connector->base);
}
--
2.43.0
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH v3] drm/i915/hdmi: preserve cached EDID on DDC failure when connector is forced
2026-10-24 12:33 ` [PATCH v2] " Aman Sharma
@ 2026-10-24 12:53 ` Aman Sharma
0 siblings, 0 replies; 3+ messages in thread
From: Aman Sharma @ 2026-10-24 12:53 UTC (permalink / raw)
To: intel-gfx, dri-devel
Cc: Jani Nikula, Rodrigo Vivi, Joonas Lahtinen, Tvrtko Ursulin,
David Airlie, Simona Vetter, linux-kernel, Aman Sharma
When an HDMI connector is forced enabled (e.g. via video=HDMI-A-1:e for
laptop clamshell operation) and the external monitor enters DPMS standby,
some monitors (such as the BenQ GW2790Q) power down their internal DDC/I2C
controller, causing SCDC/EDID reads to fail with -ENXIO (-6).
Currently, intel_hdmi_detect() and intel_hdmi_force() unconditionally call
intel_hdmi_unset_edid() before calling intel_hdmi_set_edid(). When
drm_edid_read_ddc() returns NULL during monitor standby, the connector's
cached detect_edid is wiped out and
drm_helper_probe_single_connector_modes() falls back to the 1024x768 VESA
no-EDID mode. When the monitor wakes back up, because the connector status
remained forced to connector_status_connected, no hotplug state transition
occurs and the display remains stuck at 1024x768 until a manual mode probe
(such as toggling the laptop lid) is triggered.
Fix this by moving intel_hdmi_unset_edid() into intel_hdmi_set_edid() after
checking whether a forced-on connector (DRM_FORCE_ON or
DRM_FORCE_ON_DIGITAL) already has a valid cached EDID (detect_edid and
edid_blob_ptr) when DDC fails, and preserving connector_status_connected
on Gen11+ digital port disconnect when a forced-on connector has a cached
EDID. When the monitor is awake or a different monitor is plugged in,
drm_edid_read_ddc() succeeds, resets the previous EDID and dp_dual_mode
state via intel_hdmi_unset_edid(), and updates the connector with the new
EDID.
v3:
- Explicitly check for DRM_FORCE_ON / DRM_FORCE_ON_DIGITAL so DRM_FORCE_OFF
still clears the cached EDID as expected.
- Report connector_status_connected on Gen11+ disconnect when a forced-on
connector retains its cached EDID, and jump to out in
intel_hdmi_set_edid() so CEC physical address remains valid and
drm_helper_probe_detect_ctx() does not increment epoch_counter on
standby HPD pulses.
v2:
- Move intel_hdmi_unset_edid() into intel_hdmi_set_edid() so hotplug
detection via intel_hdmi_detect() also preserves the cached EDID on
forced connectors and resets dp_dual_mode when updating EDID.
- Clear detect_edid on Gen11+ disconnect when the connector is unforced,
and verify edid_blob_ptr is non-NULL before retaining detect_edid.
Signed-off-by: Aman Sharma <amansharma6122002@gmail.com>
---
drivers/gpu/drm/i915/display/intel_hdmi.c | 31 ++++++++++++++++++-----
1 file changed, 25 insertions(+), 6 deletions(-)
diff --git a/drivers/gpu/drm/i915/display/intel_hdmi.c b/drivers/gpu/drm/i915/display/intel_hdmi.c
index b6fa1a1558b8..a14a857dfe94 100644
--- a/drivers/gpu/drm/i915/display/intel_hdmi.c
+++ b/drivers/gpu/drm/i915/display/intel_hdmi.c
@@ -2570,6 +2570,21 @@ intel_hdmi_set_edid(struct drm_connector *_connector)
intel_gmbus_force_bit(ddc, false);
}
+ /*
+ * If the connector is forced on (e.g. video=HDMI-A-1:e) and the sink's
+ * DDC/I2C bus is powered down during DPMS standby, keep the previously
+ * cached EDID rather than wiping it and falling back to 1024x768.
+ */
+ if (!drm_edid &&
+ (connector->base.force == DRM_FORCE_ON ||
+ connector->base.force == DRM_FORCE_ON_DIGITAL) &&
+ connector->detect_edid && connector->base.edid_blob_ptr) {
+ connected = true;
+ goto out;
+ }
+
+ intel_hdmi_unset_edid(&connector->base);
+
/* Below we depend on display info having been updated */
drm_edid_connector_update(&connector->base, drm_edid);
@@ -2580,6 +2595,7 @@ intel_hdmi_set_edid(struct drm_connector *_connector)
connected = true;
}
+out:
intel_display_power_put(display, POWER_DOMAIN_GMBUS, wakeref);
cec_notifier_set_phys_addr(intel_hdmi->cec_notifier,
@@ -2611,10 +2627,15 @@ intel_hdmi_detect(struct drm_connector *_connector, bool force)
wakeref = intel_display_power_get(display, POWER_DOMAIN_GMBUS);
if (DISPLAY_VER(display) >= 11 &&
- !intel_digital_port_connected(encoder))
+ !intel_digital_port_connected(encoder)) {
+ if ((connector->base.force == DRM_FORCE_ON ||
+ connector->base.force == DRM_FORCE_ON_DIGITAL) &&
+ connector->detect_edid && connector->base.edid_blob_ptr)
+ status = connector_status_connected;
+ else
+ intel_hdmi_unset_edid(&connector->base);
goto out;
-
- intel_hdmi_unset_edid(&connector->base);
+ }
if (intel_hdmi_set_edid(&connector->base))
status = connector_status_connected;
@@ -2638,10 +2659,10 @@ intel_hdmi_force(struct drm_connector *_connector)
if (!intel_display_driver_check_access(display))
return;
- intel_hdmi_unset_edid(&connector->base);
-
- if (connector->base.status != connector_status_connected)
+ if (connector->base.status != connector_status_connected) {
+ intel_hdmi_unset_edid(&connector->base);
return;
+ }
intel_hdmi_set_edid(&connector->base);
}
--
2.43.0
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-10-24 12:53 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-24 12:06 [PATCH] drm/i915/hdmi: preserve cached EDID on DDC failure when connector is forced Aman Sharma
2026-10-24 12:33 ` [PATCH v2] " Aman Sharma
2026-10-24 12:53 ` [PATCH v3] " Aman Sharma
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®