Bug 37669 - [NVAC] problem when unplugging DP-1
Summary: [NVAC] problem when unplugging DP-1
Status: RESOLVED INVALID
Alias: None
Product: xorg
Classification: Unclassified
Component: Driver/nouveau (show other bugs)
Version: unspecified
Hardware: Other Linux (All)
: medium normal
Assignee: Nouveau Project
QA Contact: Xorg Project Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-27 09:24 UTC by Antoine Reversat
Modified: 2013-08-18 18:10 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
Dmesg after external monitor disabled (65.00 KB, text/plain)
2011-05-27 09:24 UTC, Antoine Reversat
no flags Details
Dmesg with drm.debug=0x07 with several connect/disconnect (623.92 KB, text/plain)
2011-12-06 11:47 UTC, Antoine Reversat
no flags Details
dmesg with drm.debug=15 and nouveau.reg_debug=0x200 1 unplug/replug (479.76 KB, text/plain)
2011-12-08 08:31 UTC, Antoine Reversat
no flags Details
vbios (64.00 KB, application/octet-stream)
2011-12-15 07:38 UTC, Antoine Reversat
no flags Details

Description Antoine Reversat 2011-05-27 09:24:37 UTC
Created attachment 47232 [details]
Dmesg after external monitor disabled

I have a macbook 5,1 with an NVAC card (02:00.0 VGA compatible controller: nVidia Corporation C79 [GeForce 9400M] (rev b1))

When I unplug my external monitor (plugged through a mini display port -> dvi adapter) my window manager tries to disable the external screen resulting in my main screen flickering and being unusable (only the cursor moves).

Attached is the output of dmesg after it has happened (I was still able to access the machine through ssh).
Comment 1 Antoine Reversat 2011-12-06 11:44:37 UTC
So I started looking deeper into this issue and it's probably somewhat low-level as if I boot my computer into a console and load the nouveau driver then unplug DP-1 the same flickering happens (but re-pluging the monitor on DP-1 stops the flickering). I'll attach a demsg output with drm.debug=0x07 there's some interresting things specialy (I think) these lines :

checking generic (c0010000 640000) vs hw (c0000000 10000000)

and then 

Dec  6 10:55:25 antoine-MacBook kernel: [   15.878616] [drm] nouveau 0000:02:00.0: Register 0x00004028 not found in PLL limits table
Dec  6 10:55:25 antoine-MacBook kernel: [   15.878622] [drm] nouveau 0000:02:00.0: Register 0x00004008 not found in PLL limits table
Dec  6 10:55:25 antoine-MacBook kernel: [   15.878630] [drm] nouveau 0000:02:00.0: Register 0x00004030 not found in PLL limits table
Comment 2 Antoine Reversat 2011-12-06 11:47:24 UTC
Created attachment 54156 [details]
Dmesg with drm.debug=0x07 with several connect/disconnect
Comment 3 Antoine Reversat 2011-12-08 08:31:34 UTC
Created attachment 54243 [details]
dmesg with drm.debug=15 and nouveau.reg_debug=0x200 1 unplug/replug
Comment 4 Antoine Reversat 2011-12-15 07:38:18 UTC
Created attachment 54465 [details]
vbios
Comment 5 Antoine Reversat 2011-12-15 07:47:52 UTC
So I've gotten a bit further.

I tracked down the code that triggers the issue : it's this part of nv50_sor.c :

        if (!nv_wait(dev, NV50_PDISPLAY_SOR_DPMS_CTRL(or),
                    NV50_PDISPLAY_SOR_DPMS_CTRL_PENDING, 0)) {
            NV_ERROR(dev, "timeout: SOR_DPMS_CTRL_PENDING(%d) == 0\n", or);
            NV_ERROR(dev, "SOR_DPMS_CTRL(%d) = 0x%08x\n", or,
                    nv_rd32(dev, NV50_PDISPLAY_SOR_DPMS_CTRL(or)));
        }

        val = nv_rd32(dev, NV50_PDISPLAY_SOR_DPMS_CTRL(or));

        if (mode == DRM_MODE_DPMS_ON)
            val |= NV50_PDISPLAY_SOR_DPMS_CTRL_ON;
        else
            val &= ~NV50_PDISPLAY_SOR_DPMS_CTRL_ON;

        nv_wr32(dev, NV50_PDISPLAY_SOR_DPMS_CTRL(or), val |
                NV50_PDISPLAY_SOR_DPMS_CTRL_PENDING);
        if (!nv_wait(dev, NV50_PDISPLAY_SOR_DPMS_STATE(or),
                    NV50_PDISPLAY_SOR_DPMS_STATE_WAIT, 0)) {
            NV_ERROR(dev, "timeout: SOR_DPMS_STATE_WAIT(%d) == 0\n", or);
            NV_ERROR(dev, "SOR_DPMS_STATE(%d) = 0x%08x\n", or,
                    nv_rd32(dev, NV50_PDISPLAY_SOR_DPMS_STATE(or)));
        }


If I add an if to skip the code if the sor is going to DPMS off and the encoder type is tmds then the bug doesn't happen anymore. I don't understand how this affects sor0 (which the LVDS output is using) as the code seems pretty sane.

I also noted something and am not sure whether it's correct or not. My flat panel is connected through a DP-DVI adapter but nv_encoder->dcb->type is OUTPUT_TMDS not OUTPUT_DP. Is this due to the fact that it's "DVI over DP" ? Or is this not normal ?
Comment 6 Ilia Mirkin 2013-08-18 18:10:06 UTC
It appears that this bug report has laid dormant for quite a while. Sorry we haven't gotten to it. Since we fix bugs all the time, chances are pretty good that your issue has been fixed with the latest software. Please give it a shot. (Linux kernel 3.10.7, xf86-video-nouveau 1.0.9, mesa 9.1.6, or their git versions.) If upgrading to the latest isn't an option for you, your distro's bugzilla is probably the right destination for your bug report.

In an effort to clean up our bug list, we're pre-emptively closing all bugs that haven't seen updates since 2011. If the original issue remains, please make sure to provide fresh info, see http://nouveau.freedesktop.org/wiki/Bugs/ for what we need to see, and re-open this one.

Thanks,

The Nouveau Team


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.