VirtualBox

source: vbox/trunk/src/VBox/Additions/x11/x11include/1.5/xorg/servermd.h@ 9233

Last change on this file since 9233 was 9233, checked in by vboxsync, 17 years ago

Additions/x11: added header files for X.org server 1.5

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

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette