[iPAQ] Screenblanking...

From: Nils Faerber <nils.a.t.kernelconcepts.de>
Date: Fri Sep 29 2000 - 14:44:09 EDT

Hi all!
Just fiddled with 0.16 and noticed the follwing:
- The X11 screensaver does not work properly (sorry ;) If I select a timeout
and have the backlight on then after expiration just the backlight is turned
off. If I select a timeout and do a "activate" aftrewards, first the backlight
is turned off and after the timeout the display is switched off completely
(which is what I expect from the screensaver in any situation). Is this
intended?
- On the other hand I just tried to write a program that switches off the
screen completely by commandline. I wrote the following:

#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <sys/ioctl.h>
#include <linux/fb.h>

/* VESA Blanking Levels */
#define VESA_NO_BLANKING 0
#define VESA_VSYNC_SUSPEND 1
#define VESA_HSYNC_SUSPEND 2
#define VESA_POWERDOWN 3

int main(int argc, char **argv)
{
int fd;

        fd=open("/dev/fb0",O_RDWR);
        if (fd==-1) {
                fprintf(stderr,"Could not open fb0\n");
                exit(1);
        }
        if (argc<2 || argv[1][0]=='0') {
                if (ioctl(fd,FBIOBLANK,VESA_POWERDOWN)==-1) {
                        fprintf(stderr,"ioctl() failed\n");
                }
        } else if (argv[1][0]=='1') {
                if (ioctl(fd,FBIOBLANK,VESA_NO_BLANKING)==-1) {
                        fprintf(stderr,"ioctl() failed\n");
                }
        }
        close(fd);

return 0;
}

If called it really blanks the screen and switches everything off. If run with
"1" as argument it switches the console back on. Fine, it seems.
But if I switch off the screen this way the iPaq freezes completely after some
time, maybe the console blanker timeout, I don't know.
Is there a better way for doing this? Where is the fault in the above program?
I should add that I am not especially experienced with FB prgramming...
CU
  nils faerber

-- 
kernel concepts
Engel & Faerber GbR      Tel: +49-271-771091-12
Dreisbachstr. 24         Fax: +49-271-771091-19
D-57250 Netphen          D1 : +49-170-2729106
--
Received on Fri Sep 29 11:46:33 2000

This archive was generated by hypermail 2.1.8 : Tue May 04 2004 - 09:43:43 EDT