Date: Fri, 5 Apr 2002 22:36:51 +0200 From: Olivier Houchard <doginou@cognet.ci0.org> To: freebsd-hackers@freebsd.org Subject: syscons screensaver Message-ID: <20020405203651.GA788@ci0.org>
next in thread | raw e-mail | index | archive | help
--OgqxwSJOaUobr8KG Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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. --OgqxwSJOaUobr8KG Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="syscons.c.diff" --- /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; --OgqxwSJOaUobr8KG Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="consio.h.diff" --- /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 */ --OgqxwSJOaUobr8KG-- 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?20020405203651.GA788>