[mythtv-commits] Ticket #982: DPMS for X11 is inefficient

MythTV mythtv at cvs.mythtv.org
Wed Jan 18 17:03:51 UTC 2006


#982: DPMS for X11 is inefficient
---------------------------------+------------------------------------------
 Reporter:  kcodyjr at verizon.net  |        Owner:  ijr 
     Type:  patch                |       Status:  new 
 Priority:  minor                |    Milestone:  0.20
Component:  mythtv               |      Version:  head
 Severity:  medium               |   Resolution:      
---------------------------------+------------------------------------------
Changes (by danielk):

  * milestone:  => 0.20
  * version:  => head
  * type:  defect => patch

Old description:

> I'm seeing the same snippet of code in several places that detects the
> existence of DPMS extensions, and decides either whether to issue a
> powerup signal, or whether to dis/enable automatic powerdown.
>
> 1) It never checks to see if the hardware is actually DPMS capable,
> 2) It never checks to see if the user actually wants DPMS at all,
> 3) The code repetition is horrible, especially calls to the DPMS API.
>
> The patch I'm about to upload does the following:
>
> 1) Finds out separately if DPMS is supported, available, and enabled,
> 2) Issues informative VERBOSE messages about the DPMS startup state,
> 3) Implements a proper state machine to minimize conditional tests,
> 4) Adds bool Asleep() to ScreenSaverControl to export state checking.
>
> The copious qt_xdisplay() calls were left alone based on the assumption
> that something just -MIGHT- change displays, like from :0 to :0.1, etc.
> It is, however, reasonable to assume that
> DPMS preferences will not change during the life of the program.
>
> Although nothing wants to know about the monitor DPMS state right now,
> something easily might, for example an option to block the keypress that
> wakes up the monitor.

New description:

 I'm seeing the same snippet of code in several places that detects the
 existence of DPMS extensions, and decides either whether to issue a
 powerup signal, or whether to dis/enable automatic powerdown.

 1) It never checks to see if the hardware is actually DPMS capable,
 2) It never checks to see if the user actually wants DPMS at all,
 3) The code repetition is horrible, especially calls to the DPMS API.

 The patch I'm about to upload does the following:

 1) Finds out separately if DPMS is supported, available, and enabled,
 2) Issues informative VERBOSE messages about the DPMS startup state,
 3) Implements a proper state machine to minimize conditional tests,
 4) Adds bool Asleep() to ScreenSaverControl to export state checking.

 The copious qt_xdisplay() calls were left alone based on the assumption
 that something just -MIGHT- change displays, like from :0 to :0.1, etc. It
 is, however, reasonable to assume that
 DPMS preferences will not change during the life of the program.

 Although nothing wants to know about the monitor DPMS state right now,
 something easily might, for example an option to block the keypress that
 wakes up the monitor.

-- 
Ticket URL: <http://svn.mythtv.org/trac/ticket/982>
MythTV <http://www.mythtv.org/>
MythTV


More information about the mythtv-commits mailing list