[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#1042753: nouveau: Screen remains black.



On Monday, 31 July 2023 18:20:12 CEST Olaf Skibbe wrote:
> > If there is a 6.1 kernel that does work, then it helps if you can find the
> > latest 6.1 kernel which works and (thus) the first kernel version where it
> > stopped working.
> 
> I installed 6.1.0-9-amd64 now from the standard repositories and
> graphics works. Hope this is sufficient to narrow it down

Yep, now we know it's a regression between 6.1.27-1 and 6.1.38-2.

https://wiki.debian.org/DebianKernel/GitBisect describes the best way as it
would identify the exact (upstream) commit which introduced the problem.
If you can do that, great.

If not, we can try to make an educated guess
me@pc:~/dev/kernel.org/linux$ git log --oneline v6.1.27..v6.1.38 -- drivers/gpu/drm/nouveau/
62aecf23f3d1 drm/nouveau: add nv_encoder pointer check for NULL
fb725beca62d drm/nouveau/dp: check for NULL nv_connector->native_mode
90748be0f4f3 drm/nouveau: don't detect DSM for non-NVIDIA device
5a144bad3e75 nouveau: fix client work fence deletion race

This is the list of commits to the nouveau driver between those versions.
I've attached 4 patches created with `git revert <commit-id>`

https://kernel-team.pages.debian.net/kernel-handbook/ch-common-tasks.html#id-1.6.6.4
describes a procedure for "Simple patching and building" and the idea is to
pass these 4 patches as argument to `test-patches`.
The idea is to build a new 6.1.38 kernel, but with the 4 above mentioned
commits reverted and then boot into your new kernel and see if that resolves
the issue (too). If that's the case, then it's 1 of those 4 commits that's
causing the problem. Ideally that would be reduced to 1 specific patch, but
there isn't one that jumps out for me.

@Ben/Salvatore (=actual Debian kernel maintainers):
Did I describe it correctly? And does `test-patches` need to be run when
booted into the 6.1.38 kernel or does that not matter?
Does 1 of those 4 patches/commits stand out for you as the most likely cause?

Cheers,
  Diederik
>From ffd112759014915ce769cb37ed1ce6e3184dde2a Mon Sep 17 00:00:00 2001
From: Diederik de Haas <didi.debian@cknow.org>
Date: Mon, 31 Jul 2023 19:55:33 +0200
Subject: [PATCH 1/4] Revert "drm/nouveau: add nv_encoder pointer check for
 NULL"

This reverts commit 62aecf23f3d12f0a1b170bfd2174fd58d0d1bf50.
---
 drivers/gpu/drm/nouveau/nouveau_connector.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/nouveau/nouveau_connector.c b/drivers/gpu/drm/nouveau/nouveau_connector.c
index f40310559d13..fd984733b8e6 100644
--- a/drivers/gpu/drm/nouveau/nouveau_connector.c
+++ b/drivers/gpu/drm/nouveau/nouveau_connector.c
@@ -730,8 +730,7 @@ nouveau_connector_detect_lvds(struct drm_connector *connector, bool force)
 #endif
 
 	nouveau_connector_set_edid(nv_connector, edid);
-	if (nv_encoder)
-		nouveau_connector_set_encoder(connector, nv_encoder);
+	nouveau_connector_set_encoder(connector, nv_encoder);
 	return status;
 }
 
-- 
2.40.1

>From 47c0e938beef7335ffa179f1006754f9664c6c4d Mon Sep 17 00:00:00 2001
From: Diederik de Haas <didi.debian@cknow.org>
Date: Mon, 31 Jul 2023 19:55:54 +0200
Subject: [PATCH 2/4] Revert "drm/nouveau/dp: check for NULL
 nv_connector->native_mode"

This reverts commit fb725beca62d175c02ca619c27037c14f7ab8e7c.
---
 drivers/gpu/drm/nouveau/nouveau_connector.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/nouveau/nouveau_connector.c b/drivers/gpu/drm/nouveau/nouveau_connector.c
index fd984733b8e6..1991bbb1d05c 100644
--- a/drivers/gpu/drm/nouveau/nouveau_connector.c
+++ b/drivers/gpu/drm/nouveau/nouveau_connector.c
@@ -966,7 +966,7 @@ nouveau_connector_get_modes(struct drm_connector *connector)
 	/* Determine display colour depth for everything except LVDS now,
 	 * DP requires this before mode_valid() is called.
 	 */
-	if (connector->connector_type != DRM_MODE_CONNECTOR_LVDS && nv_connector->native_mode)
+	if (connector->connector_type != DRM_MODE_CONNECTOR_LVDS)
 		nouveau_connector_detect_depth(connector);
 
 	/* Find the native mode if this is a digital panel, if we didn't
@@ -987,7 +987,7 @@ nouveau_connector_get_modes(struct drm_connector *connector)
 	 * "native" mode as some VBIOS tables require us to use the
 	 * pixel clock as part of the lookup...
 	 */
-	if (connector->connector_type == DRM_MODE_CONNECTOR_LVDS && nv_connector->native_mode)
+	if (connector->connector_type == DRM_MODE_CONNECTOR_LVDS)
 		nouveau_connector_detect_depth(connector);
 
 	if (nv_encoder->dcb->type == DCB_OUTPUT_TV)
-- 
2.40.1

>From 07a2576f9fb4bb3ebb93593a4831b092105e622e Mon Sep 17 00:00:00 2001
From: Diederik de Haas <didi.debian@cknow.org>
Date: Mon, 31 Jul 2023 19:56:12 +0200
Subject: [PATCH 3/4] Revert "drm/nouveau: don't detect DSM for non-NVIDIA
 device"

This reverts commit 90748be0f4f386ad3143cd7538ef37647e1f6260.
---
 drivers/gpu/drm/nouveau/nouveau_acpi.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/gpu/drm/nouveau/nouveau_acpi.c b/drivers/gpu/drm/nouveau/nouveau_acpi.c
index a2ae8c21e4dc..8cf096f841a9 100644
--- a/drivers/gpu/drm/nouveau/nouveau_acpi.c
+++ b/drivers/gpu/drm/nouveau/nouveau_acpi.c
@@ -220,9 +220,6 @@ static void nouveau_dsm_pci_probe(struct pci_dev *pdev, acpi_handle *dhandle_out
 	int optimus_funcs;
 	struct pci_dev *parent_pdev;
 
-	if (pdev->vendor != PCI_VENDOR_ID_NVIDIA)
-		return;
-
 	*has_pr3 = false;
 	parent_pdev = pci_upstream_bridge(pdev);
 	if (parent_pdev) {
-- 
2.40.1

>From e071140f5f76d726310192fe8858fdc120ee129d Mon Sep 17 00:00:00 2001
From: Diederik de Haas <didi.debian@cknow.org>
Date: Mon, 31 Jul 2023 19:56:26 +0200
Subject: [PATCH 4/4] Revert "nouveau: fix client work fence deletion race"

This reverts commit 5a144bad3e75e17d38b3b7609400606dba9d12c8.
---
 drivers/gpu/drm/nouveau/nouveau_drm.c | 14 ++++----------
 1 file changed, 4 insertions(+), 10 deletions(-)

diff --git a/drivers/gpu/drm/nouveau/nouveau_drm.c b/drivers/gpu/drm/nouveau/nouveau_drm.c
index 28062d682f43..fd99ec0f4257 100644
--- a/drivers/gpu/drm/nouveau/nouveau_drm.c
+++ b/drivers/gpu/drm/nouveau/nouveau_drm.c
@@ -139,16 +139,10 @@ nouveau_name(struct drm_device *dev)
 static inline bool
 nouveau_cli_work_ready(struct dma_fence *fence)
 {
-	bool ret = true;
-
-	spin_lock_irq(fence->lock);
-	if (!dma_fence_is_signaled_locked(fence))
-		ret = false;
-	spin_unlock_irq(fence->lock);
-
-	if (ret == true)
-		dma_fence_put(fence);
-	return ret;
+	if (!dma_fence_is_signaled(fence))
+		return false;
+	dma_fence_put(fence);
+	return true;
 }
 
 static void
-- 
2.40.1

Attachment: signature.asc
Description: This is a digitally signed message part.


Reply to: