My graphics card is a Gainward GTX480 (http://www.gainward.com/main/vgapro.php?id=238). It has 2 DVI outputs, and 1 mini HDMI output. The DVI outputs are numbered on the card, with DVI 1 being the closest to the PCIe slot, then DVI 2, and finally the mini HDMI. My primary (left) monitor, is connected to DVI 1, my secondary (right) monitor to DVI 2. When I boot the computer, the BIOS initializes and uses the monitor on DVI 1. Grub is displayed on the primary monitor, and the kernel initially outputs to the primary monitor as well. However, as soon as the nouveau module is loaded, the primary monitor goes to standby and the kernel now uses the secondary monitor (on DVI 2) as primary. When X starts (no Xorg.conf file), it is also displayed on the secondary monitor. When using either efifb, vesafb or uvesafb, the monitor on DVI 1 is always the primary monitor. X with nvidia.ko also uses DVI 1 as the primary display. Finally, when booting Windows, the startup screen is also displayed on the monitor connected to DVI 1. Here comes the weird part: when I am in X, and run xrandr, it does show 3 connected devices: DVI-I-1, DVI-I-2, and HDMI-1, with DVI-I-2 being the only active one. So it seems that in X, the output order is correct, but with nouveaufb the DVI connectors are swapped. I will attach the output of dmesg here. If anything else is needed, please let me know and I'll be happy to add it.
Created attachment 92501 [details] dmesg
Can I see the output of "lspci -vn -d 10de:"?
Created attachment 92791 [details] Output of "lspci -vn -d 10de:" with nvidia.ko loaded This is with nvidia.ko loaded, since I reverted back to the proprietary driver. If you need it with nouveau loaded instead, let me know. One more thing I noticed with the proprietary driver: xrandr shows DVI-I-0, DVI-I-1, DVI-I-2, DVI-I-3, and HDMI-0, with DVI-I-2 being connector 1 and DVI-I-3 connector 2 on the card.
Created attachment 92801 [details] quirk Does it work correctly with this patch? Can you check whether the same bug occurs with analog cables? (In this case replace "if 0" with "if 1" and test it too).
The patch seems to fix it for nouveaufb. When starting X I still see strange behavior. When KDM starts, it is displayed on the correct monitor (the left monitor on DVI connector 1 on the card). However, when I log into KDE, xrandr says it is the monitor on DVI-I-2 that is connected. Maybe this needs a fix (an bugreport) somewhere else? I am unable to test with analog cables right now, as I am lacking DVI->VGA convertors. I have one, and should be able to find a 2nd one somewhere, but that will be for later. If you need any other info meanwhile ... And thanks for looking into this!
Created attachment 92811 [details] quirk v2 This patch should give you "correct" output numbers (although it's a cosmetic issue and should not matter).
The 2nd patch seems to give the same behaviour as the 1st patch. And I do not entirely agree it is only a cosmetic issue. With nvidia.ko, I use an Xorg.conf just with the Device section to have X use the proprietary driver. There are no screen or serverlayout sections, and I let kwin configure my monitors. With nouveau, I use no Xorg.conf at all, because X autodetects the nouveau driver. The difference with the nouveau driver is that even when I save the monitor layout in the KDE settings, when I log out and back in, the settings are forgotten. I would call that a KDE/kwin bug, but this does not happen with the proprietary driver.
Meanwhile I went up the attick to get me a 2nd DVI->VGA convertor. With your 2nd patch applied without modifications, and using VGA cables, the monitor on the right (DVI connector 2 on the card) is used by nouveaufb as soon as it's loaded. This is wrong. In KDE and xrandr however it is recognized as DVI-I-2, which seems correct. With your 2nd patch, "#if 0" changed into "#if 1", and using VGA cables, the monitor on the left (DVI connector 1 on the card) is used by nouveaufb as soon as it's loaded. This is good. KDE and xrandr recognize it as DVI-I-2 though, while it should be DVI-I-1. Do you want me to test your first patch as well, with "#if 0" changed into "#if 1"?
Yes, please do it. I think it will fix all issues (both VGA and DVI setups will work and output numbering will be correct).
Unfortunately with the first patch and #if 0 -> #if 1 nouveau and X start on the 2nd monitor again (with DVI cables). shall I test with vga cables again too ?
Created attachment 93171 [details] quirk v3 maybe this one?
Still not good, the 2nd monitor is initialized first, both by nouveaufb and X. It is recognized as DVI-I-2 though.
Not sure if this is still an issue, and as I no longer own the card, I'll just close this.