summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkettenis <kettenis@openbsd.org>2009-06-19 06:23:03 +0000
committerkettenis <kettenis@openbsd.org>2009-06-19 06:23:03 +0000
commit299d57264a782c452252b30b805b771985184ff0 (patch)
tree698ed69e0af57b2a0073fbbf17c0e867c599ef9d
parentEither jordan or jsing left some debug prints behind. tsk tsk. (diff)
downloadwireguard-openbsd-299d57264a782c452252b30b805b771985184ff0.tar.xz
wireguard-openbsd-299d57264a782c452252b30b805b771985184ff0.zip
Always report 0 as the minimal brightness level to wscons. This results in
more reasonable brightness level reporting. In particular we won't report 0% if the lowest level supported by the hardware doesn't completely turn the backlight off. ok marco@, pirofti@
-rw-r--r--sys/dev/acpi/acpivout.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/sys/dev/acpi/acpivout.c b/sys/dev/acpi/acpivout.c
index 9804c79bd04..e62f9cda79e 100644
--- a/sys/dev/acpi/acpivout.c
+++ b/sys/dev/acpi/acpivout.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: acpivout.c,v 1.4 2009/06/04 17:25:51 pirofti Exp $ */
+/* $OpenBSD: acpivout.c,v 1.5 2009/06/19 06:23:03 kettenis Exp $ */
/*
* Copyright (c) 2009 Paul Irofti <pirofti@openbsd.org>
*
@@ -250,7 +250,10 @@ acpivout_find_brightness(struct acpivout_softc *sc, int level)
if (mid < level && level <= sc->sc_bcl[i + 1])
return sc->sc_bcl[i + 1];
}
- return sc->sc_bcl[i];
+ if (level < sc->sc_bcl[0])
+ return sc->sc_bcl[0];
+ else
+ return sc->sc_bcl[i];
}
void
@@ -331,7 +334,7 @@ acpivout_get_param(struct wsdisplay_param *dp)
break;
}
if (sc != NULL && sc->sc_bcl_len != 0) {
- dp->min = sc->sc_bcl[0];
+ dp->min = 0;
dp->max = sc->sc_bcl[sc->sc_bcl_len - 1];
dp->curval = acpivout_get_brightness(sc);
if (dp->curval != -1)