On Wed, Jan 10, 2007 at 10:08:14PM +0100, Pavel Machek wrote:
> On Wed 2007-01-10 13:09:57, Stefan Seyfried wrote:
> > 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).

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 :-)
-- 
Stefan Seyfried
QA / R&D Team Mobile Devices        |              "Any ideas, John?"
SUSE LINUX Products GmbH, Nürnberg  | "Well, surrounding them's out." 

-------------------------------------------------------------------------
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
Suspend-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/suspend-devel

Reply via email to