Hi,

playing around with the display brightness i found that the
initial state seems to be broken.
We initiate the value at MAX_BRIGHTNESS while in reality it is much
lower than that after boot.
Increasing the brightness won't work after
booting because wscons thinks we are at 100%, while decreasing the
brightness in wsconsctl actually makes the display brighter...

The diff below fixes the problem by setting a sane default during
initialization.

ok?

Index: ofw_machdep.c
===================================================================
RCS file: /cvs/src/sys/arch/macppc/macppc/ofw_machdep.c,v
retrieving revision 1.61
diff -u -p -r1.61 ofw_machdep.c
--- ofw_machdep.c       27 Oct 2020 19:40:08 -0000      1.61
+++ ofw_machdep.c       28 Oct 2020 20:01:39 -0000
@@ -476,8 +476,8 @@ of_display_console(void)
 
        if (OF_getnodebyname(0, "backlight") != 0) {
                cons_backlight_available = 1;
-               cons_brightness = MAX_BRIGHTNESS;
                cons_backlight = WSDISPLAYIO_VIDEO_ON;
+               of_setbrightness(DEFAULT_BRIGHTNESS);
        
                /* wsconsctl hooks */
                ws_get_param = ofw_get_param;

Reply via email to