Bug 55412

Summary: Screen turns black during boot after driver tries to set mode on NV50
Product: xorg Reporter: Lubosz Sarnecki <lubosz>
Component: Driver/nouveauAssignee: Maarten Lankhorst <bugs>
Status: RESOLVED FIXED QA Contact: Xorg Project Team <xorg-team>
Severity: normal    
Priority: medium    
Version: git   
Hardware: x86-64 (AMD64)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:
Attachments:
Description Flags
kernel log without flags
none
kernel log with nouveau.reg_debug=0x600 none

Description Lubosz Sarnecki 2012-09-28 11:51:39 UTC
Created attachment 67816 [details]
kernel log without flags

The following commit on current nouveau git master breaks setting a valid resolution at boot and results in a black screen.

commit 97d6852410a83e413d85649cb2cc10e17d6ee2ab
Author: Ben Skeggs <bskeggs@redhat.com>
Date:   Thu Jul 26 08:51:21 2012 +1000

    drm/nouveau/acpi: move definitions out of nouveau_drv.h
    
    Signed-off-by: Ben Skeggs <bskeggs@redhat.com>

An interesting thing about this bug is that it can be avoided with adding the kernel flag nouveau.reg_debug=0x600. With this flag a wrong resolution is set at boot and the screen does not turn black. The X Server cannot start anyway.

My native resolution is 1366x768. GRUB_GFXMODE is 1360x768x32, since the greater resolution is not listed in grub's vbeinfo.
nouveau and blob run X with 1366x768.

I will attach a log with and without the flag at commit 97d6852410a83e413d85649cb2cc10e17d6ee2ab.
Comment 1 Lubosz Sarnecki 2012-09-28 11:53:44 UTC
Created attachment 67817 [details]
kernel log with nouveau.reg_debug=0x600

Booted with the flag nouveau.reg_debug=0x600.
Comment 2 Lubosz Sarnecki 2012-11-08 15:07:57 UTC
I guess this can be closed, since it does not occur on Linux 3.6.6, which is more recent than the mentioned git version.
Comment 3 Emil Velikov 2012-11-08 15:56:22 UTC
Hi Lubosz

The commit mentioned was part of the big nouveau rework, that landed in the 3.7 kernel tree. Note that the commit has been rebased thus I cannot check why exactly it's causing issues with your system

From what I can see is
* With the offending commit, nouveau fails to detect any CRTC (outputs) connected, thus the issue
* With the commit and "nouveau.reg_debug=0x600" nouveau complains
"nouveau: `0x600' invalid for parameter `reg_debug" and does not load (at least not mentioned in the log)

Can you try the latest nouveau git or linux 3.7 to establish it this regression has been fixed or not

Thanks
Comment 4 Maarten Lankhorst 2012-11-08 16:14:06 UTC
Very easy to see what regressed, though..

upstream commit that made it to mainline is c0077061e7ea, with this:

 	if (nv_encoder->dcb->lvdsconf.use_acpi_for_edid) {
-		if (!nouveau_acpi_edid(dev, connector)) {
+		if (!(nv_connector->edid = nouveau_acpi_edid(dev, connector))) {
 			status = connector_status_connected;
 			goto out;
 		}

Which looks fine, but is inversion of logic. First it returned 0 on success, now it returns NULL on failure.. Fix would presumably be one line only:

-		if (!(nv_connector->edid = nouveau_acpi_edid(dev, connector))) {
+		if ((nv_connector->edid = nouveau_acpi_edid(dev, connector))) {
Comment 5 Maarten Lankhorst 2012-11-08 16:20:40 UTC
http://lists.freedesktop.org/archives/dri-devel/2012-November/030048.html

Patch sent.
Comment 6 Lubosz Sarnecki 2013-02-16 16:05:06 UTC
I can use nouveau on linux 3.7.8 without problems. The regression did not occur since 3.6.6 releases on this hardware.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.