diff options
author | Dale Rahn <drahn@cvs.openbsd.org> | 2004-03-17 15:48:00 +0000 |
---|---|---|
committer | Dale Rahn <drahn@cvs.openbsd.org> | 2004-03-17 15:48:00 +0000 |
commit | 4178fafc54052e6ef54592de97c1a70cc89a3256 (patch) | |
tree | 67c58bc205b33ead8ec5807725718d33df78b0ee /sys/arch/macppc/pci | |
parent | 9644ef019dd4f628919da5b1ebabbd88956371d7 (diff) |
Better backlight detection on macppc, ok miod@ krw@ (a bit ago)
Diffstat (limited to 'sys/arch/macppc/pci')
-rw-r--r-- | sys/arch/macppc/pci/vgafb.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/sys/arch/macppc/pci/vgafb.c b/sys/arch/macppc/pci/vgafb.c index 3bfef2eba27..bd8b957b9aa 100644 --- a/sys/arch/macppc/pci/vgafb.c +++ b/sys/arch/macppc/pci/vgafb.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vgafb.c,v 1.22 2003/10/24 20:02:45 drahn Exp $ */ +/* $OpenBSD: vgafb.c,v 1.23 2004/03/17 15:47:59 drahn Exp $ */ /* $NetBSD: vga.c,v 1.3 1996/12/02 22:24:54 cgd Exp $ */ /* @@ -303,8 +303,11 @@ vgafb_ioctl(void *v, u_long cmd, caddr_t data, int flag, struct proc *p) switch (dp->param) { case WSDISPLAYIO_PARAM_BRIGHTNESS: - of_setbrightness(dp->curval); - return 0; + if (cons_backlight_available == 1) { + of_setbrightness(dp->curval); + return 0; + } else + return -1; case WSDISPLAYIO_PARAM_BACKLIGHT: if (cons_backlight_available != 0) { vgafb_burn(vc, @@ -505,7 +508,8 @@ vgafb_burn(void *v, u_int on, u_int flags) { struct vgafb_config *vc = v; - if (vc->vc_backlight_on != on) { + if (cons_backlight_available == 1 && + vc->vc_backlight_on != on) { if (on == WSDISPLAYIO_VIDEO_ON) { OF_call_method_1("backlight-on", cons_display_ofh, 0); } else { |