[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: dexconf should default to PCI:1:0:0 ?



On Sat, May 29, 2004 at 11:54:14AM +0200, Bill Allombert wrote:
> On Sat, May 29, 2004 at 03:56:03AM -0500, Branden Robinson wrote:
> > More accurately, it defaults to:
> >   1) whatever lspci says the first VGA compatible device is, if lspci is
> >      available, returns information, and (if you have more than one video
> >      card or if you're on a PowerPC);
> 
> This is not the case here. dexconf default to PCI:0:1:0, but I have
> 0000:00:01.0 PCI bridge: Intel Corp. 82865G/PE/P PCI to AGP Controller (rev 02)
> 0000:01:00.0 VGA compatible controller: ATI Technologies Inc Radeon RV250 If [Radeon 9000] (rev 01)
> 
> > Let's look at the code, shall we?
> > 
> >     VIDEO_CARD=$(LC_ALL=C lspci -n | grep "Class 0300:" | head -n 1 | cut -d\  -f1)
> >     if [ -n "$VIDEO_CARD" ]; then
> >       # we now have an entry in "hex:hex.hex" format, need "PCI:decimal:decimal:decimal"
> >       BUS=$(printf "%d" 0x$(echo $VIDEO_CARD | cut -d: -f1) )
> >       DEVICE=$(printf "%d" 0x$(echo $VIDEO_CARD | cut -d: -f2 | cut -d. -f1) )
> >       FUNCTION=$(printf "%d" 0x$(echo $VIDEO_CARD | cut -d. -f2) )
> >       DEFAULT=PCI:$BUS:$DEVICE:$FUNCTION
> >     fi
> >   fi
> > fi
> 
> OK, that settle it: VIDEO_CARD is 0000:01:00.0, which is the correct device, 
> but then DEFAULT is set incorrectly, apparently it expects a different lspci
> format.

Bah, fuck.  lspci changed out from under me.

Excuse me for a few minutes while I get very angry.

> The template explains the old lspci format, not the new one.
> But anyway I did a similar mistake than your script by assuming
> the old behaviour.

Right.

> > I am unwilling to change the format of the BusID parameter that the
> > XFree86 X server accepts.  To do would render people's XF86Config-4
> > files incompatible between distributions.
> > 
> > If you have suggestions for how the following can be improved, please
> > offer them.
> 
> Maybe a -X option to lspci that output XF86Config compatible ids would
> be nice. Also this would allow lspci -n to change output without
> breaking dexconf. Especially since lspci -n format is not documented.

Yes.  Would you file a wishlist bug against lspci, please?

-- 
G. Branden Robinson                |     Reality is what refuses to go away
Debian GNU/Linux                   |     when I stop believing in it.
branden@debian.org                 |     -- Philip K. Dick
http://people.debian.org/~branden/ |

Attachment: signature.asc
Description: Digital signature


Reply to: