[PATCH] Additional pci-id for the nv driver

Aaron Plattner aplattner at nvidia.com
Mon Jan 26 13:36:42 PST 2009


On Sat, Jan 24, 2009 at 04:09:47AM -0800, Alberto Milone wrote:
> On Saturday 24 January 2009 01:02:37 you wrote:
> > On Fri, 2009-01-23 at 09:16 -0800, Alberto Milone wrote:
> > > Dear Aaron,
> > >
> > >
> > > I've noticed that the "nv" driver is not automatically chosen for my
> > > Geforce 7300 GT unless I don't specify the "nv" driver in the
> > > xorg.conf.
> >
> > Sorry, now that I look at it some more, something else must be wrong.
> > The 0x2E2 device ID should have hit the NVGetPCIXpressChip case in
> > NVPciProbe:
> >
> > const CARD32 id = ((dev->device_id & 0xfff0) == 0x00F0 ||
> > (dev->device_id & 0xfff0) == 0x02E0) ?
> > NVGetPCIXpressChip(dev) : dev->vendor_id << 16 |
> > dev->device_id;
> >
> > and come up with 0x0393. Can you please put a breakpoint there and see
> > what went wrong?
> >
> > -- Aaron
> >
> 
> 
> That case loop works well. I made the driver print a warning line right after that point and this is the result:
> (WW) NV: Detected device 0x10de0393 (GeForce 7300 GT) at 01 at 00:00:0
> 
> 
> The problem is that pci-id of my card (02E2) is not in /usr/share/xserver-xorg/pci/nv.ids

Aha.  Where does this file come from?  It's not part of the driver package.
I assume it's generated somehow?

> Without my patch:
> :~$ grep 02E2 /usr/share/xserver-xorg/pci/*
> 
> 
> With my patch:
> :~$ grep 02E2 /usr/share/xserver-xorg/pci/*
> /usr/share/xserver-xorg/pci/nv.ids:10DE02E2
> 
> 
> 
> :~$ lspci -n |grep 300
> 01:00.0 0300: 10de:02e2 (rev a2)
> 
> 
> This is why, as you can see in autodetection.log X doesn't use "nv" for my card when no driver is specified in the xorg.conf. In manualdetection.log you can see what happens when I set the driver to "nv" manually.
> 
> 
> The NVGetPCIXpressChip case is used when the driver is being loaded but we need to handle this before so that X knows which driver has to be used.

Why is it using PCI ID match tables in the first place, and why does
NVKnownChipsets matter?  The server already has an autoconfig mechanism
where it can fall back gracefully if the driver reports a given chip as
unsupported or it fails to initialize for whatever reason.  NVKnownChipsets
is just a translation table from PCI ID to product name.  The driver
supports more chipsets than what's in the table, including these bridged
devices where the real device ID has to be extracted from it.

Given that lots of stuff appears to be moving towards PCI ID match tables
even though it's not really a good idea, maybe it would be better to merge
NVPciIdMatchList and NVKnownChipsets, get rid of the mask-based matches in
NVIsSupported, and just flood all of the wildcard ranges with "Unknown GPU"
entries.

-- Aaron



More information about the xorg mailing list