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

Bug#387563: Typo: lspci -X should be lspci -n



On Fri, Sep 15, 2006 at 03:07:01PM +0200, Michel D?nzer wrote:
> On Fri, 2006-09-15 at 08:27 +0300, Tapio Lehtonen wrote:
> > My lspci command does not have option -X. I think it should be -n. 
> > 
> > The text shown to user is here:
> > 
> > msgid ""
> > "You may wish to use the \"lspci -X\" command to determine the bus location "
> > "of your PCI, AGP, or PCI-Express video card."
> > 
> > It should be:
> > 
> > msgid ""
> > "You may wish to use the \"lspci -n\" command to determine the bus location "
> > "of your PCI, AGP, or PCI-Express video card."
> 
> Then it should prbably also mention that lspci -n prints hex numbers,
> but X takes decimal... from the pciutils changelog:
> 
> Looks like it was used after all.

The X people assured me it wasn't being used.  I'm not reintroducing the
flag.  I don't understand why you'd want -n.

 Users of PowerPC machines, and users of any computer with multiple video
 devices, should specify the BusID of the video card in an accepted
 bus-specific format.
 .
 Examples:
 .
  ISA:1
  PCI:0:16:0
  SBUS:/iommu@0,10000000/sbus@0,10001000/SUNW,tcx@2,800000
 .
 For users of multi-head setups, this option will configure only one of the
 heads.  Further configuration will have to be done manually in the X server
 configuration file, /etc/X11/xorg.conf.
 .
 The lspci command shows the bus location of your PCI, AGP, or PCI-Express
 video card in hexadecimal, please note that it must be specified in decimal
 in the configuration file.
 .
 When possible, this question has been pre-answered for you and you should
 accept the default unless you know it doesn't work.

Or alternatively, you could include a little program that shows you all
your VGA cards.  Something like this:

#!/usr/bin/perl

require "shellwords.pl";

while (<>) {
  @line = shellwords($_);
  next unless $line[1] =~ /VGA/;
  ($bus,$dev,$fn) = ($line[0] =~ /^(\S+):(\S+).(\d)/);
  $bus = hex($bus);
  $dev = hex($dev);
  print "PCI:$bus:$dev:$fn ($line[2] $line[3])\n";
}

Normally, you'd invoke it like this:
$ lspci -m | ./Xlspci
PCI:1:0:0 (nVidia Corporation NV17 [GeForce4 420 Go 32M])

But for the sake of testing ...

$ echo -e '01:1f.7 "VGA compatible controller" "nVidia Corporation" "NV17 [GeForce4 420 Go 32M]" -ra3 "Hewlett-Packard Company" "tc1100 tablet"\nff:10.5 "VGA compatible controller" "nVidiot Corporation" "NV17 [GeForce4 420 Go 32M]" -ra3 "Hewlett-Packard Company" "tc1100 tablet"' | ./Xlspci
PCI:1:31:7 (nVidia Corporation NV17 [GeForce4 420 Go 32M])
PCI:255:16:5 (nVidiot Corporation NV17 [GeForce4 420 Go 32M])

(If you prefer not to pipe data at it, this also works:

#!/usr/bin/perl

require "shellwords.pl";

open F, "lspci -m|" || die "Could not execute lspci";

while (<F>) {
  @line = shellwords($_);
  next unless $line[1] =~ /VGA/;
  ($bus,$dev,$fn) = ($line[0] =~ /^(\S+):(\S+)\.(\d)/);
  $bus = hex($bus);
  $dev = hex($dev);
  print "PCI:$bus:$dev:$fn ($line[2] $line[3])\n";
}

But I prefer to be able to test it).

The advanced hacker might want to extend this to support PCI domains
(hint, use lspci -mD to see domain numbers), but I don't know what the
X syntax is for specifying domains.  And we could do with a bit more
error checking ... but I think you see the idea.



Reply to: