From owner-freebsd-hackers Fri Apr 5 19: 9:35 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from 12-234-96-171.client.attbi.com (12-234-96-171.client.attbi.com [12.234.96.171]) by hub.freebsd.org (Postfix) with ESMTP id 8AD4037B400 for ; Fri, 5 Apr 2002 19:09:31 -0800 (PST) Received: by 12-234-96-171.client.attbi.com (Postfix, from userid 1000) id 2F261971; Fri, 5 Apr 2002 14:18:50 -0800 (PST) Date: Fri, 5 Apr 2002 14:18:50 -0800 From: Jonathan Mini To: Olivier Houchard Cc: freebsd-hackers@FreeBSD.ORG Subject: Re: syscons screensaver Message-ID: <20020405141850.B238@stylus.haikugeek.com> Mail-Followup-To: Olivier Houchard , freebsd-hackers@FreeBSD.ORG References: <20020405203651.GA788@ci0.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <20020405203651.GA788@ci0.org>; from doginou@cognet.ci0.org on Fri, Apr 05, 2002 at 10:36:51PM +0200 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG 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 desolation... despair... plastic forks... To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message