~ubuntu-branches/ubuntu/intrepid/xserver-xgl/intrepid

« back to all changes in this revision

Viewing changes to include/servermd.h

  • Committer: Bazaar Package Importer
  • Author(s): Matthew Garrett
  • Date: 2006-02-13 14:21:43 UTC
  • Revision ID: james.westby@ubuntu.com-20060213142143-mad6z9xzem7hzxz9
Tags: upstream-7.0.0
ImportĀ upstreamĀ versionĀ 7.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* $XFree86: xc/programs/Xserver/include/servermd.h,v 3.56tsi Exp $ */
 
2
/***********************************************************
 
3
 
 
4
Copyright 1987, 1998  The Open Group
 
5
 
 
6
Permission to use, copy, modify, distribute, and sell this software and its
 
7
documentation for any purpose is hereby granted without fee, provided that
 
8
the above copyright notice appear in all copies and that both that
 
9
copyright notice and this permission notice appear in supporting
 
10
documentation.
 
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
OPEN GROUP 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 Open Group 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 Open Group.
 
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
/* $Xorg: servermd.h,v 1.3 2000/08/17 19:53:31 cpqbld Exp $ */
 
49
/* $XdotOrg: xserver/xorg/include/servermd.h,v 1.9 2005/11/15 00:29:23 ajax Exp $ */
 
50
 
 
51
#ifndef SERVERMD_H
 
52
#define SERVERMD_H 1
 
53
 
 
54
/*
 
55
 * Machine dependent values:
 
56
 * GLYPHPADBYTES should be chosen with consideration for the space-time
 
57
 * trade-off.  Padding to 0 bytes means that there is no wasted space
 
58
 * in the font bitmaps (both on disk and in memory), but that access of
 
59
 * the bitmaps will cause odd-address memory references.  Padding to
 
60
 * 2 bytes would ensure even address memory references and would
 
61
 * be suitable for a 68010-class machine, but at the expense of wasted
 
62
 * space in the font bitmaps.  Padding to 4 bytes would be good
 
63
 * for real 32 bit machines, etc.  Be sure that you tell the font
 
64
 * compiler what kind of padding you want because its defines are
 
65
 * kept separate from this.  See server/include/font.h for how
 
66
 * GLYPHPADBYTES is used.
 
67
 *
 
68
 * Along with this, you should choose an appropriate value for
 
69
 * GETLEFTBITS_ALIGNMENT, which is used in ddx/mfb/maskbits.h.  This
 
70
 * constant choses what kind of memory references are guarenteed during
 
71
 * font access; either 1, 2 or 4, for byte, word or longword access,
 
72
 * respectively.  For instance, if you have decided to to have
 
73
 * GLYPHPADBYTES == 4, then it is pointless for you to have a
 
74
 * GETLEFTBITS_ALIGNMENT > 1, because the padding of the fonts has already
 
75
 * guarenteed you that your fonts are longword aligned.  On the other
 
76
 * hand, even if you have chosen GLYPHPADBYTES == 1 to save space, you may
 
77
 * also decide that the computing involved in aligning the pointer is more
 
78
 * costly than an odd-address access; you choose GETLEFTBITS_ALIGNMENT == 1.
 
79
 *
 
80
 * Next, choose the tuning parameters which are appropriate for your
 
81
 * hardware; these modify the behaviour of the raw frame buffer code
 
82
 * in ddx/mfb and ddx/cfb.  Defining these incorrectly will not cause
 
83
 * the server to run incorrectly, but defining these correctly will
 
84
 * cause some noticeable speed improvements:
 
85
 *
 
86
 *  AVOID_MEMORY_READ - (8-bit cfb only)
 
87
 *      When stippling pixels on the screen (polytext and pushpixels),
 
88
 *      don't read long words from the display and mask in the
 
89
 *      appropriate values.  Rather, perform multiple byte/short/long
 
90
 *      writes as appropriate.  This option uses many more instructions
 
91
 *      but runs much faster when the destination is much slower than
 
92
 *      the CPU and at least 1 level of write buffer is availible (2
 
93
 *      is much better).  Defined currently for SPARC and MIPS.
 
94
 *
 
95
 *  FAST_CONSTANT_OFFSET_MODE - (cfb and mfb)
 
96
 *      This define is used on machines which have no auto-increment
 
97
 *      addressing mode, but do have an effectively free constant-offset
 
98
 *      addressing mode.  Currently defined for MIPS and SPARC, even though
 
99
 *      I remember the cg6 as performing better without it (cg3 definitely
 
100
 *      performs better with it).
 
101
 *      
 
102
 *  LARGE_INSTRUCTION_CACHE -
 
103
 *      This define increases the number of times some loops are
 
104
 *      unrolled.  On 68020 machines (with 256 bytes of i-cache),
 
105
 *      this define will slow execution down as instructions miss
 
106
 *      the cache frequently.  On machines with real i-caches, this
 
107
 *      reduces loop overhead, causing a slight performance improvement.
 
108
 *      Currently defined for MIPS and SPARC
 
109
 *
 
110
 *  FAST_UNALIGNED_READS -
 
111
 *      For machines with more memory bandwidth than CPU, this
 
112
 *      define uses unaligned reads for 8-bit BitBLT instead of doing
 
113
 *      aligned reads and combining the results with shifts and
 
114
 *      logical-ors.  Currently defined for 68020 and vax.
 
115
 *  PLENTIFUL_REGISTERS -
 
116
 *      For machines with > 20 registers.  Currently used for
 
117
 *      unrolling the text painting code a bit more.  Currently
 
118
 *      defined for MIPS.
 
119
 *  SHARED_IDCACHE -
 
120
 *      For non-Harvard RISC machines, those which share the same
 
121
 *      CPU memory bus for instructions and data.  This unrolls some
 
122
 *      solid fill loops which are otherwise best left rolled up.
 
123
 *      Currently defined for SPARC.
 
124
 */
 
125
 
 
126
#ifdef vax
 
127
 
 
128
#define IMAGE_BYTE_ORDER        LSBFirst        /* Values for the VAX only */
 
129
#define BITMAP_BIT_ORDER        LSBFirst
 
130
#define GLYPHPADBYTES           1
 
131
#define GETLEFTBITS_ALIGNMENT   4
 
132
#define FAST_UNALIGNED_READS
 
133
 
 
134
#endif /* vax */
 
135
 
 
136
#ifdef __arm32__
 
137
 
 
138
#define IMAGE_BYTE_ORDER        LSBFirst
 
139
 
 
140
# if defined(XF86MONOVGA) || defined(XF86VGA16) || defined(XF86MONO)
 
141
#  define BITMAP_BIT_ORDER      MSBFirst
 
142
# else
 
143
#  define BITMAP_BIT_ORDER      LSBFirst
 
144
# endif
 
145
 
 
146
# if defined(XF86MONOVGA) || defined(XF86VGA16)
 
147
#  define BITMAP_SCANLINE_UNIT  8
 
148
# endif
 
149
 
 
150
#define GLYPHPADBYTES           4
 
151
#define GETLEFTBITS_ALIGNMENT   1
 
152
#define LARGE_INSTRUCTION_CACHE
 
153
#define AVOID_MEMORY_READ
 
154
 
 
155
#endif /* __arm32__ */
 
156
 
 
157
#if defined (hpux) || defined __hppa__
 
158
 
 
159
#define IMAGE_BYTE_ORDER        MSBFirst
 
160
#define BITMAP_BIT_ORDER        MSBFirst
 
161
#define GLYPHPADBYTES           4       /* to make fb work */
 
162
#define GETLEFTBITS_ALIGNMENT   1       /* PA forces longs to 4 */
 
163
                                        /* byte boundries */
 
164
#define AVOID_MEMORY_READ
 
165
#define FAST_CONSTANT_OFFSET_MODE
 
166
#define LARGE_INSTRUCTION_CACHE
 
167
#define PLENTIFUL_REGISTERS
 
168
 
 
169
#endif /* hpux || __hppa__ */
 
170
 
 
171
#if defined(__powerpc__) || defined(__ppc__)
 
172
 
 
173
#define IMAGE_BYTE_ORDER        MSBFirst
 
174
#define BITMAP_BIT_ORDER        MSBFirst
 
175
#define GLYPHPADBYTES           4
 
176
#define GETLEFTBITS_ALIGNMENT   1
 
177
 
 
178
/* XXX Should this be for Lynx only? */
 
179
#ifdef Lynx
 
180
#define BITMAP_SCANLINE_UNIT    8
 
181
#endif
 
182
 
 
183
#define LARGE_INSTRUCTION_CACHE
 
184
#define FAST_CONSTANT_OFFSET_MODE
 
185
#define PLENTIFUL_REGISTERS
 
186
#define AVOID_MEMORY_READ
 
187
 
 
188
#define FAST_MEMCPY
 
189
 
 
190
#endif /* PowerPC */
 
191
 
 
192
#if defined(__sh__)
 
193
 
 
194
#if defined(__BIG_ENDIAN__)
 
195
# define IMAGE_BYTE_ORDER       MSBFirst
 
196
# define BITMAP_BIT_ORDER       MSBFirst
 
197
# define GLYPHPADBYTES          4
 
198
# define GETLEFTBITS_ALIGNMENT  1
 
199
#else
 
200
# define IMAGE_BYTE_ORDER       LSBFirst
 
201
# define BITMAP_BIT_ORDER       LSBFirst
 
202
# define GLYPHPADBYTES          4
 
203
# define GETLEFTBITS_ALIGNMENT  1
 
204
#endif
 
205
 
 
206
#define AVOID_MEMORY_READ
 
207
#define FAST_CONSTANT_OFFSET_MODE
 
208
#define LARGE_INSTRUCTION_CACHE
 
209
#define PLENTIFUL_REGISTERS
 
210
 
 
211
#endif /* SuperH */
 
212
 
 
213
 
 
214
#if (defined(sun) && (defined(__sparc) || defined(sparc))) || \
 
215
    (defined(__uxp__) && (defined(sparc) || defined(mc68000))) || \
 
216
    defined(__sparc__) || defined(__mc68000__)
 
217
 
 
218
#if defined(__sparc) || defined(__sparc__)
 
219
# if !defined(sparc)
 
220
#  define sparc 1
 
221
# endif
 
222
#endif
 
223
 
 
224
#if defined(sun386) || defined(sun5)
 
225
# define IMAGE_BYTE_ORDER       LSBFirst        /* Values for the SUN only */
 
226
# define BITMAP_BIT_ORDER       LSBFirst
 
227
#else
 
228
# define IMAGE_BYTE_ORDER       MSBFirst        /* Values for the SUN only */
 
229
# define BITMAP_BIT_ORDER       MSBFirst
 
230
#endif
 
231
 
 
232
#ifdef sparc
 
233
# define AVOID_MEMORY_READ
 
234
# define LARGE_INSTRUCTION_CACHE
 
235
# define FAST_CONSTANT_OFFSET_MODE
 
236
# define SHARED_IDCACHE
 
237
#endif
 
238
 
 
239
#ifdef mc68020
 
240
#define FAST_UNALIGNED_READS
 
241
#endif
 
242
 
 
243
#define GLYPHPADBYTES           4
 
244
#define GETLEFTBITS_ALIGNMENT   1
 
245
 
 
246
#endif /* sun && !(i386 && SVR4) */
 
247
 
 
248
 
 
249
#if defined(AIXV3)
 
250
 
 
251
#define IMAGE_BYTE_ORDER        MSBFirst        /* Values for the RISC/6000 */
 
252
#define BITMAP_BIT_ORDER        MSBFirst
 
253
#define GLYPHPADBYTES           4
 
254
#define GETLEFTBITS_ALIGNMENT   1
 
255
 
 
256
#define LARGE_INSTRUCTION_CACHE
 
257
#define FAST_CONSTANT_OFFSET_MODE
 
258
#define PLENTIFUL_REGISTERS
 
259
#define AVOID_MEMORY_READ
 
260
 
 
261
#define FAST_MEMCPY
 
262
#endif /* AIXV3 */
 
263
 
 
264
#if defined(ibm032) || defined (ibm)
 
265
 
 
266
#ifdef i386
 
267
# define IMAGE_BYTE_ORDER       LSBFirst        /* Value for PS/2 only */
 
268
#else
 
269
# define IMAGE_BYTE_ORDER       MSBFirst        /* Values for the RT only*/
 
270
#endif
 
271
#define BITMAP_BIT_ORDER        MSBFirst
 
272
#define GLYPHPADBYTES           1
 
273
#define GETLEFTBITS_ALIGNMENT   4
 
274
/* ibm pcc doesn't understand pragmas. */
 
275
 
 
276
#ifdef i386
 
277
#define BITMAP_SCANLINE_UNIT    8
 
278
#endif
 
279
 
 
280
#endif /* ibm */
 
281
 
 
282
#if defined (M4310) || defined(M4315) || defined(M4317) || defined(M4319) || defined(M4330)
 
283
 
 
284
#define IMAGE_BYTE_ORDER        MSBFirst        /* Values for Pegasus only */
 
285
#define BITMAP_BIT_ORDER        MSBFirst
 
286
#define GLYPHPADBYTES           4
 
287
#define GETLEFTBITS_ALIGNMENT   1
 
288
 
 
289
#define FAST_UNALIGNED_READS
 
290
 
 
291
#endif /* tektronix */
 
292
 
 
293
#ifdef macII
 
294
 
 
295
#define IMAGE_BYTE_ORDER        MSBFirst        /* Values for the MacII only */
 
296
#define BITMAP_BIT_ORDER        MSBFirst
 
297
#define GLYPHPADBYTES           4
 
298
#define GETLEFTBITS_ALIGNMENT   1
 
299
 
 
300
/* might want FAST_UNALIGNED_READS for frame buffers with < 1us latency */
 
301
 
 
302
#endif /* macII */
 
303
 
 
304
#if (defined(mips) || defined(__mips)) && !defined(sgi)
 
305
 
 
306
#if defined(MIPSEL) || defined(__MIPSEL__)
 
307
# define IMAGE_BYTE_ORDER       LSBFirst        /* Values for the PMAX only */
 
308
# define BITMAP_BIT_ORDER       LSBFirst
 
309
# define GLYPHPADBYTES          4
 
310
# define GETLEFTBITS_ALIGNMENT  1
 
311
#else
 
312
# define IMAGE_BYTE_ORDER       MSBFirst        /* Values for the MIPS only */
 
313
# define BITMAP_BIT_ORDER       MSBFirst
 
314
# define GLYPHPADBYTES          4
 
315
# define GETLEFTBITS_ALIGNMENT  1
 
316
#endif
 
317
 
 
318
#define AVOID_MEMORY_READ
 
319
#define FAST_CONSTANT_OFFSET_MODE
 
320
#define LARGE_INSTRUCTION_CACHE
 
321
#define PLENTIFUL_REGISTERS
 
322
 
 
323
#endif /* mips */
 
324
 
 
325
#if defined(__alpha) || defined(__alpha__) || defined(__alphaCross)
 
326
# define IMAGE_BYTE_ORDER       LSBFirst        /* Values for the Alpha only */
 
327
 
 
328
# if defined(XF86MONOVGA) || defined(XF86VGA16) || defined(XF86MONO)
 
329
#  define BITMAP_BIT_ORDER      MSBFirst
 
330
# else
 
331
#  define BITMAP_BIT_ORDER      LSBFirst
 
332
# endif
 
333
 
 
334
# if defined(XF86MONOVGA) || defined(XF86VGA16)
 
335
#  define BITMAP_SCANLINE_UNIT  8
 
336
# endif
 
337
 
 
338
# define GLYPHPADBYTES          4
 
339
# define GETLEFTBITS_ALIGNMENT  1
 
340
# define FAST_CONSTANT_OFFSET_MODE
 
341
# define LARGE_INSTRUCTION_CACHE
 
342
# define PLENTIFUL_REGISTERS
 
343
 
 
344
#endif /* alpha */
 
345
 
 
346
#if defined (linux) && defined (__s390__)
 
347
 
 
348
#define IMAGE_BYTE_ORDER        MSBFirst
 
349
#define BITMAP_BIT_ORDER        MSBFirst
 
350
#define GLYPHPADBYTES           4
 
351
#define GETLEFTBITS_ALIGNMENT  1        
 
352
 
 
353
#define BITMAP_SCANLINE_UNIT    8
 
354
#define LARGE_INSTRUCTION_CACHE
 
355
#define FAST_CONSTANT_OFFSET_MODE
 
356
#define FAST_UNALIGNED_READ
 
357
 
 
358
#define FAST_MEMCPY
 
359
 
 
360
#endif /* linux/s390 */
 
361
 
 
362
#if defined (linux) && defined (__s390x__)
 
363
 
 
364
#define IMAGE_BYTE_ORDER       MSBFirst
 
365
#define BITMAP_BIT_ORDER       MSBFirst
 
366
#define GLYPHPADBYTES          4
 
367
#define GETLEFTBITS_ALIGNMENT  1
 
368
 
 
369
#define BITMAP_SCANLINE_UNIT    8
 
370
#define LARGE_INSTRUCTION_CACHE
 
371
#define FAST_CONSTANT_OFFSET_MODE
 
372
#define FAST_UNALIGNED_READ
 
373
 
 
374
#define FAST_MEMCPY
 
375
#endif /* linux/s390x */
 
376
 
 
377
 
 
378
#if defined(__ia64__) || defined(ia64)
 
379
# define IMAGE_BYTE_ORDER       LSBFirst
 
380
 
 
381
# if defined(XF86MONOVGA) || defined(XF86VGA16) || defined(XF86MONO)
 
382
#  define BITMAP_BIT_ORDER      MSBFirst
 
383
# else
 
384
#  define BITMAP_BIT_ORDER      LSBFirst
 
385
# endif
 
386
 
 
387
# if defined(XF86MONOVGA) || defined(XF86VGA16)
 
388
#  define BITMAP_SCANLINE_UNIT  8
 
389
# endif
 
390
 
 
391
# define GLYPHPADBYTES          4
 
392
# define GETLEFTBITS_ALIGNMENT  1
 
393
# define FAST_CONSTANT_OFFSET_MODE
 
394
# define LARGE_INSTRUCTION_CACHE
 
395
# define PLENTIFUL_REGISTERS
 
396
 
 
397
#endif /* ia64 */
 
398
 
 
399
#if defined(__amd64__) || defined(amd64) || defined(__amd64)
 
400
# define IMAGE_BYTE_ORDER       LSBFirst
 
401
 
 
402
# if defined(XF86MONOVGA) || defined(XF86VGA16) || defined(XF86MONO)
 
403
#  define BITMAP_BIT_ORDER      MSBFirst
 
404
# else
 
405
#  define BITMAP_BIT_ORDER      LSBFirst
 
406
# endif
 
407
 
 
408
# if defined(XF86MONOVGA) || defined(XF86VGA16)
 
409
#  define BITMAP_SCANLINE_UNIT  8
 
410
# endif
 
411
 
 
412
# define GLYPHPADBYTES          4
 
413
# define GETLEFTBITS_ALIGNMENT  1
 
414
# define LARGE_INSTRUCTION_CACHE
 
415
# define FAST_CONSTANT_OFFSET_MODE
 
416
/* ???? */
 
417
# define FAST_UNALIGNED_READS
 
418
#endif /* AMD64 */
 
419
 
 
420
#ifdef stellar
 
421
 
 
422
#define IMAGE_BYTE_ORDER        MSBFirst       /* Values for the stellar only*/
 
423
#define BITMAP_BIT_ORDER        MSBFirst
 
424
#define GLYPHPADBYTES           4
 
425
#define GETLEFTBITS_ALIGNMENT   4
 
426
#define IMAGE_BUFSIZE           (64*1024)
 
427
/*
 
428
 * Use SysV random number generator.
 
429
 */
 
430
#define random rand
 
431
 
 
432
#endif /* stellar */
 
433
 
 
434
#ifdef luna
 
435
 
 
436
#define IMAGE_BYTE_ORDER        MSBFirst        /* Values for the OMRON only*/
 
437
#define BITMAP_BIT_ORDER        MSBFirst
 
438
#define GLYPHPADBYTES           4
 
439
#define GETLEFTBITS_ALIGNMENT   1
 
440
 
 
441
#ifndef mc68000
 
442
#define FAST_CONSTANT_OFFSET_MODE
 
443
#define AVOID_MEMORY_READ
 
444
#define LARGE_INSTRUCTION_CACHE
 
445
#define PLENTIFUL_REGISTERS
 
446
#endif
 
447
 
 
448
#endif /* luna */
 
449
 
 
450
#if     (defined(SVR4) && defined(i386)) || \
 
451
        defined(__alpha__) || defined(__alpha) || \
 
452
        defined(__i386__) || defined(__i386) || \
 
453
        defined(__UNIXOS2__) || \
 
454
        defined(__OS2ELF__) || \
 
455
        defined(__QNX__) || \
 
456
        defined(__s390x__) || defined(__s390__)
 
457
  
 
458
#ifndef IMAGE_BYTE_ORDER
 
459
#define IMAGE_BYTE_ORDER        LSBFirst
 
460
#endif
 
461
 
 
462
#ifndef BITMAP_BIT_ORDER
 
463
# if defined(XF86MONOVGA) || defined(XF86VGA16) || defined(XF86MONO)
 
464
#  define BITMAP_BIT_ORDER      MSBFirst
 
465
# else
 
466
#  define BITMAP_BIT_ORDER      LSBFirst
 
467
# endif
 
468
#endif
 
469
 
 
470
#ifndef BITMAP_SCANLINE_UNIT
 
471
# if defined(XF86MONOVGA) || defined(XF86VGA16)
 
472
#  define BITMAP_SCANLINE_UNIT  8
 
473
# endif
 
474
#endif
 
475
 
 
476
#ifndef GLYPHPADBYTES
 
477
#define GLYPHPADBYTES           4
 
478
#endif
 
479
 
 
480
#define GETLEFTBITS_ALIGNMENT   1
 
481
#define AVOID_MEMORY_READ
 
482
#ifdef XSVGA
 
483
#define AVOID_GLYPHBLT
 
484
#define FAST_CONSTANT_OFFSET_MODE
 
485
#define FAST_MEMCPY
 
486
#define NO_ONE_RECT
 
487
#endif
 
488
 
 
489
#endif /* SVR4 / BSD / i386 */
 
490
 
 
491
#if defined (linux) && defined (__mc68000__)
 
492
 
 
493
#define IMAGE_BYTE_ORDER       MSBFirst
 
494
#define BITMAP_BIT_ORDER       MSBFirst
 
495
#define FAST_UNALIGNED_READS
 
496
#define GLYPHPADBYTES          4
 
497
#define GETLEFTBITS_ALIGNMENT  1
 
498
 
 
499
#endif /* linux/m68k */
 
500
 
 
501
#ifdef sgi
 
502
 
 
503
#define IMAGE_BYTE_ORDER        MSBFirst
 
504
#define BITMAP_BIT_ORDER        MSBFirst
 
505
#define GLYPHPADBYTES           4
 
506
#define GETLEFTBITS_ALIGNMENT   1
 
507
#define AVOID_MEMORY_READ
 
508
#define FAST_CONSTANT_OFFSET_MODE
 
509
#define LARGE_INSTRUCTION_CACHE
 
510
#define PLENTIFUL_REGISTERS
 
511
 
 
512
#endif
 
513
 
 
514
/* linux on the Compaq Itsy */
 
515
#if defined(linux) && defined(__arm__)
 
516
#define IMAGE_BYTE_ORDER        LSBFirst
 
517
#define BITMAP_BIT_ORDER        LSBFirst
 
518
#define GLYPHPADBYTES           4
 
519
#define GETLEFTBITS_ALIGNMENT   1
 
520
#endif
 
521
 
 
522
/* size of buffer to use with GetImage, measured in bytes. There's obviously
 
523
 * a trade-off between the amount of stack (or whatever ALLOCATE_LOCAL gives
 
524
 * you) used and the number of times the ddx routine has to be called.
 
525
 */
 
526
#ifndef IMAGE_BUFSIZE
 
527
#define IMAGE_BUFSIZE           (64*1024)
 
528
#endif
 
529
 
 
530
/* pad scanline to a longword */
 
531
#ifndef BITMAP_SCANLINE_UNIT
 
532
#define BITMAP_SCANLINE_UNIT    32
 
533
#endif
 
534
 
 
535
#ifndef BITMAP_SCANLINE_PAD
 
536
#define BITMAP_SCANLINE_PAD  32
 
537
#define LOG2_BITMAP_PAD         5
 
538
#define LOG2_BYTES_PER_SCANLINE_PAD     2
 
539
#endif
 
540
 
 
541
/* 
 
542
 *   This returns the number of padding units, for depth d and width w.
 
543
 * For bitmaps this can be calculated with the macros above.
 
544
 * Other depths require either grovelling over the formats field of the
 
545
 * screenInfo or hardwired constants.
 
546
 */
 
547
 
 
548
typedef struct _PaddingInfo {
 
549
        int     padRoundUp;     /* pixels per pad unit - 1 */
 
550
        int     padPixelsLog2;  /* log 2 (pixels per pad unit) */
 
551
        int     padBytesLog2;   /* log 2 (bytes per pad unit) */
 
552
        int     notPower2;      /* bitsPerPixel not a power of 2 */
 
553
        int     bytesPerPixel;  /* only set when notPower2 is TRUE */
 
554
        int     bitsPerPixel;   /* bits per pixel */
 
555
} PaddingInfo;
 
556
extern PaddingInfo PixmapWidthPaddingInfo[];
 
557
 
 
558
/* The only portable way to get the bpp from the depth is to look it up */
 
559
#define BitsPerPixel(d) (PixmapWidthPaddingInfo[d].bitsPerPixel)
 
560
 
 
561
#define PixmapWidthInPadUnits(w, d) \
 
562
    (PixmapWidthPaddingInfo[d].notPower2 ? \
 
563
    (((int)(w) * PixmapWidthPaddingInfo[d].bytesPerPixel +  \
 
564
                 PixmapWidthPaddingInfo[d].bytesPerPixel) >> \
 
565
        PixmapWidthPaddingInfo[d].padBytesLog2) : \
 
566
    ((int)((w) + PixmapWidthPaddingInfo[d].padRoundUp) >> \
 
567
        PixmapWidthPaddingInfo[d].padPixelsLog2))
 
568
 
 
569
/*
 
570
 *      Return the number of bytes to which a scanline of the given
 
571
 * depth and width will be padded.
 
572
 */
 
573
#define PixmapBytePad(w, d) \
 
574
    (PixmapWidthInPadUnits(w, d) << PixmapWidthPaddingInfo[d].padBytesLog2)
 
575
 
 
576
#define BitmapBytePad(w) \
 
577
    (((int)((w) + BITMAP_SCANLINE_PAD - 1) >> LOG2_BITMAP_PAD) << LOG2_BYTES_PER_SCANLINE_PAD)
 
578
 
 
579
#define PixmapWidthInPadUnitsProto(w, d) PixmapWidthInPadUnits(w, d)
 
580
#define PixmapBytePadProto(w, d) PixmapBytePad(w, d)
 
581
#define BitmapBytePadProto(w) BitmapBytePad(w)
 
582
 
 
583
#endif /* SERVERMD_H */