summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorDale Rahn <drahn@cvs.openbsd.org>2003-10-24 20:02:46 +0000
committerDale Rahn <drahn@cvs.openbsd.org>2003-10-24 20:02:46 +0000
commit1e9a705cf6d4640d99a94b66fdcd9dea0444dbf2 (patch)
tree72c5864f08943669de8860a984560c0cd612bd2b /sys
parentb1ad6b4cf35556d6a52d4e724c959f02000d7d05 (diff)
If cons_backlight_available is not set, cons_brightness will not be valid,
return -1 to indicate so. same as WSDISPLAYIO_PARAM_BACKLIGHT.
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/macppc/pci/vgafb.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/sys/arch/macppc/pci/vgafb.c b/sys/arch/macppc/pci/vgafb.c
index ce1a057a557..3bfef2eba27 100644
--- a/sys/arch/macppc/pci/vgafb.c
+++ b/sys/arch/macppc/pci/vgafb.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vgafb.c,v 1.21 2003/10/15 23:00:57 drahn Exp $ */
+/* $OpenBSD: vgafb.c,v 1.22 2003/10/24 20:02:45 drahn Exp $ */
/* $NetBSD: vga.c,v 1.3 1996/12/02 22:24:54 cgd Exp $ */
/*
@@ -278,10 +278,13 @@ vgafb_ioctl(void *v, u_long cmd, caddr_t data, int flag, struct proc *p)
switch (dp->param) {
case WSDISPLAYIO_PARAM_BRIGHTNESS:
- dp->min = MIN_BRIGHTNESS;
- dp->max = MAX_BRIGHTNESS;
- dp->curval = cons_brightness;
- return 0;
+ if (cons_backlight_available != 0) {
+ dp->min = MIN_BRIGHTNESS;
+ dp->max = MAX_BRIGHTNESS;
+ dp->curval = cons_brightness;
+ return 0;
+ }
+ return -1;
case WSDISPLAYIO_PARAM_BACKLIGHT:
if (cons_backlight_available != 0) {
dp->min = 0;