Skip to contentSkip to conversation

nouveau/connector: set no zero sized all displayport on nouveau

PATCH New Dave Airlie 2 participants 2 messages Aug 27

Subsystems (3)
lore
Share & tools
lore

Dave Airlie

author maintainer
#0 lore raw

PATCH 1/1 nouveau/connector: set no zero sized all displayport on nouveau

From: Dave Airlie <[email protected]>

I'm seeing failures on Turing with some monitors, let just not bother with zero sized on any nvidia GPU.

Fixes 6cc6e08d4542 ("drm/nouveau/kms: add support for GB20x")
---
 drivers/gpu/drm/nouveau/nouveau_connector.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/gpu/drm/nouveau/nouveau_connector.c +1 -2
index b0b0ad9a0c24..9b9c9ea2bce1 100644
@@ -1404,8 +1404,7 @@ nouveau_connector_create(struct drm_device *dev, int index)
 		nv_connector->aux.drm_dev = dev;
 		nv_connector->aux.transfer = nouveau_connector_aux_xfer;
 		nv_connector->aux.name = connector->name;
-		if (disp->disp.object.oclass >= GB202_DISP)
-			nv_connector->aux.no_zero_sized = true;
+		nv_connector->aux.no_zero_sized = true;
 		drm_dp_aux_init(&nv_connector->aux);
 		break;
 	default:
Signature · 1 line
2.54.0
#1 lore raw
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:

Pre-existing issues:
- [High] Enabling no_zero_sized globally exposes pre-existing bugs in drm_dp_i2c_xfer(), breaking REPEATED START for multi-message transfers (e.g., EDID reads) and causing phantom devices during I2C probing. --

commit bbcbb4f64ad839a36fe04a07743e9aaa99d1aec1
Author: Dave Airlie <[email protected]>

nouveau/connector: set no zero sized all displayport on nouveau

This commit removes the architecture generation check for the no_zero_sized flag on DisplayPort/eDP connectors. It applies the flag unconditionally for all Nvidia GPUs in nouveau.

drivers/gpu/drm/nouveau/nouveau_connector.c nouveau_connector_create(struct drm_device *dev, int index) · line 1407

Quoted 11 lines
drivers/gpu/drm/nouveau/nouveau_connector.c +1 -2
index b0b0ad9a0c248..9b9c9ea2bce12 100644
@@ -1404,8 +1404,7 @@ nouveau_connector_create(struct drm_device *dev, int index)
 		nv_connector->aux.drm_dev = dev;
 		nv_connector->aux.transfer = nouveau_connector_aux_xfer;
 		nv_connector->aux.name = connector->name;
-		if (disp->disp.object.oclass >= GB202_DISP)
-			nv_connector->aux.no_zero_sized = true;
+		nv_connector->aux.no_zero_sized = true;
                ^^^^

[Severity: High]
This isn't a bug introduced by this patch, but enabling no_zero_sized unconditionally for all DisplayPort/eDP connections exposes a pre-existing bug in drm_dp_i2c_xfer() for multi-message transfers.

When no_zero_sized is true, drm_dp_i2c_xfer() erroneously clears the MOT (Middle-Of-Transfer) bit at the end of every message rather than only at the end of the final message.

In drivers/gpu/drm/display/drm_dp_helper.c:drm_dp_i2c_xfer():

	for (j = 0; j < msgs[i].len; j += msg.size) {
		...
		if (j + msg.size == msgs[i].len && aux->no_zero_sized)
			msg.request &= ~DP_AUX_I2C_MOT;
		...
	}

By clearing DP_AUX_I2C_MOT at the end of each message loop, this breaks the REPEATED START condition required for multi-message I2C transfers (such as EDID reads), emitting STOP conditions between messages instead.

Additionally, zero-length I2C transfers are entirely bypassed by the loop:

	for (j = 0; j < msgs[i].len; j += msg.size) {

When len is 0, this loop is skipped, resulting in no hardware interaction while still falsely reporting success. This can cause I2C scanning to see phantom devices at every address.

Does it make sense to fix drm_dp_i2c_xfer() before enabling this flag globally for all Nvidia GPUs to avoid regressing display detection and I2C probing on strict monitors?

Quoted 3 lines
drivers/gpu/drm/nouveau/nouveau_connector.c +0 -0
 		drm_dp_aux_init(&nv_connector->aux);
 		break;
 	default:
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1