public inbox for drm-ai-reviews@public-inbox.freedesktop.org
 help / color / mirror / Atom feed
* [PATCH v2] drm/probe-helper: honour connector->force in drm_helper_probe_detect()
@ 2026-05-26 19:18 Paul Menzel
  2026-05-27  4:18 ` Claude review: " Claude Code Review Bot
  2026-05-27  4:18 ` Claude Code Review Bot
  0 siblings, 2 replies; 7+ messages in thread
From: Paul Menzel @ 2026-05-26 19:18 UTC (permalink / raw)
  To: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
	Simona Vetter
  Cc: Paul Menzel, dri-devel, linux-kernel

With `video=DP-2:d drm.debug=0x04` the connectors are correctly forced off
at init time:

    [9.742468] [drm] forcing DP-2 connector off

but intel_dp_detect() is still called immediately after:

    [9.908738] [drm:intel_dp_detect] [CONNECTOR:130:DP-2]
    [9.912982] [drm:intel_hotplug_detect_connector] [CONNECTOR:130:DP-2] status updated from unknown to unknown (epoch counter 0->1)

drm_helper_probe_single_connector_modes() already short-circuits when
connector->force is set, returning the forced status without calling any
detect callbacks.  drm_helper_probe_detect() however has no such guard, so
callers that go through it directly – such as i915’s
intel_hotplug_detect_connector() – still run the full hardware probe (AUX
DPCD read, GMBus DDC transaction, ...) even when the user has forced a
connector off via the `video=` command-line parameter.

Add the same connector->force check for forced off connectors at the top of
drm_helper_probe_detect(), so that the hardware probe is skipped regardless
of the entry point.  This makes video=<connector>:d effective at boot time,
not just for userspace GETCONNECTOR ioctls.

DRM_FORCE_ON and DRM_FORCE_ON_DIGITAL are intentionally not short-
circuited here: for those cases the detect callback must still run to
initialise sink capabilities such as DPCD link rate and lane count.

Tested on a Dell XPS 13 9360 (Intel Kaby Lake-U GT2 [HD Graphics 620]
[8086:5916]). With `video=DP-2:d drm.debug=0x04, Linux logs:

    [   11.701243] [drm] forcing DP-2 connector off
    [...]
    [   12.102009] i915 0000:00:02.0: [drm:drm_helper_probe_detect [drm_kms_helper]] [CONNECTOR:130:DP-2] forced off, skipping detect

v2: Do not return early for DRM_FORCE_ON and DRM_FORCE_ON_DIGITAL (Jani,
gemini/gemini-3.1-pro-preview)

Assisted-by: Claude Sonnet 4.6
Signed-off-by: Paul Menzel <pmenzel@molgen.mpg.de>
---


 drivers/gpu/drm/drm_probe_helper.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/gpu/drm/drm_probe_helper.c b/drivers/gpu/drm/drm_probe_helper.c
index d4dc8cb45bce..b657ae109f98 100644
--- a/drivers/gpu/drm/drm_probe_helper.c
+++ b/drivers/gpu/drm/drm_probe_helper.c
@@ -401,6 +401,12 @@ drm_helper_probe_detect(struct drm_connector *connector,
 	struct drm_device *dev = connector->dev;
 	int ret;
 
+	if (connector->force) {
+		drm_dbg_kms(dev, "[CONNECTOR:%d:%s] forced off, skipping detect\n",
+			    connector->base.id, connector->name);
+		return connector_status_disconnected;
+	}
+
 	if (!ctx)
 		return drm_helper_probe_detect_ctx(connector, force);
 
-- 
2.53.0


^ permalink raw reply related	[flat|nested] 7+ messages in thread
* [PATCH v3] drm/probe-helper: Honour connector->force in drm_helper_probe_detect()
@ 2026-05-26 22:32 Paul Menzel
  2026-05-27  3:57 ` Claude review: " Claude Code Review Bot
  2026-05-27  3:57 ` Claude Code Review Bot
  0 siblings, 2 replies; 7+ messages in thread
From: Paul Menzel @ 2026-05-26 22:32 UTC (permalink / raw)
  To: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
	Simona Vetter
  Cc: Paul Menzel, dri-devel, linux-kernel

With `video=DP-2:d drm.debug=0x04` the connectors are correctly forced off
at init time:

    [9.742468] [drm] forcing DP-2 connector off

but intel_dp_detect() is still called immediately after:

    [9.908738] [drm:intel_dp_detect] [CONNECTOR:130:DP-2]
    [9.912982] [drm:intel_hotplug_detect_connector] [CONNECTOR:130:DP-2] status updated from unknown to unknown (epoch counter 0->1)

drm_helper_probe_single_connector_modes() already short-circuits when
connector->force is set, returning the forced status without calling any
detect callbacks.  drm_helper_probe_detect() however has no such guard, so
callers that go through it directly – such as i915’s
intel_hotplug_detect_connector() – still run the full hardware probe (AUX
DPCD read, GMBus DDC transaction, ...) even when the user has forced a
connector off via the `video=` command-line parameter.

Add the same connector->force check for forced off connectors at the top of
drm_helper_probe_detect(), so that the hardware probe is skipped regardless
of the entry point.  This makes video=<connector>:d effective at boot time,
not just for userspace GETCONNECTOR ioctls.

DRM_FORCE_ON and DRM_FORCE_ON_DIGITAL are intentionally not short-
circuited here: for those cases the detect callback must still run to
initialise sink capabilities such as DPCD link rate and lane count.

Tested on a Dell XPS 13 9360 (Intel Kaby Lake-U GT2 [HD Graphics 620]
[8086:5916]). With `video=DP-2:d drm.debug=0x04, Linux logs:

    [   11.701243] [drm] forcing DP-2 connector off
    [...]
    [   12.102009] i915 0000:00:02.0: [drm:drm_helper_probe_detect [drm_kms_helper]] [CONNECTOR:130:DP-2] forced off, skipping detect

v2: Do not return early for DRM_FORCE_ON and DRM_FORCE_ON_DIGITAL (Jani,
gemini/gemini-3.1-pro-preview)

v3: Correct if condition

Assisted-by: Claude Sonnet 4.6
Signed-off-by: Paul Menzel <pmenzel@molgen.mpg.de>
---
 drivers/gpu/drm/drm_probe_helper.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/gpu/drm/drm_probe_helper.c b/drivers/gpu/drm/drm_probe_helper.c
index d4dc8cb45bce..1e15cb42d50b 100644
--- a/drivers/gpu/drm/drm_probe_helper.c
+++ b/drivers/gpu/drm/drm_probe_helper.c
@@ -401,6 +401,12 @@ drm_helper_probe_detect(struct drm_connector *connector,
 	struct drm_device *dev = connector->dev;
 	int ret;
 
+	if (connector->force == DRM_FORCE_OFF) {
+		drm_dbg_kms(dev, "[CONNECTOR:%d:%s] forced off, skipping detect\n",
+			    connector->base.id, connector->name);
+		return connector_status_disconnected;
+	}
+
 	if (!ctx)
 		return drm_helper_probe_detect_ctx(connector, force);
 
-- 
2.53.0


^ permalink raw reply related	[flat|nested] 7+ messages in thread
* [PATCH] drm/probe-helper: honour connector->force in drm_helper_probe_detect()
@ 2026-05-26 15:20 Paul Menzel
  2026-05-27  4:37 ` Claude review: " Claude Code Review Bot
  2026-05-27  4:37 ` Claude Code Review Bot
  0 siblings, 2 replies; 7+ messages in thread
From: Paul Menzel @ 2026-05-26 15:20 UTC (permalink / raw)
  To: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
	Simona Vetter
  Cc: Paul Menzel, dri-devel, linux-kernel

With `video=DP-2:d drm.debug=0x04` the connectors are correctly forced
off at init time:

    [9.742468] [drm] forcing DP-2 connector off

but `intel_dp_detect()` is still called immediately after:

    [9.908738] [drm:intel_dp_detect] [CONNECTOR:130:DP-2]
    [9.912982] [drm:intel_hotplug_detect_connector] [CONNECTOR:130:DP-2] status updated from unknown to unknown (epoch counter 0->1)

`drm_helper_probe_single_connector_modes()` already short-circuits when
`connector->force` is set, returning the forced status without calling
any detect callbacks.  `drm_helper_probe_detect()` however has no such
guard, so callers that go through it directly – such as i915's
`intel_hotplug_detect_connector()` – still run the full hardware probe
(AUX DPCD read, GMBus DDC transaction, …) even when the user has
forced a connector off via the `video=` command-line parameter.

Add the same connector->force check at the top of
`drm_helper_probe_detect()`, so that the hardware probe is skipped
regardless of the entry point.  This makes `video=<connector>:d`
effective at boot time, not just for userspace `GETCONNECTOR` ioctls.

This is tested on a Dell XPS 13 9360 (Intel Kaby Lake-U GT2 [HD Graphics
620] [8086:5916]). With `video=DP-2:d drm.debug=0x04`, Linux logs:

    [   11.701243] [drm] forcing DP-2 connector off
    [   11.701245] [drm:drm_connector_init_only [drm]] cmdline mode for connector DP-2  0x0@60Hz
    […]
    [   12.102009] i915 0000:00:02.0: [drm:drm_helper_probe_detect [drm_kms_helper]] [CONNECTOR:130:DP-2] force=1, skipping detect

Assisted-by: Claude Sonnet 4.6
Signed-off-by: Paul Menzel <pmenzel@molgen.mpg.de>
---
 drivers/gpu/drm/drm_probe_helper.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/drivers/gpu/drm/drm_probe_helper.c b/drivers/gpu/drm/drm_probe_helper.c
index d4dc8cb45bce..bc513f24bc28 100644
--- a/drivers/gpu/drm/drm_probe_helper.c
+++ b/drivers/gpu/drm/drm_probe_helper.c
@@ -401,6 +401,17 @@ drm_helper_probe_detect(struct drm_connector *connector,
 	struct drm_device *dev = connector->dev;
 	int ret;
 
+	if (connector->force) {
+		drm_dbg_kms(dev, "[CONNECTOR:%d:%s] force=%d, skipping detect\n",
+			     connector->base.id, connector->name,
+			     connector->force);
+		if (connector->force == DRM_FORCE_ON ||
+		    connector->force == DRM_FORCE_ON_DIGITAL)
+			return connector_status_connected;
+		else
+			return connector_status_disconnected;
+	}
+
 	if (!ctx)
 		return drm_helper_probe_detect_ctx(connector, force);
 
-- 
2.53.0


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2026-05-27  4:37 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-26 19:18 [PATCH v2] drm/probe-helper: honour connector->force in drm_helper_probe_detect() Paul Menzel
2026-05-27  4:18 ` Claude review: " Claude Code Review Bot
2026-05-27  4:18 ` Claude Code Review Bot
  -- strict thread matches above, loose matches on Subject: below --
2026-05-26 22:32 [PATCH v3] drm/probe-helper: Honour " Paul Menzel
2026-05-27  3:57 ` Claude review: " Claude Code Review Bot
2026-05-27  3:57 ` Claude Code Review Bot
2026-05-26 15:20 [PATCH] drm/probe-helper: honour " Paul Menzel
2026-05-27  4:37 ` Claude review: " Claude Code Review Bot
2026-05-27  4:37 ` Claude Code Review Bot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox