]> git.sesse.net Git - rdpsrv/blob - Xserver/programs/Xserver/include/servermd.h
Support RDP5 logon packets.
[rdpsrv] / Xserver / programs / Xserver / include / servermd.h
1 /***********************************************************
2
3 Copyright (c) 1987  X Consortium
4
5 Permission is hereby granted, free of charge, to any person obtaining a copy
6 of this software and associated documentation files (the "Software"), to deal
7 in the Software without restriction, including without limitation the rights
8 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 copies of the Software, and to permit persons to whom the Software is
10 furnished to do so, subject to the following conditions:
11
12 The above copyright notice and this permission notice shall be included in
13 all copies or substantial portions of the Software.
14
15 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
18 X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
19 AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21
22 Except as contained in this notice, the name of the X Consortium shall not be
23 used in advertising or otherwise to promote the sale, use or other dealings
24 in this Software without prior written authorization from the X Consortium.
25
26
27 Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
28
29                         All Rights Reserved
30
31 Permission to use, copy, modify, and distribute this software and its 
32 documentation for any purpose and without fee is hereby granted, 
33 provided that the above copyright notice appear in all copies and that
34 both that copyright notice and this permission notice appear in 
35 supporting documentation, and that the name of Digital not be
36 used in advertising or publicity pertaining to distribution of the
37 software without specific, written prior permission.  
38
39 DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
40 ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
41 DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
42 ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
43 WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
44 ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
45 SOFTWARE.
46
47 ******************************************************************/
48 #ifndef SERVERMD_H
49 #define SERVERMD_H 1
50 /* $XConsortium: servermd.h /main/58 1996/12/02 10:22:09 lehors $ */
51 /* $XFree86: xc/programs/Xserver/include/servermd.h,v 3.19.2.3 1997/07/28 14:17:34 dawes Exp $ */
52
53 /*
54  * Machine dependent values:
55  * GLYPHPADBYTES should be chosen with consideration for the space-time
56  * trade-off.  Padding to 0 bytes means that there is no wasted space
57  * in the font bitmaps (both on disk and in memory), but that access of
58  * the bitmaps will cause odd-address memory references.  Padding to
59  * 2 bytes would ensure even address memory references and would
60  * be suitable for a 68010-class machine, but at the expense of wasted
61  * space in the font bitmaps.  Padding to 4 bytes would be good
62  * for real 32 bit machines, etc.  Be sure that you tell the font
63  * compiler what kind of padding you want because its defines are
64  * kept separate from this.  See server/include/font.h for how
65  * GLYPHPADBYTES is used.
66  *
67  * Along with this, you should choose an appropriate value for
68  * GETLEFTBITS_ALIGNMENT, which is used in ddx/mfb/maskbits.h.  This
69  * constant choses what kind of memory references are guarenteed during
70  * font access; either 1, 2 or 4, for byte, word or longword access,
71  * respectively.  For instance, if you have decided to to have
72  * GLYPHPADBYTES == 4, then it is pointless for you to have a
73  * GETLEFTBITS_ALIGNMENT > 1, because the padding of the fonts has already
74  * guarenteed you that your fonts are longword aligned.  On the other
75  * hand, even if you have chosen GLYPHPADBYTES == 1 to save space, you may
76  * also decide that the computing involved in aligning the pointer is more
77  * costly than an odd-address access; you choose GETLEFTBITS_ALIGNMENT == 1.
78  *
79  * Next, choose the tuning parameters which are appropriate for your
80  * hardware; these modify the behaviour of the raw frame buffer code
81  * in ddx/mfb and ddx/cfb.  Defining these incorrectly will not cause
82  * the server to run incorrectly, but defining these correctly will
83  * cause some noticeable speed improvements:
84  *
85  *  AVOID_MEMORY_READ - (8-bit cfb only)
86  *      When stippling pixels on the screen (polytext and pushpixels),
87  *      don't read long words from the display and mask in the
88  *      appropriate values.  Rather, perform multiple byte/short/long
89  *      writes as appropriate.  This option uses many more instructions
90  *      but runs much faster when the destination is much slower than
91  *      the CPU and at least 1 level of write buffer is availible (2
92  *      is much better).  Defined currently for SPARC and MIPS.
93  *
94  *  FAST_CONSTANT_OFFSET_MODE - (cfb and mfb)
95  *      This define is used on machines which have no auto-increment
96  *      addressing mode, but do have an effectively free constant-offset
97  *      addressing mode.  Currently defined for MIPS and SPARC, even though
98  *      I remember the cg6 as performing better without it (cg3 definitely
99  *      performs better with it).
100  *      
101  *  LARGE_INSTRUCTION_CACHE -
102  *      This define increases the number of times some loops are
103  *      unrolled.  On 68020 machines (with 256 bytes of i-cache),
104  *      this define will slow execution down as instructions miss
105  *      the cache frequently.  On machines with real i-caches, this
106  *      reduces loop overhead, causing a slight performance improvement.
107  *      Currently defined for MIPS and SPARC
108  *
109  *  FAST_UNALIGNED_READS -
110  *      For machines with more memory bandwidth than CPU, this
111  *      define uses unaligned reads for 8-bit BitBLT instead of doing
112  *      aligned reads and combining the results with shifts and
113  *      logical-ors.  Currently defined for 68020 and vax.
114  *  PLENTIFUL_REGISTERS -
115  *      For machines with > 20 registers.  Currently used for
116  *      unrolling the text painting code a bit more.  Currently
117  *      defined for MIPS.
118  *  SHARED_IDCACHE -
119  *      For non-Harvard RISC machines, those which share the same
120  *      CPU memory bus for instructions and data.  This unrolls some
121  *      solid fill loops which are otherwise best left rolled up.
122  *      Currently defined for SPARC.
123  */
124
125 #ifdef vax
126
127 #define IMAGE_BYTE_ORDER        LSBFirst        /* Values for the VAX only */
128 #define BITMAP_BIT_ORDER        LSBFirst
129 #define GLYPHPADBYTES           1
130 #define GETLEFTBITS_ALIGNMENT   4
131 #define FAST_UNALIGNED_READS
132
133 #endif /* vax */
134
135 #if (defined(Lynx) && defined(__powerpc__))
136
137 /* For now this is for Xvfb only */
138 #define IMAGE_BYTE_ORDER        MSBFirst
139 #define BITMAP_BIT_ORDER        MSBFirst
140 #define GLYPHPADBYTES           4
141 #define GETLEFTBITS_ALIGNMENT   1
142
143 #define LARGE_INSTRUCTION_CACHE
144 #define FAST_CONSTANT_OFFSET_MODE
145 #define PLENTIFUL_REGISTERS
146 #define AVOID_MEMORY_READ
147
148 #define FAST_MEMCPY
149
150 #endif /* LynxOS PowerPC */
151
152 #if (defined(sun) && !(defined(i386) && defined(SVR4))) || \
153     (defined(AMOEBA) && (defined(sparc) || defined(mc68000))) || \
154     (defined(__uxp__) && (defined(sparc) || defined(mc68000))) || \
155     (defined(Lynx) && defined(__sparc__)) || \
156     ((defined(__NetBSD__) || defined(__OpenBSD__)) && \
157      (defined(__sparc__) || defined(__mc68000__)))
158
159 #if defined(sun386) || defined(sun5)
160 # define IMAGE_BYTE_ORDER       LSBFirst        /* Values for the SUN only */
161 # define BITMAP_BIT_ORDER       LSBFirst
162 #else
163 # define IMAGE_BYTE_ORDER       MSBFirst        /* Values for the SUN only */
164 # define BITMAP_BIT_ORDER       MSBFirst
165 #endif
166
167 #ifdef sparc
168 # define AVOID_MEMORY_READ
169 # define LARGE_INSTRUCTION_CACHE
170 # define FAST_CONSTANT_OFFSET_MODE
171 # define SHARED_IDCACHE
172 #endif
173
174 #ifdef mc68020
175 #define FAST_UNALIGNED_READS
176 #endif
177
178 #define GLYPHPADBYTES           4
179 #define GETLEFTBITS_ALIGNMENT   1
180
181 #endif /* sun && !(i386 && SVR4) */
182
183
184 #if defined(AIXV3)
185
186 #define IMAGE_BYTE_ORDER        MSBFirst        /* Values for the RISC/6000 */
187 #define BITMAP_BIT_ORDER        MSBFirst
188 #define GLYPHPADBYTES           4
189 #define GETLEFTBITS_ALIGNMENT   1
190
191 #define LARGE_INSTRUCTION_CACHE
192 #define FAST_CONSTANT_OFFSET_MODE
193 #define PLENTIFUL_REGISTERS
194 #define AVOID_MEMORY_READ
195
196 #define FAST_MEMCPY
197 #endif /* AIXV3 */
198
199 #if defined(ibm032) || defined (ibm)
200
201 #ifdef i386
202 # define IMAGE_BYTE_ORDER       LSBFirst        /* Value for PS/2 only */
203 #else
204 # define IMAGE_BYTE_ORDER       MSBFirst        /* Values for the RT only*/
205 #endif
206 #define BITMAP_BIT_ORDER        MSBFirst
207 #define GLYPHPADBYTES           1
208 #define GETLEFTBITS_ALIGNMENT   4
209 /* ibm pcc doesn't understand pragmas. */
210
211 #ifdef i386
212 #define BITMAP_SCANLINE_UNIT    8
213 #endif
214
215 #endif /* ibm */
216
217 #ifdef hpux
218
219 #define IMAGE_BYTE_ORDER        MSBFirst        /* Values for the HP only */
220 #define BITMAP_BIT_ORDER        MSBFirst
221 #define GLYPHPADBYTES           2               /* to match product server */
222 #define GETLEFTBITS_ALIGNMENT   4               /* PA forces longs to 4 */
223                                                 /* byte boundries */
224 #define AVOID_MEMORY_READ
225 #define FAST_CONSTANT_OFFSET_MODE
226 #define LARGE_INSTRUCTION_CACHE
227 #define PLENTIFUL_REGISTERS
228
229 #endif /* hpux */
230
231 #if defined (M4310) || defined(M4315) || defined(M4317) || defined(M4319) || defined(M4330)
232
233 #define IMAGE_BYTE_ORDER        MSBFirst        /* Values for Pegasus only */
234 #define BITMAP_BIT_ORDER        MSBFirst
235 #define GLYPHPADBYTES           4
236 #define GETLEFTBITS_ALIGNMENT   1
237
238 #define FAST_UNALIGNED_READS
239
240 #endif /* tektronix */
241
242 #ifdef macII
243
244 #define IMAGE_BYTE_ORDER        MSBFirst        /* Values for the MacII only */
245 #define BITMAP_BIT_ORDER        MSBFirst
246 #define GLYPHPADBYTES           4
247 #define GETLEFTBITS_ALIGNMENT   1
248
249 /* might want FAST_UNALIGNED_READS for frame buffers with < 1us latency */
250
251 #endif /* macII */
252
253 #if (defined(mips) || defined(__mips)) && !defined(sgi)
254
255 #if defined(MIPSEL) || defined(__MIPSEL__)
256 # define IMAGE_BYTE_ORDER       LSBFirst        /* Values for the PMAX only */
257 # define BITMAP_BIT_ORDER       LSBFirst
258 # define GLYPHPADBYTES          4
259 # define GETLEFTBITS_ALIGNMENT  1
260 #else
261 # define IMAGE_BYTE_ORDER       MSBFirst        /* Values for the MIPS only */
262 # define BITMAP_BIT_ORDER       MSBFirst
263 # define GLYPHPADBYTES          4
264 # define GETLEFTBITS_ALIGNMENT  1
265 #endif
266
267 #define AVOID_MEMORY_READ
268 #define FAST_CONSTANT_OFFSET_MODE
269 #define LARGE_INSTRUCTION_CACHE
270 #define PLENTIFUL_REGISTERS
271
272 #endif /* mips */
273
274 #if defined(__alpha) || defined(__alpha__) || defined(__alphaCross)
275 # define IMAGE_BYTE_ORDER       LSBFirst        /* Values for the Alpha only */
276
277 # if defined(XF86MONOVGA) || defined(XF86VGA16) || defined(XF86MONO)
278 #  define BITMAP_BIT_ORDER      MSBFirst
279 # else
280 #  define BITMAP_BIT_ORDER      LSBFirst
281 # endif
282
283 # if defined(XF86MONOVGA) || defined(XF86VGA16)
284 #  define BITMAP_SCANLINE_UNIT  8
285 # else
286    /* pad scanline to a longword */
287 #  define BITMAP_SCANLINE_UNIT                  64
288 # endif
289
290 # define BITMAP_SCANLINE_PAD                    64
291 # define LOG2_BITMAP_PAD                        6
292 # define LOG2_BYTES_PER_SCANLINE_PAD            3
293 # define GLYPHPADBYTES          4
294 # define GETLEFTBITS_ALIGNMENT  1
295 # define FAST_CONSTANT_OFFSET_MODE
296 # define LARGE_INSTRUCTION_CACHE
297 # define PLENTIFUL_REGISTERS
298
299 /* Add for handling protocol XPutImage and XGetImage; see comment below */
300 #define INTERNAL_VS_EXTERNAL_PADDING
301 #define BITMAP_SCANLINE_UNIT_PROTO              32
302
303 #define BITMAP_SCANLINE_PAD_PROTO               32
304 #define LOG2_BITMAP_PAD_PROTO                   5
305 #define LOG2_BYTES_PER_SCANLINE_PAD_PROTO       2
306
307 #endif /* alpha */
308
309 #ifdef stellar
310
311 #define IMAGE_BYTE_ORDER        MSBFirst       /* Values for the stellar only*/
312 #define BITMAP_BIT_ORDER        MSBFirst
313 #define GLYPHPADBYTES           4
314 #define GETLEFTBITS_ALIGNMENT   4
315 #define IMAGE_BUFSIZE           (64*1024)
316 /*
317  * Use SysV random number generator.
318  */
319 #define random rand
320
321 #endif /* stellar */
322
323 #ifdef luna
324
325 #define IMAGE_BYTE_ORDER        MSBFirst        /* Values for the OMRON only*/
326 #define BITMAP_BIT_ORDER        MSBFirst
327 #define GLYPHPADBYTES           4
328 #define GETLEFTBITS_ALIGNMENT   1
329
330 #ifndef mc68000
331 #define FAST_CONSTANT_OFFSET_MODE
332 #define AVOID_MEMORY_READ
333 #define LARGE_INSTRUCTION_CACHE
334 #define PLENTIFUL_REGISTERS
335 #endif
336
337 #endif /* luna */
338
339 #if (defined(i386) && (defined(SVR4) || defined(SYSV) || (defined(sun) && defined(SVR4))) || defined(__bsdi__) || (defined(__NetBSD__) && defined(__i386__)) || (defined(__OpenBSD__) && defined(__i386__)) || defined(__FreeBSD__) || defined(MACH386) || (defined(linux) && !(defined(__mc68000__) || defined(PPC) || defined(__sparc__) || defined(__s390__))) || (defined(AMOEBA) && defined(i80386)) || defined(MINIX) || defined(__EMX__) || (defined(Lynx) && defined(__i386__)))
340
341 #ifndef IMAGE_BYTE_ORDER
342 #define IMAGE_BYTE_ORDER        LSBFirst
343 #endif
344
345 #ifndef BITMAP_BIT_ORDER
346 # if defined(XF86MONOVGA) || defined(XF86VGA16) || defined(XF86MONO)
347 #  define BITMAP_BIT_ORDER      MSBFirst
348 # else
349 #  define BITMAP_BIT_ORDER      LSBFirst
350 # endif
351 #endif
352
353 #ifndef BITMAP_SCANLINE_UNIT
354 # if defined(XF86MONOVGA) || defined(XF86VGA16)
355 #  define BITMAP_SCANLINE_UNIT  8
356 # endif
357 #endif
358
359 #ifndef GLYPHPADBYTES
360 #define GLYPHPADBYTES           4
361 #endif
362
363 #define GETLEFTBITS_ALIGNMENT   1
364 #define AVOID_MEMORY_READ
365 #ifdef XSVGA
366 #define AVOID_GLYPHBLT
367 #define FAST_CONSTANT_OFFSET_MODE
368 #define FAST_MEMCPY
369 #define NO_ONE_RECT
370 #endif
371
372 #endif /* SVR4 / BSD / i386 */
373
374 #if defined (linux) && defined (__mc68000__)
375
376 #define IMAGE_BYTE_ORDER       MSBFirst
377 #define BITMAP_BIT_ORDER       MSBFirst
378 #define FAST_UNALIGNED_READS
379 #define GLYPHPADBYTES          4
380 #define GETLEFTBITS_ALIGNMENT  1
381
382 #endif /* linux/m68k */
383
384 #if defined (linux) && defined (PPC)
385
386 #define IMAGE_BYTE_ORDER       MSBFirst
387 #define BITMAP_BIT_ORDER       MSBFirst
388 #define GLYPHPADBYTES          4
389 #define GETLEFTBITS_ALIGNMENT  1
390
391 #define LARGE_INSTRUCTION_CACHE
392 #define FAST_CONSTANT_OFFSET_MODE
393
394 #endif /* linux/PPC */
395
396 #if defined (linux) && defined (__sparc__)
397
398 #define IMAGE_BYTE_ORDER       MSBFirst
399 #define BITMAP_BIT_ORDER       MSBFirst
400 #define GLYPHPADBYTES          4
401 #define GETLEFTBITS_ALIGNMENT  1
402
403 #endif /* linux/__sparc__ */
404
405 #if defined (linux) && defined (__s390__)
406
407 #define IMAGE_BYTE_ORDER       MSBFirst
408 #define BITMAP_BIT_ORDER       MSBFirst
409 #define GLYPHPADBYTES          4
410 #define GETLEFTBITS_ALIGNMENT  1
411
412 #endif /* linux/__s390__ */
413
414 #if defined (linux) && defined (PPC)
415
416 #define IMAGE_BYTE_ORDER       MSBFirst
417 #define BITMAP_BIT_ORDER       MSBFirst
418 #define GLYPHPADBYTES          4
419 #define GETLEFTBITS_ALIGNMENT  1
420
421 #define LARGE_INSTRUCTION_CACHE
422 #define FAST_CONSTANT_OFFSET_MODE
423
424 #endif /* linux/PPC */
425
426 #ifdef sgi
427
428 #define IMAGE_BYTE_ORDER        MSBFirst
429 #define BITMAP_BIT_ORDER        MSBFirst
430
431 #if (_MIPS_SZLONG == 64)
432
433 # define GLYPHPADBYTES          4
434 # define GETLEFTBITS_ALIGNMENT  1
435
436 /* pad scanline to a longword */
437 #define BITMAP_SCANLINE_UNIT                    64
438
439 #define BITMAP_SCANLINE_PAD                     64
440 #define LOG2_BITMAP_PAD                         6
441 #define LOG2_BYTES_PER_SCANLINE_PAD             3
442
443 /* Add for handling protocol XPutImage and XGetImage; see comment below */
444 #define INTERNAL_VS_EXTERNAL_PADDING
445 #define BITMAP_SCANLINE_UNIT_PROTO              32
446
447 #define BITMAP_SCANLINE_PAD_PROTO               32
448 #define LOG2_BITMAP_PAD_PROTO                   5
449 #define LOG2_BYTES_PER_SCANLINE_PAD_PROTO       2
450
451 #else
452
453 #define GLYPHPADBYTES           2
454 #define GETLEFTBITS_ALIGNMENT   4
455
456 #endif
457
458 #define AVOID_MEMORY_READ
459 #define FAST_CONSTANT_OFFSET_MODE
460 #define LARGE_INSTRUCTION_CACHE
461 #define PLENTIFUL_REGISTERS
462
463 #endif
464
465 /* size of buffer to use with GetImage, measured in bytes. There's obviously
466  * a trade-off between the amount of stack (or whatever ALLOCATE_LOCAL gives
467  * you) used and the number of times the ddx routine has to be called.
468  * 
469  * for a 1024 x 864 bit monochrome screen  with a 32 bit word we get 
470  * 8192/4 words per buffer 
471  * (1024/32) = 32 words per scanline
472  * 2048 words per buffer / 32 words per scanline = 64 scanlines per buffer
473  * 864 scanlines / 64 scanlines = 14 buffers to draw a full screen
474  */
475 #ifndef IMAGE_BUFSIZE
476 #define IMAGE_BUFSIZE           8192
477 #endif
478
479 /* pad scanline to a longword */
480 #ifndef BITMAP_SCANLINE_UNIT
481 #define BITMAP_SCANLINE_UNIT    32
482 #endif
483
484 #ifndef BITMAP_SCANLINE_PAD
485 #define BITMAP_SCANLINE_PAD  32
486 #define LOG2_BITMAP_PAD         5
487 #define LOG2_BYTES_PER_SCANLINE_PAD     2
488 #endif
489
490 /* 
491  *   This returns the number of padding units, for depth d and width w.
492  * For bitmaps this can be calculated with the macros above.
493  * Other depths require either grovelling over the formats field of the
494  * screenInfo or hardwired constants.
495  */
496
497 typedef struct _PaddingInfo {
498         int     padRoundUp;     /* pixels per pad unit - 1 */
499         int     padPixelsLog2;  /* log 2 (pixels per pad unit) */
500         int     padBytesLog2;   /* log 2 (bytes per pad unit) */
501         int     notPower2;      /* bitsPerPixel not a power of 2 */
502         int     bytesPerPixel;  /* only set when notPower2 is TRUE */
503 } PaddingInfo;
504 extern PaddingInfo PixmapWidthPaddingInfo[];
505
506 #define PixmapWidthInPadUnits(w, d) \
507     (PixmapWidthPaddingInfo[d].notPower2 ? \
508     (((int)(w) * PixmapWidthPaddingInfo[d].bytesPerPixel +  \
509                  PixmapWidthPaddingInfo[d].bytesPerPixel) >> \
510         PixmapWidthPaddingInfo[d].padBytesLog2) : \
511     ((int)((w) + PixmapWidthPaddingInfo[d].padRoundUp) >> \
512         PixmapWidthPaddingInfo[d].padPixelsLog2))
513
514 /*
515  *      Return the number of bytes to which a scanline of the given
516  * depth and width will be padded.
517  */
518 #define PixmapBytePad(w, d) \
519     (PixmapWidthInPadUnits(w, d) << PixmapWidthPaddingInfo[d].padBytesLog2)
520
521 #define BitmapBytePad(w) \
522     (((int)((w) + BITMAP_SCANLINE_PAD - 1) >> LOG2_BITMAP_PAD) << LOG2_BYTES_PER_SCANLINE_PAD)
523
524 #ifdef INTERNAL_VS_EXTERNAL_PADDING
525
526 /*  This is defined if the server's internal padding is different from the padding
527  *  advertised in the protocol.  The protocol does not allow for padding to
528  *  64 bits, for example, so if the server wants to use 64 bit padding internally,
529  *  it has to advertise 32 bit padding and do padding fixups whenever images
530  *  cross the wire.  (See ProcGetImage and ProcPutImage.)
531  *
532  *  The macros and constants that end in Proto or PROTO refer to the advertised
533  *  padding, and the ones without Proto are for internal padding.
534  */
535
536 extern PaddingInfo PixmapWidthPaddingInfoProto[];
537
538 #define PixmapWidthInPadUnitsProto(w, d) \
539     (PixmapWidthPaddingInfoProto[d].notPower2 ? \
540     (((int)(w) * PixmapWidthPaddingInfoProto[d].bytesPerPixel +  \
541                  PixmapWidthPaddingInfoProto[d].bytesPerPixel) >> \
542         PixmapWidthPaddingInfoProto[d].padBytesLog2) : \
543     ((int)((w) + PixmapWidthPaddingInfoProto[d].padRoundUp) >> \
544         PixmapWidthPaddingInfoProto[d].padPixelsLog2))
545
546 #define PixmapBytePadProto(w, d) \
547     (PixmapWidthInPadUnitsProto(w, d) << \
548     PixmapWidthPaddingInfoProto[d].padBytesLog2)
549
550 #define BitmapBytePadProto(w) \
551     ((((w) + BITMAP_SCANLINE_PAD_PROTO - 1) >> LOG2_BITMAP_PAD_PROTO) \
552     << LOG2_BYTES_PER_SCANLINE_PAD_PROTO)
553
554 #else /* protocol and internal padding is the same */
555
556 #define PixmapWidthInPadUnitsProto(w, d) PixmapWidthInPadUnits(w, d)
557 #define PixmapBytePadProto(w, d) PixmapBytePad(w, d)
558 #define BitmapBytePadProto(w) BitmapBytePad(w)
559
560 #endif /* protocol vs. internal padding  */
561
562 #endif /* SERVERMD_H */