From owner-freebsd-hackers Wed Jan 28 01:29:09 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id BAA24880 for hackers-outgoing; Wed, 28 Jan 1998 01:29:09 -0800 (PST) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from sos.freebsd.dk (sos.freebsd.dk [195.8.129.33]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id BAA24794; Wed, 28 Jan 1998 01:28:57 -0800 (PST) (envelope-from sos@sos.freebsd.dk) Received: (from sos@localhost) by sos.freebsd.dk (8.8.8/8.8.8) id KAA08173; Wed, 28 Jan 1998 10:39:55 +0100 (MET) (envelope-from sos) Message-Id: <199801280939.KAA08173@sos.freebsd.dk> Subject: Re: Graphical screen saver In-Reply-To: <199801280640.PAA25860@zodiac.mech.utsunomiya-u.ac.jp> from Kazutaka YOKOTA at "Jan 28, 98 03:40:35 pm" To: yokota@zodiac.mech.utsunomiya-u.ac.jp (Kazutaka YOKOTA) Date: Wed, 28 Jan 1998 10:38:29 +0100 (MET) Cc: dag-erli@ifi.uio.no, hackers@FreeBSD.ORG, msmith@FreeBSD.ORG, yokota@zodiac.mech.utsunomiya-u.ac.jp From: Søren Schmidt Reply-to: sos@FreeBSD.ORG X-Mailer: ELM [version 2.4ME+ PL30 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk In reply to Kazutaka YOKOTA who wrote: > > >The source is in /pub/FreeBSD/incoming/logo_saver.tgz on wcarchive. > >You'll need to patch syscons.c to make it work; a unified diff and > >rudimentary installation instructions are included in the tarball. > > > >As always, I appreciate feedback of any kind... > > I had a quick look at your graphical screen saver code. (And I have > been following discussion between you and msmith :-) > > A couple of comments: > > The patch for syscons looks reasonable to me. (How do you think, > Soeren?) When I touched this part of syscons last time, I didn't > consider support for graphical savers (because at the time there was > none ;-< Seems OK to mee. Maybe I should just let UNKNOWN mode represent the "real" unknown modes ie when the X server changes the resolution on its own. syscons can deal with all the modes defined i console.h and do sesnible things there. It will swallow up to 256K of kernel memory pr saved image though. The only problem here is that the process doing mem refs to the screen memory will have to be noticed somehow, or it will sadly mess up the vga card & memory when off screen, hmmm we cauld make it sleep and wake it on reentry to that screen.... > > I wonder if it's a good idea to let the screen saver to reschedule > itself from inside the saver module. No! > With the above patch applied, > syscons will periodically call the saver module. That should be > sufficient for most purposes, I think. (Yet another timeout routine > closely tied to syscons will add much complication...) The following > fragment shows the flow I would suggest. > > logo_saver(int blank) > { > if (!blank) { > /* restore the video mode */ > ..... > } else { > if (scrn_blanked <= 0) { > scrn_blanked = 1; > /* switch video mode */ > ..... > logo_update(); > } else { > /* if we want to update the screen in every other > call, we can do the following */ > if (++scrn_blanked <= 2) > return; > scrn_blanked = 1; > /* update the logo */ > logo_update(); > } > } > } > > In your code, video mode switching is protected by a splhigh()/splx() > pair. I think splhigh() is overkill. We had better use spltty() > instead. yup. > We have to be careful about VT switching while the graphical saver > is active. I will check several things in syscons and contact you > later. (I suspect we need to patch syscons...) Well it should work, at least I have a graphics saver that used to work :). We might want to change the behavior of UNKNOW_MODE as noted above, but I'm sure it will break at least a few of the graph progs out there, but what the heck, if X still runs, and I make sure that libvga works, then .... -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- Søren Schmidt (sos@FreeBSD.org) FreeBSD Core Team Even more code to hack -- will it ever end ..