[comp.windows.x] Server screen blanking for dumb displays

jmsellens@watdragon.waterloo.edu (John M. Sellens) (04/08/88)

Some displays, for example the DEC qvss, can't turn off the video in
hardware.  So, contrary to the Xqvss man page insisting that it
supports all the standard server features, no matter how you set
the "v" flag to Xqvss, your screen won't blank.  The situation was
the same in X10, and I fixed it there, so I thought that I would
offer my fix for X11 R2.

In the screen saver routine in server/dix/window.c, it first tries to
hardware screen save, by calling the device dependent routine.  If that
doesn't work, it tiles your screen, with changing colours if you have
a colour screen, or with a grey pattern if you don't.  This change
causes it to tile your screen all black if you prefer blanking.
So the effect is the same, it's just not as efficient.

As the comment says, I'm not sure about the purity of this little
code addition, but it seems to work.  I'd be glad to receive a
blessed version of the patch.

John Sellens
U of Waterloo
jmsellens@dragon.waterloo.edu

context diff of X11 R2 server/dix/window.c (pretty simple, eh?):

*** window.c.orig	Thu Apr  7 23:04:22 1988
--- window.c	Thu Apr  7 21:38:32 1988
***************
*** 2859,2864 ****
--- 2859,2874 ----
  		}
                  else
                      attributes[0] = None;
+ 
+ 		if (ScreenSaverBlanking != DontPreferBlanking) {
+ 		    /* device dependent blanking failed, but we prefer
+ 		       to save by blanking the screen, so blank the screen
+ 		       by painting it black.  I'm not sure if this is
+ 		       actually the correct way to do it, but it seems
+ 		       to work. - John Sellens - jmsellens@math.waterloo.edu */
+ 		    attributes[0] = screenInfo.screen[i].blackPixel;
+ 		    mask = CWBackPixel;
+ 		}
  
                  pWin = savedScreenInfo[i].pWindow = 
      			/* We SHOULD check for an error value here XXX */

RWS@ZERMATT.LCS.MIT.EDU (Robert Scheifler) (04/09/88)

    Date: 8 Apr 88 03:12:31 GMT
    From: mnetor!utzoo!utgpu!water!watmath!watdragon!jmsellens@uunet.uu.net  (John M. Sellens)

	       So, contrary to the Xqvss man page insisting that it
    supports all the standard server features, no matter how you set
    the "v" flag to Xqvss, your screen won't blank.

Xqvss does support all the standard server features; blanking support
is not required by the protocol.

    This change
    causes it to tile your screen all black if you prefer blanking.
    So the effect is the same, it's just not as efficient.

Your code isn't using black, it's using BlackPixel.  There's absolutely
no guarantee that BlackPixel is black.  There isn't even a guarantee
that a pixel exists corresponding to real black in the default colormap.

guido@cwi.nl (Guido van Rossum) (04/11/88)

The Xqvss server doesn't blank, but if you look carefully it alternates
the background pattern (at least if it's the default pattern) so that
each pixel gets a duty cycle of 50%.  I don't know if this is sufficient
to save your screen, though.  To see it happen, try 'xset s 10 5'.
(BTW, this causes a load of 50% on my VaxStation2000, just the server
repainting the entire screen and drawing the X logo every 5 seconds!
In general the server is unacceptably slow.  Anyone care to improve it a
bit?
--
Guido van Rossum, Centre for Mathematics and Computer Science (CWI), Amsterdam
guido@cwi.nl or mcvax!guido or (from ARPAnet) guido%cwi.nl@uunet.uu.net

greg@muddy.CS.UNLV.EDU (Greg Wohletz) (04/12/88)

> Some displays, for example the DEC qvss, can't turn off the video in
> hardware. 

under ultrix 2.0 the ioctl QIOVIDEOOFF turns the video off,so if the 
server doesn't do this, it's not because it's unable to.

						--Greg
						greg@jimi.cs.unlv.edu