Skip to contentSkip to conversation

nouveau: don't fail driver load if no display hw present.

PATCH In review Dave Airlie 2 participants 3 messages Nov 5, 2023 – Nov 15, 2023

Subsystems (3)
lore
Share & tools
lore

Dave Airlie

author maintainer
#0 lore raw

PATCH 1/1 nouveau: don't fail driver load if no display hw present.

From: Dave Airlie <[email protected]>

If we get back ENODEV don't fail load.

Fixes 15740541e8f0 ("drm/nouveau/devinit/tu102-: prepare for GSP-RM")
---
 drivers/gpu/drm/nouveau/nouveau_display.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/gpu/drm/nouveau/nouveau_display.c +5 -0
index d8c92521226d..f28f9a857458 100644
@@ -726,6 +726,11 @@ nouveau_display_create(struct drm_device *dev)
 
 	if (nouveau_modeset != 2) {
 		ret = nvif_disp_ctor(&drm->client.device, "kmsDisp", 0, &disp->disp);
+		/* no display hw */
+		if (ret == -ENODEV) {
+			ret = 0;
+			goto disp_create_err;
+		}
 
 		if (!ret && (disp->disp.outp_mask || drm->vbios.dcb.entries)) {
 			nouveau_display_create_properties(dev);
Signature · 1 line
2.41.0
#1 lore raw
Quoted 3 lines · Dave Airlie

From: Dave Airlie <[email protected]>

If we get back ENODEV don't fail load.

Maybe worth to note why this is OK in this case, might not be obvious to future readers of the code.

Quoted 2 lines
Fixes 15740541e8f0 ("drm/nouveau/devinit/tu102-: prepare for GSP-RM")

Maybe I'm missing something subtle here, but did you maybe pick the wrong commit here? At a first glance it looks like commit 073bde453635 ("drm/nouveau/kms/nv50-: disable dcb parsing") introduced the issue.

- Danilo

Quoted 22 lines
---
  drivers/gpu/drm/nouveau/nouveau_display.c | 5 +++++
  1 file changed, 5 insertions(+)
drivers/gpu/drm/nouveau/nouveau_display.c +5 -0
index d8c92521226d..f28f9a857458 100644
@@ -726,6 +726,11 @@ nouveau_display_create(struct drm_device *dev)
 
  	if (nouveau_modeset != 2) {
  		ret = nvif_disp_ctor(&drm->client.device, "kmsDisp", 0, &disp->disp);
+		/* no display hw */
+		if (ret == -ENODEV) {
+			ret = 0;
+			goto disp_create_err;
+		}
 
  		if (!ret && (disp->disp.outp_mask || drm->vbios.dcb.entries)) {
  			nouveau_display_create_properties(dev);
author maintainer
#2 lore raw
Quoted 8 lines · Danilo Krummrich
Quoted 3 lines · Dave Airlie

From: Dave Airlie <[email protected]>

If we get back ENODEV don't fail load.

Maybe worth to note why this is OK in this case, might not be obvious to future readers of the code.

Sent an updated version with that fixed.

Quoted 8 lines
Quoted 3 lines
Fixes 15740541e8f0 ("drm/nouveau/devinit/tu102-: prepare for GSP-RM")

Maybe I'm missing something subtle here, but did you maybe pick the wrong commit here? At a first glance it looks like commit 073bde453635 ("drm/nouveau/kms/nv50-: disable dcb parsing") introduced the issue.

Nope this commit causes the regression, as it powers off the display core in devinit, which means later we don't detect it because GSP doesn't power it back on.

Dave.