summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordavid@fries.net <david@fries.net>2009-09-15 22:32:45 -0500
committerJulien Cristau <jcristau@debian.org>2010-05-11 15:19:48 +0200
commit47233238a659318cae6b7d0f71ee44b689e249c3 (patch)
treec885080ce25a982b696ce66ce657d5570fb6e948
parentdff79298ae04cec6233cd043cbf3aeda6db67d42 (diff)
SISVGABlankScreen: only update the hardware if we're changing the state
The command `xset s reset` will reset the X server screensaver to reset the timer for the screensaver and dpms. If the display is already on, it should do nothing as far as the hardware goes. In the SISVGABlankScreen routine it requires as reset to update the register, but that will disrupt the VGA signal and cause the monitor to resync leaving the screen blank for a couple seconds. I have a program that wants to keep the screensaver from coming on, but allow normal operation when it isn't running. Debian bug#546838 <http://bugs.debian.org/546838> Signed-off-by: Julien Cristau <jcristau@debian.org>
-rw-r--r--src/sis_vga.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/sis_vga.c b/src/sis_vga.c
index b4cd69d..3f6219b 100644
--- a/src/sis_vga.c
+++ b/src/sis_vga.c
@@ -1922,11 +1922,17 @@ static void
SISVGABlankScreen(ScrnInfoPtr pScrn, Bool on)
{
SISPtr pSiS = SISPTR(pScrn);
- UChar tmp;
+ UChar tmp, orig;
inSISIDXREG(SISSR, 0x01, tmp);
+ orig = tmp;
if(on) tmp &= ~0x20;
else tmp |= 0x20;
+ /* Only update the hardware if the state changes because the reset will
+ * disrupt the output requiring the screen to resync.
+ */
+ if(orig == tmp)
+ return;
SiS_SeqReset(pSiS, TRUE);
outSISIDXREG(SISSR, 0x01, tmp);
SiS_SeqReset(pSiS, FALSE);