diff options
author | Roland Mainz <roland.mainz@nrubsig.org> | 2004-12-15 05:01:25 +0000 |
---|---|---|
committer | Roland Mainz <roland.mainz@nrubsig.org> | 2004-12-15 05:01:25 +0000 |
commit | d8d0729c2fe26c44c7889c7b76e088341df934e0 (patch) | |
tree | 98926f21e2e1ee628322e001f55b2a3ab65a8788 | |
parent | 6ecdc6526994aeb8cb11d811f0f7b2e598055aa2 (diff) |
//bugs.freedesktop.org/show_bug.cgi?id=1552) attachment #1026
(https://bugs.freedesktop.org/attachment.cgi?id=1026):
Currently, when a screensaver kicks in, it calls xf86GetModeLine() which
causes the Vidmode extension to write out a debugging log message of
what the current modeline is. These messages are generally only useful
to an X11 developer who is debugging the extension itself, or to an
application developer who is developing an application which uses the
vidmode extension to get/set the video mode, however they're not very
useful for end users.
The current default Xvidmode verbosity causes the X server to write overly
detailed video modeline information to the X server log file whenever
any application uses the extension to get, set, or delete modelines.
This causes a problem for laptop users on battery power with their hard
disks set to power saving mode, because the hard disk will power down,
then later the screensaver kicks in, which calls xf86GetModeLine(),
which causes the log message to get written out, which causes the hard
disk to be powered back up.
Having these messages off by default solves this problem for laptop users,
and seems to make the most sense considering how useful they are in
general. By changing the default log level for these messages,
developers who need to see these for debugging purposes can increase
their X server verbosity level and still see them, so no functionality
is lost.
This patch lowers the default verbosity of the X server's Xvidmode
extension log file messages, in order to stop Xvidmode from writing out
non-critical log messages to the X server log whenever an application
uses this extension.
Patch by Mike A. Harris <mharris@redhat.com>
-rw-r--r-- | hw/xfree86/dixmods/extmod/xf86vmode.c | 34 |
1 files changed, 18 insertions, 16 deletions
diff --git a/hw/xfree86/dixmods/extmod/xf86vmode.c b/hw/xfree86/dixmods/extmod/xf86vmode.c index 737eb4b42..e85c5bd61 100644 --- a/hw/xfree86/dixmods/extmod/xf86vmode.c +++ b/hw/xfree86/dixmods/extmod/xf86vmode.c @@ -29,7 +29,7 @@ or other dealings in this Software without prior written authorization from Kaleb S. KEITHLEY */ -/* $XdotOrg: xf86vmode.c,v 1.3 2000/08/17 19:47:59 cpqbld Exp $ */ +/* $XdotOrg: xc/programs/Xserver/Xext/xf86vmode.c,v 1.2 2004/04/23 18:44:41 eich Exp $ */ /* $Xorg: xf86vmode.c,v 1.3 2000/08/17 19:47:59 cpqbld Exp $ */ /* THIS IS NOT AN X CONSORTIUM STANDARD OR AN X PROJECT TEAM SPECIFICATION */ @@ -52,6 +52,8 @@ from Kaleb S. KEITHLEY #include "xf86_ansic.h" #endif +#define DEFAULT_XF86VIDMODE_VERBOSITY 3 + static int VidModeErrorBase; static int VidModeGeneration = 0; static int VidModeClientPrivateIndex; @@ -468,7 +470,7 @@ ProcXF86VidModeGetModeLine(ClientPtr client) rep.vtotal = VidModeGetModeValue(mode, VIDMODE_V_TOTAL); rep.flags = VidModeGetModeValue(mode, VIDMODE_FLAGS); - if (xf86GetVerbosity() > 1) { + if (xf86GetVerbosity() > DEFAULT_XF86VIDMODE_VERBOSITY) { ErrorF("GetModeLine - scrn: %d clock: %ld\n", stuff->screen, (unsigned long)rep.dotclock); ErrorF("GetModeLine - hdsp: %d hbeg: %d hend: %d httl: %d\n", @@ -676,7 +678,7 @@ ProcXF86VidModeAddModeLine(ClientPtr client) stuff->after_vtotal = oldstuff->after_vtotal; stuff->after_flags = oldstuff->after_flags; } - if (xf86GetVerbosity() > 1) { + if (xf86GetVerbosity() > DEFAULT_XF86VIDMODE_VERBOSITY) { ErrorF("AddModeLine - scrn: %d clock: %ld\n", (int)stuff->screen, (unsigned long)stuff->dotclock); ErrorF("AddModeLine - hdsp: %d hbeg: %d hend: %d httl: %d\n", @@ -787,7 +789,7 @@ ProcXF86VidModeAddModeLine(ClientPtr client) VidModeAddModeline(stuff->screen, mode); - if (xf86GetVerbosity() > 1) + if (xf86GetVerbosity() > DEFAULT_XF86VIDMODE_VERBOSITY) ErrorF("AddModeLine - Succeeded\n"); return client->noClientException; } @@ -824,7 +826,7 @@ ProcXF86VidModeDeleteModeLine(ClientPtr client) stuff->flags = oldstuff->flags; stuff->privsize = oldstuff->privsize; } - if (xf86GetVerbosity() > 1) { + if (xf86GetVerbosity() > DEFAULT_XF86VIDMODE_VERBOSITY) { ErrorF("DeleteModeLine - scrn: %d clock: %ld\n", (int)stuff->screen, (unsigned long)stuff->dotclock); ErrorF(" hdsp: %d hbeg: %d hend: %d httl: %d\n", @@ -843,7 +845,7 @@ ProcXF86VidModeDeleteModeLine(ClientPtr client) len = client->req_len - (sizeof(xXF86VidModeDeleteModeLineReq) >> 2); } if (len != stuff->privsize) { - if (xf86GetVerbosity() > 1) { + if (xf86GetVerbosity() > DEFAULT_XF86VIDMODE_VERBOSITY) { ErrorF("req_len = %ld, sizeof(Req) = %d, privsize = %ld, " "len = %d, length = %d\n", (unsigned long)client->req_len, @@ -859,7 +861,7 @@ ProcXF86VidModeDeleteModeLine(ClientPtr client) if (!VidModeGetCurrentModeline(stuff->screen, &mode, &dotClock)) return BadValue; - if (xf86GetVerbosity() > 1) { + if (xf86GetVerbosity() > DEFAULT_XF86VIDMODE_VERBOSITY) { ErrorF("Checking against clock: %d (%d)\n", VidModeGetModeValue(mode, VIDMODE_CLOCK), dotClock); ErrorF(" hdsp: %d hbeg: %d hend: %d httl: %d\n", @@ -882,7 +884,7 @@ ProcXF86VidModeDeleteModeLine(ClientPtr client) return BadValue; do { - if (xf86GetVerbosity() > 1) { + if (xf86GetVerbosity() > DEFAULT_XF86VIDMODE_VERBOSITY) { ErrorF("Checking against clock: %d (%d)\n", VidModeGetModeValue(mode, VIDMODE_CLOCK), dotClock); ErrorF(" hdsp: %d hbeg: %d hend: %d httl: %d\n", @@ -900,7 +902,7 @@ ProcXF86VidModeDeleteModeLine(ClientPtr client) if ((VidModeGetDotClock(stuff->screen, stuff->dotclock) == dotClock) && MODEMATCH(mode, stuff)) { VidModeDeleteModeline(stuff->screen, mode); - if (xf86GetVerbosity()) + if (xf86GetVerbosity() > DEFAULT_XF86VIDMODE_VERBOSITY) ErrorF("DeleteModeLine - Succeeded\n"); return(client->noClientException); } @@ -940,7 +942,7 @@ ProcXF86VidModeModModeLine(ClientPtr client) stuff->flags = oldstuff->flags; stuff->privsize = oldstuff->privsize; } - if (xf86GetVerbosity() > 1) { + if (xf86GetVerbosity() > DEFAULT_XF86VIDMODE_VERBOSITY) { ErrorF("ModModeLine - scrn: %d hdsp: %d hbeg: %d hend: %d httl: %d\n", (int)stuff->screen, stuff->hdisplay, stuff->hsyncstart, stuff->hsyncend, stuff->htotal); @@ -1028,7 +1030,7 @@ ProcXF86VidModeModModeLine(ClientPtr client) VidModeSetCrtcForMode(stuff->screen, mode); VidModeSwitchMode(stuff->screen, mode); - if (xf86GetVerbosity() > 1) + if (xf86GetVerbosity() > DEFAULT_XF86VIDMODE_VERBOSITY) ErrorF("ModModeLine - Succeeded\n"); return(client->noClientException); } @@ -1066,7 +1068,7 @@ ProcXF86VidModeValidateModeLine(ClientPtr client) stuff->flags = oldstuff->flags; stuff->privsize = oldstuff->privsize; } - if (xf86GetVerbosity() > 1) { + if (xf86GetVerbosity() > DEFAULT_XF86VIDMODE_VERBOSITY) { ErrorF("ValidateModeLine - scrn: %d clock: %ld\n", (int)stuff->screen, (unsigned long)stuff->dotclock); ErrorF(" hdsp: %d hbeg: %d hend: %d httl: %d\n", @@ -1146,7 +1148,7 @@ status_reply: swapl(&rep.status, n); } WriteToClient(client, sizeof(xXF86VidModeValidateModeLineReply), (char *)&rep); - if (xf86GetVerbosity() > 1) + if (xf86GetVerbosity() > DEFAULT_XF86VIDMODE_VERBOSITY) ErrorF("ValidateModeLine - Succeeded (status = %d)\n", status); return(client->noClientException); } @@ -1200,7 +1202,7 @@ ProcXF86VidModeSwitchToMode(ClientPtr client) stuff->flags = oldstuff->flags; stuff->privsize = oldstuff->privsize; } - if (xf86GetVerbosity() > 1) { + if (xf86GetVerbosity() > DEFAULT_XF86VIDMODE_VERBOSITY) { ErrorF("SwitchToMode - scrn: %d clock: %ld\n", (int)stuff->screen, (unsigned long)stuff->dotclock); ErrorF(" hdsp: %d hbeg: %d hend: %d httl: %d\n", @@ -1235,7 +1237,7 @@ ProcXF86VidModeSwitchToMode(ClientPtr client) return BadValue; do { - if (xf86GetVerbosity() > 1) { + if (xf86GetVerbosity() > DEFAULT_XF86VIDMODE_VERBOSITY) { ErrorF("Checking against clock: %d (%d)\n", VidModeGetModeValue(mode, VIDMODE_CLOCK), dotClock); ErrorF(" hdsp: %d hbeg: %d hend: %d httl: %d\n", @@ -1256,7 +1258,7 @@ ProcXF86VidModeSwitchToMode(ClientPtr client) if (!VidModeSwitchMode(stuff->screen, mode)) return BadValue; - if (xf86GetVerbosity() > 1) + if (xf86GetVerbosity() > DEFAULT_XF86VIDMODE_VERBOSITY) ErrorF("SwitchToMode - Succeeded\n"); return(client->noClientException); } |