xf86ReadDomainMemory() currently reads the ROM from sysfs 1 byte at a time.
I've measured this taking over 20 seconds to complete. Is there any reason to
read the ROM in such small chunks? I'll upload a patch that reads in larger
chunks, reducing the ROM read time to about a tenth of a second.
Created attachment 7458 [details] [review]
Read the ROM in big chunks
This patch significantly reduces the number of reads to load the VGA ROM. At
least one distribution (SLES10) already includes this patch.
Sorry about the phenomenal bug spam, guys. Adding xorg-team@ to the QA contact so bugs don't get lost in future.
Think this is resolved in pciaccess, but let's put it on the tracker to be sure it gets looked at.
This looks good in libpciaccess from what I can tell.
pci_device_linux_sysfs_read_rom reads the whole file in. It gets the size from fstat'ing the file. If it can't open the file via sysfs pci_device_linux_devmem_read_rom gets called to read the ROM, and it just reads the whole ROM in as well via slightly different means.
I'm going to mark this closed. Please reopen if you think I've missed something and this bug isn't really fixed.
(In reply to comment #4)
> pci_device_linux_sysfs_read_rom reads the whole file in. It gets the size from
> fstat'ing the file.
i'm not sure that's such a good plan. at least on my machine, fstat() says the size is 0, while reading from the file works fine.
(In reply to comment #5)
> (In reply to comment #4)
> > pci_device_linux_sysfs_read_rom reads the whole file in. It gets the size from
> > fstat'ing the file.
> i'm not sure that's such a good plan. at least on my machine, fstat() says the
> size is 0, while reading from the file works fine.
I've seen the same behavior. Seems to vary from card to card.
Ok, I'm reopening this and reassigning it to libpciaccess.
The 'fstat returns 0 size' thing is a different bug.
*** This bug has been marked as a duplicate of bug 13988 ***