Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 28 Jan 1998 08:50:32 -0600 (CST)
From:      Joel Ray Holveck <joelh@gnu.org>
To:        sos@FreeBSD.ORG
Cc:        yokota@zodiac.mech.utsunomiya-u.ac.jp, dag-erli@ifi.uio.no, hackers@FreeBSD.ORG, msmith@FreeBSD.ORG, yokota@zodiac.mech.utsunomiya-u.ac.jp
Subject:   Re: Graphical screen saver
Message-ID:  <199801281450.IAA02582@detlev.UUCP>
In-Reply-To: <199801280939.KAA08173@sos.freebsd.dk> (message from Søren Schmidt on Wed, 28 Jan 1998 10:38:29 %2B0100 (MET))
References:   <199801280939.KAA08173@sos.freebsd.dk>

next in thread | previous in thread | raw e-mail | index | archive | help

>>> 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.

Most of the mouse code, and several other routines as well, wouldn't
seem to work properly if set to graphics mode without UNKNOWN_MODE.  I
don't see any real reason to add the new tests, given that a suitable
alternative exists (below).

> 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 personally think that the best thing for the time being is to not
activate the screen saver when a graphical app is active.

>> (Yet another timeout routine closely tied to syscons will add much
>> complication...)

Why is that?

Personally, I think that using the current screen saver timeout
routine is perfectly adequate.

>> 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 ....

My suggestion is to use a semaphore to let syscons know if the current
mode was screensaver-induced.  (Patch follows.)  This is the technique
I used for my screensaver.  The tty and mode switching code is easily
handled (by deactivating the screen saver before switching.)  The
screen saver won't be activated if a graphical app has the console, so
direct video memory reads and writes are fine.

What this does is to add a variable, scrn_saver_mode.  The screensaver
sets it to the mode it set up if necessary.  This way, syscons can
tell if the current mode is unknown to the screensaver or not.  (The
screensaver is presently responsible for resetting the variable on
termination.)  You could just as well have a simple semaphore
scrn_saver_uses_an_unknown_mode_so_keep_calling_it (or a mnemonic
abbreviation thereof :-), but for some reason I have something in the
back of my head saying this is safer.

Any thoughts?

--- /usr/src/sys/i386/isa/syscons.c.ctm	Tue Jan 20 00:09:06 1998
+++ /usr/src/sys/i386/isa/syscons.c	Tue Jan 27 20:33:34 1998
@@ -135,6 +135,7 @@
 static  int     	delayed_next_scr = FALSE;
 static  long        	scrn_blank_time = 0;    /* screen saver timeout value */
 	int     	scrn_blanked = 0;       /* screen saver active flag */
+        int             scrn_saver_mode = 0;
 static  long       	scrn_time_stamp;
 	u_char      	scr_map[256];
 	u_char      	scr_rmap[256];
@@ -2163,7 +2164,8 @@
     }
 
     /* should we just return ? */
-    if ((scp->status&UNKNOWN_MODE) || blink_in_progress || switch_in_progress) {
+    if (((scp->status&UNKNOWN_MODE)&&(scp->mode!=scrn_saver_mode))
+	|| blink_in_progress || switch_in_progress) {
 	timeout(scrn_timer, NULL, hz / 10);
 	splx(s);
 	return;


-- 
Joel Ray Holveck - joelh@gnu.org - http://www.wp.com/piquan
   Fourth law of programming:
   Anything that can go wrong wi
sendmail: segmentation violation - core dumped



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