wrong primary display selected in multihead setup (PCI bus enumeration order)

Bug #55928 reported by Alexandre Otto Strube
6
Affects Status Importance Assigned to Milestone
xorg (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

Binary package hint: xserver-xorg

The configure script from xserver-xorg detects video hardware using /sbin/discover.

discover returns video devices using the same order that lspci does. (bus order?)

This makes the integrated video to appear BEFORE the one inserted on a AGP/PCI-E slot. Why is this wrong?

- When you configure BIOS setup to use the agp/pci-e device as the primary one, you will see the POST/grub/usplash in one monitor and X in the other one (as multihead is not configured)

- There are some broken BIOSes which shows the integrated device in lspci/discover even when you disable it in BIOS setup. This will make X fail (for instance, in live cd)

X knows what's the primary video adapter. From /var/log/Xorg.0.log, I found the line
"(II) Primary Device is: PCI 01:00:0"

The problem lies here:
/var/lib/dpkg/info/xserver-xorg.config line 576 (dapper's xorg):
# collect information about installed video card(s), if possible
if which discover > /dev/null 2>&1; then
  DISCOVERED_VIDEO=$(xdiscover_video)
  MULTIHEAD=$(echo "$DISCOVERED_VIDEO" | wc -l)
  DISCOVERED_VIDEO=$(echo "$DISCOVERED_VIDEO" | head -n 1)
  if [ -n "$DISCOVERED_VIDEO" ]; then
    NCARDS=$(echo "$DISCOVERED_VIDEO" | wc -l)
    SERVERS=$(echo "$DISCOVERED_VIDEO" | awk 'BEGIN { FS="\t" } {print $2}' | grep -v unknown | sort | uniq)
    if [ -n "$SERVERS" ]; then
      NSERVERS=$(echo "$SERVERS" | wc -l)
    fi
    DRIVERS=$(echo "$DISCOVERED_VIDEO" | awk 'BEGIN { FS="\t" } {print $NF}' | grep -v unknown | sort | uniq)
    if [ -n "$DRIVERS" ]; then
      NDRIVERS=$(echo "$DRIVERS" | wc -l)
    fi
    if [ $MULTIHEAD -gt 1 ]; then
      MULTIHEAD=yes
    fi
  fi
fi

This code just configures video adapters in the same order discover gives them. It would be desirable that it could find which one is the primary video, as X already knows how to do.

Paul Sladen (sladen)
Changed in xorg:
status: Unconfirmed → Confirmed
Revision history for this message
Alexandre Otto Strube (surak) wrote :

If someone gets here because the machine keeps detecting the disabled video card and not the external one, something good to know is that typing the "live xforcevesa" as the boot command would at least make the Live CD to boot.

Revision history for this message
Conrad Knauer (atheoi) wrote :

I think the bug description solved a mystery I was faced with: I have an old HP Pavilion 6630 (http://h10025.www1.hp.com/ewfrf/wc/document?docname=bph05258&lc=en&cc=us&dlc=pl&product=59927&lang=pl) with the most-up-to-date BIOS available (FresnoCognac_307) and its onboard video chip (Intel) is starting to have minor video jitters, so I wanted to add a new video card. The computer only has PCI slots, so that's what I added and then disabled the onboard one in the BIOS (or at least, that's what the BIOS said). I had forgotten to switch the video cable to the card and the computer beeped furiously at me when I tried to boot it up, so I quickly switched it to the card and it appeared to begin booting no problem...

Unfortunately, Ubuntu wouldn't finish booting. A Live CD wouldn't fully boot up either. Booting from the HD with safe graphics got me to a root command prompt where I could run dpkg-reconfigure xserver-xorg and it was then that I noticed that when it autodetected the video, it was choosing the onboard Intel instead of the S3 ViRGE-based card. lspci showed me that the S3 was located at "01:0e.0" and so I eventually got it working (though the S3 had its own problems :) but I couldn't figure out why it didn't automatically detect the S3 as the working shipset. Apparently its a BIOS issue. Too bad X doesn't just recognize what chipset its directly plugged into ;)

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.