Re: Fixing screen savers

2010-11-01 Thread Adam Jackson
On Thu, 2010-10-28 at 08:51 -0700, Keith Packard wrote:
 On Thu, 28 Oct 2010 09:03:00 -0400, Adam Jackson a...@nwnk.net wrote:
 
  This sounds like it's ignoring per-output DPMS.
 
 We don't have per-output DPMS in RandR yet.

Well, we sure should.

  I kind of want to drop the DPMS extension entirely if we can.  It's
  really quite awful to implement since it's per-display state not
  per-screen.  I'm not sure how much existing code relies on it though.
 
 I'd be up for that. Not having it at all would simplify the code
 tremendously. My main concern is whether the ability to control all
 three DPMS intervals is required by any standard or legislation. What I
 don't want to see is some additional external configuration for DPMS
 intervals.

EnergyStar only specifies that the product must be shipped with the
display set to enter sleep mode within 15 minutes.  It makes no mention
of finer granularity for displays.  Later VESA specs even deprecate the
four levels entirely, the DPM spec supersedes the DPMS spec and folds
the Standby and Suspend states into the Off state (like most drivers do
anyway).

I think the core protocol saver mechanism is entirely sufficient to
cover the DPM on/off semantics.

- ajax

___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel


Re: Fixing screen savers

2010-11-01 Thread Keith Packard
On Mon, 01 Nov 2010 16:01:02 -0400, Adam Jackson a...@nwnk.net wrote:

 Well, we sure should.

uh, patches welcome? would also like to see a 'DPMS everyone mode' so
you don't have to walk the list.

 I think the core protocol saver mechanism is entirely sufficient to
 cover the DPM on/off semantics.

Let's do it then. With the RandR change above, that gives us a reliable
way to fade the monitor out and the DPMS off.

-- 
keith.pack...@intel.com


pgp0hGYTFrc9F.pgp
Description: PGP signature
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Re: Fixing screen savers

2010-10-28 Thread Adam Jackson
On Mon, 2010-10-25 at 12:02 -0700, Keith Packard wrote:

 However, looking at the code, I think there's a simpler mechanism already
 available to us:
 
  * Register a screen saver window with XScreenSaverSetAttributes. This
ensures that automatic screen saving will not turn off the screen.
I can't figure out how this window could be useful to us as it gets
automatically destroyed when the screen is unsaved, and so cannot
be used for a transition or lock screen dialog.
 
  * Monitor screen saver timeouts using the existing XScreenSaver events.
 
  * Disable the DPMS extension by setting the DPMS timeouts to all zeros.
The DPMS code doesn't respect the X screen saver extension's external
screen saver mode. (note A*)
 
  * Control DPMS on the monitors by using DPMSForceLevel. This will
generate another screen saver event, but that will have the 'force'
value set to TRUE.

This sounds like it's ignoring per-output DPMS.

I kind of want to drop the DPMS extension entirely if we can.  It's
really quite awful to implement since it's per-display state not
per-screen.  I'm not sure how much existing code relies on it though.

- ajax


signature.asc
Description: This is a digitally signed message part
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Re: Fixing screen savers

2010-10-28 Thread Keith Packard
On Thu, 28 Oct 2010 09:03:00 -0400, Adam Jackson a...@nwnk.net wrote:

 This sounds like it's ignoring per-output DPMS.

We don't have per-output DPMS in RandR yet.

 I kind of want to drop the DPMS extension entirely if we can.  It's
 really quite awful to implement since it's per-display state not
 per-screen.  I'm not sure how much existing code relies on it though.

I'd be up for that. Not having it at all would simplify the code
tremendously. My main concern is whether the ability to control all
three DPMS intervals is required by any standard or legislation. What I
don't want to see is some additional external configuration for DPMS
intervals.

-- 
keith.pack...@intel.com


pgpoDmV4Wk39s.pgp
Description: PGP signature
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Fixing screen savers

2010-10-25 Thread Keith Packard

We've had a long sequence of brief conversations within the X.org
developer community about how screen saving should work in X, but it
doesn't appear that they've ever been converted to email form. Let me
try to reconstruct the discussion here and see if we can't finish this
work up.

Here's my understanding of the requirements:

With no external screen saver program running:

 1) Use DPMS to turn off monitors when the built-in idle time
has been exceeded. 

 2) Allow applications to disable the automatic screen saver using
the XScreenSaverSuspend call

When an external screen saver is running:

 1) The server should never touch the hardware automatically.

 2) The XScreenSaverSuspend call must continue to work so that
other applications can disable monitor off while playing movies
or whatever.

 3) There must be a mechanism to control the DPMS state of all monitors
connected to the machine. Independently would be ideal.

 4) If the screen saver crashes, the server should get itself back
to the state that it would have been in had the screen saver
never been started.

 5) The screen saver application timeouts should be controllable by the
core screen saver and XDPMS timeouts.

Right now, many screen savers are using the Sync IDLETIME counter which
serves to let them tell when the server has not received input for some
time. This does not, however, report when the screen saver has been
disabled or track the current core screen saver and XDPMS timeouts.

The last proposed solution we came up with was to have all of the
state tracked entirely within the screen saver app:

 * Have XScreenSaverSuspend calls generate events with the current
   suspend count.

 * (unknown) track the core screen saver and DPMS timeouts

 * Call XScreenSaverSuspend to disable the automatic screen saver
   inside the X server. Note that this will bump the current
   suspend count by one.
 
 * Use the IDLETIME counter to detect when the screen saver should
   be activated.

 * Add a 'set DPMS' call to the RandR extension to control the DPMS
   state of the monitors.

However, looking at the code, I think there's a simpler mechanism already
available to us:

 * Register a screen saver window with XScreenSaverSetAttributes. This
   ensures that automatic screen saving will not turn off the screen.
   I can't figure out how this window could be useful to us as it gets
   automatically destroyed when the screen is unsaved, and so cannot
   be used for a transition or lock screen dialog.

 * Monitor screen saver timeouts using the existing XScreenSaver events.

 * Disable the DPMS extension by setting the DPMS timeouts to all zeros.
   The DPMS code doesn't respect the X screen saver extension's external
   screen saver mode. (note A*)

 * Control DPMS on the monitors by using DPMSForceLevel. This will
   generate another screen saver event, but that will have the 'force'
   value set to TRUE.

When the user generates input, the DPMS mode will get set back to On and
the screen saver will get a XScreenSaver event, along with having the
screen saver window get unmapped. It can then provide a transition back
to normal operation or an unlock screen dialog.

A* The one thing this fails at is when the screen saver crashes, the DPMS
   timeouts will remain at 0.

I see a couple of useful cleanups:

 1) Don't require the creation of the external screen saver window. It
isn't useful anyways. We would need a separate mechanism to register
an external screen saver application, but a simple boolean is all
that is required for that.

 2) Provide a way, similar to XScreenSaverSuspend, to disable automatic
DPMS transitions without also disabling automatic screen saver
timeouts. This would fix note A*. I'd do this in the DPMS extension.

 3) Unify the DPMS and core screen saver timers (would require 2):

* Eliminate the core timers inside the server
* XGetScreenSaver would return the Standby time for
  'timeout' and the difference between Off and Standby for
  'interval'
* XSetScreenSaver would set the Standby time to 'timeout',
  the Suspend time to 'timeout' + 'interval'/2 and the
  Off time to 'timeout' + 'interval'.

-- 
keith.pack...@intel.com


pgpCvWozpxxhY.pgp
Description: PGP signature
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel