diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2009-11-28 22:16:00 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2009-11-28 22:16:00 +0000 |
commit | 42763ab306ac83ef6cfb56f64bf8b9122861a2f5 (patch) | |
tree | 11bdceeadbae2a6e5564008e11c59bf83de8a739 /sys/dev/pci | |
parent | b33662f249421f2790f1c84e1a69f6d959963afb (diff) |
Make sure we pass on DVACT_SUSPEND and DVACT_RESUME requests to our children
such that inteldrm(4) stands a chance at actually saving and restoring its
state. Makes it possible to start X after a suspend/resume cycle on my
Dell laptop with Intel graphics.
ok jsg@, miod@
Diffstat (limited to 'sys/dev/pci')
-rw-r--r-- | sys/dev/pci/vga_pci.c | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/sys/dev/pci/vga_pci.c b/sys/dev/pci/vga_pci.c index ade0289d995..0f68b66da37 100644 --- a/sys/dev/pci/vga_pci.c +++ b/sys/dev/pci/vga_pci.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vga_pci.c,v 1.44 2009/06/06 04:38:18 pirofti Exp $ */ +/* $OpenBSD: vga_pci.c,v 1.45 2009/11/28 22:15:59 kettenis Exp $ */ /* $NetBSD: vga_pci.c,v 1.3 1998/06/08 06:55:58 thorpej Exp $ */ /* @@ -104,6 +104,7 @@ int vga_pci_match(struct device *, void *, void *); void vga_pci_attach(struct device *, struct device *, void *); +int vga_pci_activate(struct device *, int); paddr_t vga_pci_mmap(void* v, off_t off, int prot); void vga_pci_bar_init(struct vga_pci_softc *, struct pci_attach_args *); @@ -133,6 +134,7 @@ int (*ws_set_param)(struct wsdisplay_param *); struct cfattach vga_pci_ca = { sizeof(struct vga_pci_softc), vga_pci_match, vga_pci_attach, + NULL, vga_pci_activate }; int @@ -213,6 +215,24 @@ vga_pci_attach(struct device *parent, struct device *self, void *aux) #endif } +int +vga_pci_activate(struct device *self, int act) +{ + struct vga_pci_softc *sc = (struct vga_pci_softc *)self; + int rv = 0; + + switch (act) { + case DVACT_SUSPEND: + rv = config_activate_children(self, act); + break; + case DVACT_RESUME: + rv = config_activate_children(self, act); + break; + } + + return (rv); +} + #if NINTAGP > 0 int intagpsubmatch(struct device *parent, void *match, void *aux) |