Ignore:
Timestamp:
03/03/14 09:28:38 (7 months ago)
Author:
Kris Moore <kris@…>
Branches:
master, releng/10.0.1, releng/10.0.2, releng/10.0.3
Children:
4f9718b
Parents:
c1e0e78
Message:

Add a important fix to video detection. For some reason on 10.x Xorg isn't detecting
video cards with difference BusID settings... This causes chaos when the board
is on a weird pci device, or has multiple video devices installed.

Now we will first probe for vgapci0, and setup an xorg.conf based upon that using
the correct BusID value.

If that fails, we will then test vgapci1, and lastly fallback to vesa mode

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src-qt4/pc-xgui/resources/bin/rundetect.sh

    r1a4b7a1 r5e26f0b  
    2929# Start the script now 
    3030 
    31 cfg_second_card() 
     31cfg_card_busid() 
    3232{ 
     33  whichcard="$1" 
     34 
    3335  # This is a script to try an xorg.conf file configured to use the second vgapci1 device 
    3436  # For most systems this wont do anything, but on a number of newer hybrid 
     
    6769  rm /tmp/.pciconf.$$ 
    6870 
    69   # No secondary card, return 1 
    70   if [ -z "$card2" ] ; then return 1; fi 
    71  
    72   # Is this secondary an Intel chipset? 
    73   echo "$card2" | grep -q -i -e "intel" 
    74   if [ $? -ne 0 ] ; then return 1 ; fi 
    75  
    76   # Found a second card, lets try an xorg config for it 
     71  # Which card are we configuring 
     72  if [ "$whichcard" = "1" ] ; then 
     73    cfgCard="$card1" 
     74    cfgCardBusID="$card1bus" 
     75  else 
     76    cfgCard="$card2" 
     77    cfgCardBusID="$card2bus" 
     78  fi 
     79 
     80  # No detected, return 1 
     81  if [ -z "$cfgCard" ] ; then return 1; fi 
     82 
     83  # Is this an Intel chipset? 
     84  echo "$cfgCard" | grep -q -i -e "intel" 
     85  if [ $? -eq 0 ] ; then 
     86     driver="intel" 
     87  fi 
     88  echo "$cfgCard" | grep -q -i -e "nvidia" 
     89  if [ $? -eq 0 ] ; then 
     90     driver="nvidia" 
     91  fi 
     92 
     93  # Found a card, lets try an xorg config for it 
    7794  cp ${PROGDIR}/cardDetect/XF86Config.default /etc/X11/xorg.conf 
    78   echo " 
     95  if [ -n "$driver" ] ; then 
     96    echo " 
    7997Section \"Device\" 
    8098        Identifier      \"Card0\" 
    81         Driver          \"intel\" 
    82         BusID           \"${card2bus}\" 
     99        Driver          \"$driver\" 
     100        BusID           \"${cfgCardBusID}\" 
    83101EndSection 
    84102  " >> /etc/X11/xorg.conf 
    85  
    86   echo "Hybrid video detected! Using Intel chipset..." 
    87   sleep 3 
     103  else 
     104    echo " 
     105Section \"Device\" 
     106        Identifier      \"Card0\" 
     107        BusID           \"${cfgCardBusID}\" 
     108EndSection 
     109  " >> /etc/X11/xorg.conf 
     110  fi 
    88111 
    89112  return 0 
     
    172195      cp ${PROGDIR}/cardDetect/XF86Config.compat /etc/X11/xorg.conf 
    173196    else 
    174       cfg_second_card 
     197      cfg_card_busid "1" 
    175198      if [ $? -ne 0 ] ; then 
    176199        # Check if this system has a nvidia device, and run nvidia-xconfig 
     
    184207    fi 
    185208  elif [ "${ATTEMPT}" = "1" ] ; then 
     209    cfg_card_busid "2" 
     210 
    186211    # Failed to start X 
    187212    # Now lets have it try some magic itself 
Note: See TracChangeset for help on using the changeset viewer.