performance of pci_device_get_{vendor, device}_name() in X server startup
Richard Barnette
jrbarnette at chromium.org
Tue Jun 8 17:20:31 PDT 2010
On Jun 8, 2010, at 5:04 PM, Greg KH wrote:
[ ... ]
>> It's basically the cache discussed in another thread, expanded to
>> contain all entries from pci.ids :) Hence the amount of work should
>> be
>> approximately the same.
>
> Ok, I'm coming in late, but why in the world would the x server ever
> care about the pci.ids file? Why would the mapping from id to
> string be
> needed anywhere here?
>
On a lot of systems, display devices are VGA compatible devices on
the PCI bus. During X server startup, the server logs information
that it find about the various video devices that it finds, and some
of the logged information includes the PCI vendor and device information
from the pci.ids file, if the information is available on the system.
The information also gets stuffed into memory as the device description
in a different part of the initialization code. I can't say that I
understand the usage fully, although I think in some cases the
information
can get printed in error messages in the log.
Here's what a quick 'grep' will tell you:
$ find hw -type f | xargs grep 'pci_device_.*_name'
hw/xfree86/common/xf86Configure.c: VendorName =
pci_device_get_vendor_name( pVideo );
hw/xfree86/common/xf86Configure.c: CardName =
pci_device_get_device_name( pVideo );
hw/xfree86/common/xf86pciBus.c: vendorname =
pci_device_get_vendor_name( info );
hw/xfree86/common/xf86pciBus.c: chipname =
pci_device_get_device_name( info );
As for whether the information is truly "needed", I definitely would
like to hear from folks on that score. However, I've done just enough
debugging of complicated failures that I wouldn't be surprised that for
some users, in some cases, the presence of the information in the log
could help.
I'll note that if no-one wants to pipe up with "I'm morally certain
that the information can be valuable", I'm more than willing to fix the
problem by purging the calls from the source.
> confused,
>
> greg k-h
-- jrb
More information about the xorg-devel
mailing list