diff options
author | Paul Irofti <pirofti@cvs.openbsd.org> | 2009-06-03 00:37:00 +0000 |
---|---|---|
committer | Paul Irofti <pirofti@cvs.openbsd.org> | 2009-06-03 00:37:00 +0000 |
commit | 9344e01007aa99035ba2b121731c3e4a13df06f7 (patch) | |
tree | 31d25d8ebb43dd288752db4ccaaeaf1b5e1789dc /sys/dev/pci/vga_pci.c | |
parent | 474ae2ea09a7f774a9c515f8140bb545c418eb8b (diff) |
Add acpivideo support. This adds brightness support for all laptops
except thinkpads, they will use the acpithinkpad driver. The driver is
also hooked into wsconsole. So brightness can be adjusted via:
$ wsconsctl display.brightness=<percentage>
This is very helpfull on some laptops that have a nasty bios and get two
steps instead of one when pressing the brightness button.
Tested on various dell, fujitsu, acer, samsung and other laptops.
Okay marco@, miod@. Suggestions from kettenis@.
Lots of reviews and help from miod@, thanks!
Diffstat (limited to 'sys/dev/pci/vga_pci.c')
-rw-r--r-- | sys/dev/pci/vga_pci.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/sys/dev/pci/vga_pci.c b/sys/dev/pci/vga_pci.c index b41b668e1d1..e6688252ace 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.40 2009/06/02 11:22:45 deraadt Exp $ */ +/* $OpenBSD: vga_pci.c,v 1.41 2009/06/03 00:36:59 pirofti Exp $ */ /* $NetBSD: vga_pci.c,v 1.3 1998/06/08 06:55:58 thorpej Exp $ */ /* @@ -117,6 +117,16 @@ int vesafb_putcmap(struct vga_pci_softc *, struct wsdisplay_cmap *); int vesafb_getcmap(struct vga_pci_softc *, struct wsdisplay_cmap *); #endif + +/* + * Function pointers for wsconsctl parameter handling. + * XXX These should be per-softc, but right now we only attach + * XXX a single vga@pci instance, so this will do. + */ +int (*ws_get_param)(struct wsdisplay_param *); +int (*ws_set_param)(struct wsdisplay_param *); + + struct cfattach vga_pci_ca = { sizeof(struct vga_pci_softc), vga_pci_match, vga_pci_attach, }; @@ -335,6 +345,14 @@ vga_pci_ioctl(void *v, u_long cmd, caddr_t addr, int flag, struct proc *pb) break; #endif + case WSDISPLAYIO_GETPARAM: + if(ws_get_param != NULL) + return (*ws_get_param)((struct wsdisplay_param *)addr); + break; + case WSDISPLAYIO_SETPARAM: + if(ws_set_param != NULL) + return (*ws_set_param)((struct wsdisplay_param *)addr); + break; default: error = ENOTTY; } |