Opened 14 years ago

Closed 14 years ago

#982 closed patch (fixed)

DPMS for X11 is inefficient

Reported by: kcodyjr@… Owned by: skamithi
Priority: minor Milestone: 0.20
Component: mythtv Version: head
Severity: medium Keywords:
Cc: Ticket locked: no

Description (last modified by danielk)

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.

Attachments (5)

myth-dpms-fixes.patch (5.9 KB) - added by kcodyjr@… 14 years ago.
myth-dpms-fixes.2.patch (5.9 KB) - added by kcodyjr@… 14 years ago.
Fixed typo.
myth-no-hot-wakeup.patch (1.8 KB) - added by kcodyjr@… 14 years ago.
Allow any keypress to safely wake up (blocks command)
myth-dpms-fixes.3.patch (6.7 KB) - added by kcodyjr@… 14 years ago.
Incorporating #991 and removes DPMSCapable test.
dpms_update.diff (7.6 KB) - added by skamithi 14 years ago.
patch against latest rev

Download all attachments as: .zip

Change History (8)

Changed 14 years ago by kcodyjr@…

Attachment: myth-dpms-fixes.patch added

Changed 14 years ago by kcodyjr@…

Attachment: myth-dpms-fixes.2.patch added

Fixed typo.

Changed 14 years ago by kcodyjr@…

Attachment: myth-no-hot-wakeup.patch added

Allow any keypress to safely wake up (blocks command)

Changed 14 years ago by kcodyjr@…

Attachment: myth-dpms-fixes.3.patch added

Incorporating #991 and removes DPMSCapable test.

comment:1 Changed 14 years ago by danielk

Description: modified (diff)
Milestone: 0.20
Type: defectpatch
Version: head

comment:2 Changed 14 years ago by skamithi

Owner: changed from Isaac Richards to skamithi

Changed 14 years ago by skamithi

Attachment: dpms_update.diff added

patch against latest rev

comment:3 Changed 14 years ago by skamithi

Resolution: fixed
Status: newclosed

(In [10090]) Closes #982. DPMS code cleanup. patch from kcodyjr at verizon dot net.

Note: See TracTickets for help on using tickets.