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 [[EMAIL PROTECTED]] 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
[EMAIL PROTECTED]

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


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message

Reply via email to