1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
|
From 75eecf28ae3709181a51571132b0accd9cae316e Mon Sep 17 00:00:00 2001
From: Chris Wilson <chris@chris-wilson.co.uk>
Date: Sun, 13 Mar 2016 13:54:01 +0000
Subject: Xext/vidmode: Reduce verbosity of GetModeLine debug messages
In commit f175cf45aebcdda53f3ae49c0eaf27da1f194e92
Author: Olivier Fourdan <ofourdan@redhat.com>
Date: Wed Feb 10 09:34:34 2016 +0100
vidmode: move to a separate library of its own
the verbosity of some old debug messages (which print the reply to every
GetModeLine client request and others) was increased leading to lots of
log spam. Downgrade the logging back to DebugF.
[ajax: Fix a typo so it compiles.]
Reviewed-by: Adam Jackson <ajax@redhat.com>
References: https://bugs.freedesktop.org/show_bug.cgi?id=94515
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Olivier Fourdan <ofourdan@redhat.com>
diff --git a/Xext/vidmode.c b/Xext/vidmode.c
index 7c838f4..0cbbdc3 100644
--- a/Xext/vidmode.c
+++ b/Xext/vidmode.c
@@ -69,7 +69,7 @@ typedef struct {
dixSetPrivate(&(c)->devPrivates, VidModeClientPrivateKey, p)
#ifdef DEBUG
-#define DEBUG_P(x) LogMessage(X_INFO, x"\n");
+#define DEBUG_P(x) DebugF(x"\n")
#else
#define DEBUG_P(x) /**/
#endif
@@ -267,13 +267,13 @@ ProcVidModeGetModeLine(ClientPtr client)
rep.vtotal = VidModeGetModeValue(mode, VIDMODE_V_TOTAL);
rep.flags = VidModeGetModeValue(mode, VIDMODE_FLAGS);
- LogMessage(X_INFO, "GetModeLine - scrn: %d clock: %ld\n",
- stuff->screen, (unsigned long) rep.dotclock);
- LogMessage(X_INFO, "GetModeLine - hdsp: %d hbeg: %d hend: %d httl: %d\n",
- rep.hdisplay, rep.hsyncstart, rep.hsyncend, rep.htotal);
- LogMessage(X_INFO, " vdsp: %d vbeg: %d vend: %d vttl: %d flags: %ld\n",
- rep.vdisplay, rep.vsyncstart, rep.vsyncend,
- rep.vtotal, (unsigned long) rep.flags);
+ DebugF("GetModeLine - scrn: %d clock: %ld\n",
+ stuff->screen, (unsigned long) rep.dotclock);
+ DebugF("GetModeLine - hdsp: %d hbeg: %d hend: %d httl: %d\n",
+ rep.hdisplay, rep.hsyncstart, rep.hsyncend, rep.htotal);
+ DebugF(" vdsp: %d vbeg: %d vend: %d vttl: %d flags: %ld\n",
+ rep.vdisplay, rep.vsyncstart, rep.vsyncend,
+ rep.vtotal, (unsigned long) rep.flags);
/*
* Older servers sometimes had server privates that the VidMode
@@ -483,23 +483,23 @@ ProcVidModeAddModeLine(ClientPtr client)
stuff->after_vtotal = oldstuff->after_vtotal;
stuff->after_flags = oldstuff->after_flags;
}
- LogMessage(X_INFO, "AddModeLine - scrn: %d clock: %ld\n",
- (int) stuff->screen, (unsigned long) stuff->dotclock);
- LogMessage(X_INFO, "AddModeLine - hdsp: %d hbeg: %d hend: %d httl: %d\n",
- stuff->hdisplay, stuff->hsyncstart,
- stuff->hsyncend, stuff->htotal);
- LogMessage(X_INFO, " vdsp: %d vbeg: %d vend: %d vttl: %d flags: %ld\n",
- stuff->vdisplay, stuff->vsyncstart, stuff->vsyncend,
- stuff->vtotal, (unsigned long) stuff->flags);
- LogMessage(X_INFO, " after - scrn: %d clock: %ld\n",
- (int) stuff->screen, (unsigned long) stuff->after_dotclock);
- LogMessage(X_INFO, " hdsp: %d hbeg: %d hend: %d httl: %d\n",
- stuff->after_hdisplay, stuff->after_hsyncstart,
- stuff->after_hsyncend, stuff->after_htotal);
- LogMessage(X_INFO, " vdsp: %d vbeg: %d vend: %d vttl: %d flags: %ld\n",
- stuff->after_vdisplay, stuff->after_vsyncstart,
- stuff->after_vsyncend, stuff->after_vtotal,
- (unsigned long) stuff->after_flags);
+ DebugF("AddModeLine - scrn: %d clock: %ld\n",
+ (int) stuff->screen, (unsigned long) stuff->dotclock);
+ DebugF("AddModeLine - hdsp: %d hbeg: %d hend: %d httl: %d\n",
+ stuff->hdisplay, stuff->hsyncstart,
+ stuff->hsyncend, stuff->htotal);
+ DebugF(" vdsp: %d vbeg: %d vend: %d vttl: %d flags: %ld\n",
+ stuff->vdisplay, stuff->vsyncstart, stuff->vsyncend,
+ stuff->vtotal, (unsigned long) stuff->flags);
+ DebugF(" after - scrn: %d clock: %ld\n",
+ (int) stuff->screen, (unsigned long) stuff->after_dotclock);
+ DebugF(" hdsp: %d hbeg: %d hend: %d httl: %d\n",
+ stuff->after_hdisplay, stuff->after_hsyncstart,
+ stuff->after_hsyncend, stuff->after_htotal);
+ DebugF(" vdsp: %d vbeg: %d vend: %d vttl: %d flags: %ld\n",
+ stuff->after_vdisplay, stuff->after_vsyncstart,
+ stuff->after_vsyncend, stuff->after_vtotal,
+ (unsigned long) stuff->after_flags);
if (ver < 2) {
REQUEST_AT_LEAST_SIZE(xXF86OldVidModeAddModeLineReq);
@@ -572,7 +572,7 @@ ProcVidModeAddModeLine(ClientPtr client)
VidModeSetModeValue(mode, VIDMODE_FLAGS, stuff->flags);
if (stuff->privsize)
- LogMessage(X_INFO, "AddModeLine - Privates in request have been ignored\n");
+ DebugF("AddModeLine - Privates in request have been ignored\n");
/* Check that the mode is consistent with the monitor specs */
switch (pVidMode->CheckModeForMonitor(pScreen, mode)) {
@@ -601,7 +601,7 @@ ProcVidModeAddModeLine(ClientPtr client)
pVidMode->AddModeline(pScreen, mode);
- LogMessage(X_INFO, "AddModeLine - Succeeded\n");
+ DebugF("AddModeLine - Succeeded\n");
return Success;
}
@@ -640,14 +640,14 @@ ProcVidModeDeleteModeLine(ClientPtr client)
stuff->flags = oldstuff->flags;
stuff->privsize = oldstuff->privsize;
}
- LogMessage(X_INFO, "DeleteModeLine - scrn: %d clock: %ld\n",
- (int) stuff->screen, (unsigned long) stuff->dotclock);
- LogMessage(X_INFO, " hdsp: %d hbeg: %d hend: %d httl: %d\n",
- stuff->hdisplay, stuff->hsyncstart,
- stuff->hsyncend, stuff->htotal);
- LogMessage(X_INFO, " vdsp: %d vbeg: %d vend: %d vttl: %d flags: %ld\n",
- stuff->vdisplay, stuff->vsyncstart, stuff->vsyncend, stuff->vtotal,
- (unsigned long) stuff->flags);
+ DebugF("DeleteModeLine - scrn: %d clock: %ld\n",
+ (int) stuff->screen, (unsigned long) stuff->dotclock);
+ DebugF(" hdsp: %d hbeg: %d hend: %d httl: %d\n",
+ stuff->hdisplay, stuff->hsyncstart,
+ stuff->hsyncend, stuff->htotal);
+ DebugF(" vdsp: %d vbeg: %d vend: %d vttl: %d flags: %ld\n",
+ stuff->vdisplay, stuff->vsyncstart, stuff->vsyncend, stuff->vtotal,
+ (unsigned long) stuff->flags);
if (ver < 2) {
REQUEST_AT_LEAST_SIZE(xXF86OldVidModeDeleteModeLineReq);
@@ -662,11 +662,11 @@ ProcVidModeDeleteModeLine(ClientPtr client)
bytes_to_int32(sizeof(xXF86VidModeDeleteModeLineReq));
}
if (len != stuff->privsize) {
- LogMessage(X_INFO, "req_len = %ld, sizeof(Req) = %d, privsize = %ld, "
- "len = %d, length = %d\n",
- (unsigned long) client->req_len,
- (int) sizeof(xXF86VidModeDeleteModeLineReq) >> 2,
- (unsigned long) stuff->privsize, len, stuff->length);
+ DebugF("req_len = %ld, sizeof(Req) = %d, privsize = %ld, "
+ "len = %d, length = %d\n",
+ (unsigned long) client->req_len,
+ (int) sizeof(xXF86VidModeDeleteModeLineReq) >> 2,
+ (unsigned long) stuff->privsize, len, stuff->length);
return BadLength;
}
@@ -681,46 +681,46 @@ ProcVidModeDeleteModeLine(ClientPtr client)
if (!pVidMode->GetCurrentModeline(pScreen, &mode, &dotClock))
return BadValue;
- LogMessage(X_INFO, "Checking against clock: %d (%d)\n",
+ DebugF("Checking against clock: %d (%d)\n",
+ VidModeGetModeValue(mode, VIDMODE_CLOCK), dotClock);
+ DebugF(" hdsp: %d hbeg: %d hend: %d httl: %d\n",
+ VidModeGetModeValue(mode, VIDMODE_H_DISPLAY),
+ VidModeGetModeValue(mode, VIDMODE_H_SYNCSTART),
+ VidModeGetModeValue(mode, VIDMODE_H_SYNCEND),
+ VidModeGetModeValue(mode, VIDMODE_H_TOTAL));
+ DebugF(" vdsp: %d vbeg: %d vend: %d vttl: %d flags: %d\n",
+ VidModeGetModeValue(mode, VIDMODE_V_DISPLAY),
+ VidModeGetModeValue(mode, VIDMODE_V_SYNCSTART),
+ VidModeGetModeValue(mode, VIDMODE_V_SYNCEND),
+ VidModeGetModeValue(mode, VIDMODE_V_TOTAL),
+ VidModeGetModeValue(mode, VIDMODE_FLAGS));
+
+ if ((pVidMode->GetDotClock(pScreen, stuff->dotclock) == dotClock) &&
+ MODEMATCH(mode, stuff))
+ return BadValue;
+
+ if (!pVidMode->GetFirstModeline(pScreen, &mode, &dotClock))
+ return BadValue;
+
+ do {
+ DebugF("Checking against clock: %d (%d)\n",
VidModeGetModeValue(mode, VIDMODE_CLOCK), dotClock);
- LogMessage(X_INFO, " hdsp: %d hbeg: %d hend: %d httl: %d\n",
+ DebugF(" hdsp: %d hbeg: %d hend: %d httl: %d\n",
VidModeGetModeValue(mode, VIDMODE_H_DISPLAY),
VidModeGetModeValue(mode, VIDMODE_H_SYNCSTART),
VidModeGetModeValue(mode, VIDMODE_H_SYNCEND),
VidModeGetModeValue(mode, VIDMODE_H_TOTAL));
- LogMessage(X_INFO, " vdsp: %d vbeg: %d vend: %d vttl: %d flags: %d\n",
+ DebugF(" vdsp: %d vbeg: %d vend: %d vttl: %d flags: %d\n",
VidModeGetModeValue(mode, VIDMODE_V_DISPLAY),
VidModeGetModeValue(mode, VIDMODE_V_SYNCSTART),
VidModeGetModeValue(mode, VIDMODE_V_SYNCEND),
VidModeGetModeValue(mode, VIDMODE_V_TOTAL),
VidModeGetModeValue(mode, VIDMODE_FLAGS));
- if ((pVidMode->GetDotClock(pScreen, stuff->dotclock) == dotClock) &&
- MODEMATCH(mode, stuff))
- return BadValue;
-
- if (!pVidMode->GetFirstModeline(pScreen, &mode, &dotClock))
- return BadValue;
-
- do {
- LogMessage(X_INFO, "Checking against clock: %d (%d)\n",
- VidModeGetModeValue(mode, VIDMODE_CLOCK), dotClock);
- LogMessage(X_INFO, " hdsp: %d hbeg: %d hend: %d httl: %d\n",
- VidModeGetModeValue(mode, VIDMODE_H_DISPLAY),
- VidModeGetModeValue(mode, VIDMODE_H_SYNCSTART),
- VidModeGetModeValue(mode, VIDMODE_H_SYNCEND),
- VidModeGetModeValue(mode, VIDMODE_H_TOTAL));
- LogMessage(X_INFO, " vdsp: %d vbeg: %d vend: %d vttl: %d flags: %d\n",
- VidModeGetModeValue(mode, VIDMODE_V_DISPLAY),
- VidModeGetModeValue(mode, VIDMODE_V_SYNCSTART),
- VidModeGetModeValue(mode, VIDMODE_V_SYNCEND),
- VidModeGetModeValue(mode, VIDMODE_V_TOTAL),
- VidModeGetModeValue(mode, VIDMODE_FLAGS));
-
if ((pVidMode->GetDotClock(pScreen, stuff->dotclock) == dotClock) &&
MODEMATCH(mode, stuff)) {
pVidMode->DeleteModeline(pScreen, mode);
- LogMessage(X_INFO, "DeleteModeLine - Succeeded\n");
+ DebugF("DeleteModeLine - Succeeded\n");
return Success;
}
} while (pVidMode->GetNextModeline(pScreen, &mode, &dotClock));
@@ -761,12 +761,12 @@ ProcVidModeModModeLine(ClientPtr client)
stuff->flags = oldstuff->flags;
stuff->privsize = oldstuff->privsize;
}
- LogMessage(X_INFO, "ModModeLine - scrn: %d hdsp: %d hbeg: %d hend: %d httl: %d\n",
- (int) stuff->screen, stuff->hdisplay, stuff->hsyncstart,
- stuff->hsyncend, stuff->htotal);
- LogMessage(X_INFO, " vdsp: %d vbeg: %d vend: %d vttl: %d flags: %ld\n",
- stuff->vdisplay, stuff->vsyncstart, stuff->vsyncend,
- stuff->vtotal, (unsigned long) stuff->flags);
+ DebugF("ModModeLine - scrn: %d hdsp: %d hbeg: %d hend: %d httl: %d\n",
+ (int) stuff->screen, stuff->hdisplay, stuff->hsyncstart,
+ stuff->hsyncend, stuff->htotal);
+ DebugF(" vdsp: %d vbeg: %d vend: %d vttl: %d flags: %ld\n",
+ stuff->vdisplay, stuff->vsyncstart, stuff->vsyncend,
+ stuff->vtotal, (unsigned long) stuff->flags);
if (ver < 2) {
REQUEST_AT_LEAST_SIZE(xXF86OldVidModeModModeLineReq);
@@ -816,7 +816,7 @@ ProcVidModeModModeLine(ClientPtr client)
VidModeSetModeValue(modetmp, VIDMODE_FLAGS, stuff->flags);
if (stuff->privsize)
- LogMessage(X_INFO, "ModModeLine - Privates in request have been ignored\n");
+ DebugF("ModModeLine - Privates in request have been ignored\n");
/* Check that the mode is consistent with the monitor specs */
switch (pVidMode->CheckModeForMonitor(pScreen, modetmp)) {
@@ -856,7 +856,7 @@ ProcVidModeModModeLine(ClientPtr client)
pVidMode->SetCrtcForMode(pScreen, mode);
pVidMode->SwitchMode(pScreen, mode);
- LogMessage(X_INFO, "ModModeLine - Succeeded\n");
+ DebugF("ModModeLine - Succeeded\n");
return Success;
}
@@ -896,14 +896,14 @@ ProcVidModeValidateModeLine(ClientPtr client)
stuff->privsize = oldstuff->privsize;
}
- LogMessage(X_INFO, "ValidateModeLine - scrn: %d clock: %ld\n",
- (int) stuff->screen, (unsigned long) stuff->dotclock);
- LogMessage(X_INFO, " hdsp: %d hbeg: %d hend: %d httl: %d\n",
- stuff->hdisplay, stuff->hsyncstart,
- stuff->hsyncend, stuff->htotal);
- LogMessage(X_INFO, " vdsp: %d vbeg: %d vend: %d vttl: %d flags: %ld\n",
- stuff->vdisplay, stuff->vsyncstart, stuff->vsyncend, stuff->vtotal,
- (unsigned long) stuff->flags);
+ DebugF("ValidateModeLine - scrn: %d clock: %ld\n",
+ (int) stuff->screen, (unsigned long) stuff->dotclock);
+ DebugF(" hdsp: %d hbeg: %d hend: %d httl: %d\n",
+ stuff->hdisplay, stuff->hsyncstart,
+ stuff->hsyncend, stuff->htotal);
+ DebugF(" vdsp: %d vbeg: %d vend: %d vttl: %d flags: %ld\n",
+ stuff->vdisplay, stuff->vsyncstart, stuff->vsyncend, stuff->vtotal,
+ (unsigned long) stuff->flags);
if (ver < 2) {
REQUEST_AT_LEAST_SIZE(xXF86OldVidModeValidateModeLineReq);
@@ -956,7 +956,7 @@ ProcVidModeValidateModeLine(ClientPtr client)
VidModeSetModeValue(modetmp, VIDMODE_V_TOTAL, stuff->vtotal);
VidModeSetModeValue(modetmp, VIDMODE_FLAGS, stuff->flags);
if (stuff->privsize)
- LogMessage(X_INFO, "ValidateModeLine - Privates in request have been ignored\n");
+ DebugF("ValidateModeLine - Privates in request have been ignored\n");
/* Check that the mode is consistent with the monitor specs */
if ((status =
@@ -982,7 +982,7 @@ ProcVidModeValidateModeLine(ClientPtr client)
swapl(&rep.status);
}
WriteToClient(client, sizeof(xXF86VidModeValidateModeLineReply), &rep);
- LogMessage(X_INFO, "ValidateModeLine - Succeeded (status = %d)\n", status);
+ DebugF("ValidateModeLine - Succeeded (status = %d)\n", status);
return Success;
}
@@ -1046,14 +1046,14 @@ ProcVidModeSwitchToMode(ClientPtr client)
stuff->privsize = oldstuff->privsize;
}
- LogMessage(X_INFO, "SwitchToMode - scrn: %d clock: %ld\n",
- (int) stuff->screen, (unsigned long) stuff->dotclock);
- LogMessage(X_INFO, " hdsp: %d hbeg: %d hend: %d httl: %d\n",
- stuff->hdisplay, stuff->hsyncstart,
- stuff->hsyncend, stuff->htotal);
- LogMessage(X_INFO, " vdsp: %d vbeg: %d vend: %d vttl: %d flags: %ld\n",
- stuff->vdisplay, stuff->vsyncstart, stuff->vsyncend, stuff->vtotal,
- (unsigned long) stuff->flags);
+ DebugF("SwitchToMode - scrn: %d clock: %ld\n",
+ (int) stuff->screen, (unsigned long) stuff->dotclock);
+ DebugF(" hdsp: %d hbeg: %d hend: %d httl: %d\n",
+ stuff->hdisplay, stuff->hsyncstart,
+ stuff->hsyncend, stuff->htotal);
+ DebugF(" vdsp: %d vbeg: %d vend: %d vttl: %d flags: %ld\n",
+ stuff->vdisplay, stuff->vsyncstart, stuff->vsyncend, stuff->vtotal,
+ (unsigned long) stuff->flags);
if (ver < 2) {
REQUEST_AT_LEAST_SIZE(xXF86OldVidModeSwitchToModeReq);
@@ -1089,19 +1089,19 @@ ProcVidModeSwitchToMode(ClientPtr client)
return BadValue;
do {
- LogMessage(X_INFO, "Checking against clock: %d (%d)\n",
- VidModeGetModeValue(mode, VIDMODE_CLOCK), dotClock);
- LogMessage(X_INFO, " hdsp: %d hbeg: %d hend: %d httl: %d\n",
- VidModeGetModeValue(mode, VIDMODE_H_DISPLAY),
- VidModeGetModeValue(mode, VIDMODE_H_SYNCSTART),
- VidModeGetModeValue(mode, VIDMODE_H_SYNCEND),
- VidModeGetModeValue(mode, VIDMODE_H_TOTAL));
- LogMessage(X_INFO, " vdsp: %d vbeg: %d vend: %d vttl: %d flags: %d\n",
- VidModeGetModeValue(mode, VIDMODE_V_DISPLAY),
- VidModeGetModeValue(mode, VIDMODE_V_SYNCSTART),
- VidModeGetModeValue(mode, VIDMODE_V_SYNCEND),
- VidModeGetModeValue(mode, VIDMODE_V_TOTAL),
- VidModeGetModeValue(mode, VIDMODE_FLAGS));
+ DebugF("Checking against clock: %d (%d)\n",
+ VidModeGetModeValue(mode, VIDMODE_CLOCK), dotClock);
+ DebugF(" hdsp: %d hbeg: %d hend: %d httl: %d\n",
+ VidModeGetModeValue(mode, VIDMODE_H_DISPLAY),
+ VidModeGetModeValue(mode, VIDMODE_H_SYNCSTART),
+ VidModeGetModeValue(mode, VIDMODE_H_SYNCEND),
+ VidModeGetModeValue(mode, VIDMODE_H_TOTAL));
+ DebugF(" vdsp: %d vbeg: %d vend: %d vttl: %d flags: %d\n",
+ VidModeGetModeValue(mode, VIDMODE_V_DISPLAY),
+ VidModeGetModeValue(mode, VIDMODE_V_SYNCSTART),
+ VidModeGetModeValue(mode, VIDMODE_V_SYNCEND),
+ VidModeGetModeValue(mode, VIDMODE_V_TOTAL),
+ VidModeGetModeValue(mode, VIDMODE_FLAGS));
if ((pVidMode->GetDotClock(pScreen, stuff->dotclock) == dotClock) &&
MODEMATCH(mode, stuff)) {
@@ -1109,7 +1109,7 @@ ProcVidModeSwitchToMode(ClientPtr client)
if (!pVidMode->SwitchMode(pScreen, mode))
return BadValue;
- LogMessage(X_INFO, "SwitchToMode - Succeeded\n");
+ DebugF("SwitchToMode - Succeeded\n");
return Success;
}
} while (pVidMode->GetNextModeline(pScreen, &mode, &dotClock));
--
cgit v0.10.2
|