Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 5 Apr 2002 14:18:50 -0800
From:      Jonathan Mini <mini@haikugeek.com>
To:        Olivier Houchard <doginou@cognet.ci0.org>
Cc:        freebsd-hackers@FreeBSD.ORG
Subject:   Re: syscons screensaver
Message-ID:  <20020405141850.B238@stylus.haikugeek.com>
In-Reply-To: <20020405203651.GA788@ci0.org>; from doginou@cognet.ci0.org on Fri, Apr 05, 2002 at 10:36:51PM %2B0200
References:  <20020405203651.GA788@ci0.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Nice. Perhaps it might be better to make an ioctl/sysctl that took a list
of the types of activity to wake on (e.g. tty output, kernel print, writes
to dev console, mouse movement, and keypress).

Olivier Houchard [doginou@cognet.ci0.org] wrote :

> Hi,
>   Here is a small patch to re-add the hw.syscons.saver.timeout using SYSCTL_PROC as suggested by jhb.
>   It adds a CONS_SAVER_KBD_ONLY ioctl too that does the same that the hw.syscons.saver.keybonly.

> --- /sys/dev/syscons/syscons.c	Fri Apr  5 20:17:49 2002
> +++ /root/syscons.c	Fri Apr  5 22:18:59 2002
> @@ -240,6 +240,30 @@
>  }
>  
>  /* probe video adapters, return TRUE if found */ 
> +static int 
> +sysctl_saver_timeout(SYSCTL_HANDLER_ARGS)
> +{
> +    long saver_timeout = scrn_blank_time;
> +    int error;
> +    int s;
> +    
> +    if (!(error = sysctl_handle_long(oidp, &saver_timeout, 
> +	sizeof(saver_timeout), req))) {
> +	if (saver_timeout < 0 || saver_timeout > MAX_BLANKTIME)
> +		error = EINVAL;
> +	else {
> +	    s = spltty();
> +	    scrn_blank_time = saver_timeout;
> +            run_scrn_saver = (scrn_blank_time != 0);
> +    	    splx(s);
> +	}
> +    }
> +    return error;
> +}
> +
> +SYSCTL_PROC(_hw_syscons_saver, OID_AUTO, timeout, CTLTYPE_LONG | CTLFLAG_RW,
> +	0, sizeof(long), sysctl_saver_timeout, "L", "screen saver time");
> +
>  static int
>  scvidprobe(int unit, int flags, int cons)
>  {
> @@ -701,6 +725,9 @@
>  	splx(s);
>  	return 0;
>  
> +    case CONS_SAVER_KBD_ONLY:
> +	sc_saver_keyb_only = *(int *)data;
> +	return (0);
>      case CONS_CURSORTYPE:   	/* set cursor type (obsolete) */
>  	s = spltty();
>  	*(int *)data &= CONS_CURSOR_ATTRS;

> --- /sys/sys/consio.h	Sun Mar 17 00:31:14 2002
> +++ /root/consio.h	Fri Apr  5 22:19:46 2002
> @@ -286,6 +286,7 @@
>  
>  #define CONS_GETTERM	_IOWR('c', 112, term_info_t)
>  #define CONS_SETTERM	_IOW('c', 113, term_info_t)
> +#define CONS_SAVER_KBD_ONLY	_IOW('c', 114, int)		
>  
>  #ifdef PC98
>  #define ADJUST_CLOCK	_IO('t',100)		/* for 98note resume */


-- 
Jonathan Mini
mini@haikugeek.com

<baka^ni> desolation... despair... plastic forks...


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020405141850.B238>