Hi!
> > > here it is (some small changes to Frank's patch are: do not initialize
> > > *pacc,
> > > static vga_pci_state, a comment on why we fail suspend, whitespace
> > > cleanups):
> >
> > ACK, please commit.
>
> Done. BTW, when backporting it to an older distro, i removed the dependency
> to the fairly recent libpci by simply looking at how i did it in radeontool:
>
> --- s2ram.c
> +++ s2ram.c
> @@ -153,12 +153,14 @@
> int find_vga(void)
> {
> struct pci_dev *dev;
> + unsigned int class;
>
> pci_scan_bus(pacc); /* We want to get the list of devices */
>
> for (dev=pacc->devices; dev; dev=dev->next) {
> - pci_fill_info(dev, PCI_FILL_IDENT | PCI_FILL_CLASS);
> - if (dev->device_class == 0x300)
> + pci_fill_info(dev, PCI_FILL_IDENT);
> + class = pci_read_word(dev, PCI_CLASS_DEVICE);
> + if (class == 0x300)
> break;
> }
>
> @@ -266,7 +268,7 @@
>
> void s2ram_resume(void)
> {
> - if ((flags & PCI_SAVE) && vga_dev.device_class == 0x300) {
> + if (flags & PCI_SAVE) {
> printf("restoring PCI config of device %02x:%02x.%d\n",
> vga_dev.bus, vga_dev.dev, vga_dev.func);
> restore_vga_pci();
>
>
> The check in the second hunk is only paranoia anyway, since we never get
> there (if we did not find a device, we error out earlier).
I definitely like the second hunk.
> OTOH i'm not sure if it is worth it: people using recent suspend should
> run recent kernels and so should run recent userspace anyway :-)
Well, it looks ok to me; commit it if it makes your life easier.
Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures)
http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Suspend-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/suspend-devel