VirtualBox

source: vbox/trunk/src/VBox/Additions/x11/x11include/xorg-server-1.16.0/servermd.h@ 64670

Last change on this file since 64670 was 52145, checked in by vboxsync, 10 years ago

Additions/x11/x11include: add header files for X.Org Server 1.16.

  • Property svn:eol-style set to native
File size: 11.8 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
25Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
26
27 All Rights Reserved
28
29Permission to use, copy, modify, and distribute this software and its
30documentation for any purpose and without fee is hereby granted,
31provided that the above copyright notice appear in all copies and that
32both that copyright notice and this permission notice appear in
33supporting documentation, and that the name of Digital not be
34used in advertising or publicity pertaining to distribution of the
35software without specific, written prior permission.
36
37DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
38ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
39DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
40ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
41WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
42ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
43SOFTWARE.
44
45******************************************************************/
46
47#ifndef SERVERMD_H
48#define SERVERMD_H 1
49
50/*
51 * Note: much of this is vestigial from mfb/cfb times. This should
52 * really be simplified even further.
53 */
54
55/*
56 * Machine dependent values:
57 * GLYPHPADBYTES should be chosen with consideration for the space-time
58 * trade-off. Padding to 0 bytes means that there is no wasted space
59 * in the font bitmaps (both on disk and in memory), but that access of
60 * the bitmaps will cause odd-address memory references. Padding to
61 * 2 bytes would ensure even address memory references and would
62 * be suitable for a 68010-class machine, but at the expense of wasted
63 * space in the font bitmaps. Padding to 4 bytes would be good
64 * for real 32 bit machines, etc. Be sure that you tell the font
65 * compiler what kind of padding you want because its defines are
66 * kept separate from this. See server/include/font.h for how
67 * GLYPHPADBYTES is used.
68 */
69
70#ifdef __avr32__
71
72#define IMAGE_BYTE_ORDER MSBFirst
73#define BITMAP_BIT_ORDER MSBFirst
74#define GLYPHPADBYTES 4
75
76#endif /* __avr32__ */
77
78#ifdef __arm32__
79
80#define IMAGE_BYTE_ORDER LSBFirst
81#define BITMAP_BIT_ORDER LSBFirst
82#define GLYPHPADBYTES 4
83
84#endif /* __arm32__ */
85
86#if defined(__nds32__)
87
88#define IMAGE_BYTE_ORDER LSBFirst
89
90#if defined(XF86MONOVGA) || defined(XF86VGA16) || defined(XF86MONO)
91#define BITMAP_BIT_ORDER MSBFirst
92#else
93#define BITMAP_BIT_ORDER LSBFirst
94#endif
95
96#if defined(XF86MONOVGA) || defined(XF86VGA16)
97#define BITMAP_SCANLINE_UNIT 8
98#endif
99
100#define GLYPHPADBYTES 4
101#define GETLEFTBITS_ALIGNMENT 1
102#define LARGE_INSTRUCTION_CACHE
103#define AVOID_MEMORY_READ
104
105#endif /* __nds32__ */
106
107#if defined __hppa__
108
109#define IMAGE_BYTE_ORDER MSBFirst
110#define BITMAP_BIT_ORDER MSBFirst
111#define GLYPHPADBYTES 4 /* to make fb work */
112 /* byte boundries */
113#endif /* hpux || __hppa__ */
114
115#if defined(__powerpc__) || defined(__ppc__) || defined(__ppc64__)
116
117#if defined(__LITTLE_ENDIAN__)
118#define IMAGE_BYTE_ORDER LSBFirst
119#define BITMAP_BIT_ORDER LSBFirst
120#else
121#define IMAGE_BYTE_ORDER MSBFirst
122#define BITMAP_BIT_ORDER MSBFirst
123#endif
124#define GLYPHPADBYTES 4
125
126#endif /* PowerPC */
127
128#if defined(__sh__)
129
130#if defined(__BIG_ENDIAN__)
131#define IMAGE_BYTE_ORDER MSBFirst
132#define BITMAP_BIT_ORDER MSBFirst
133#define GLYPHPADBYTES 4
134#else
135#define IMAGE_BYTE_ORDER LSBFirst
136#define BITMAP_BIT_ORDER LSBFirst
137#define GLYPHPADBYTES 4
138#endif
139
140#endif /* SuperH */
141
142#if defined(__m32r__)
143
144#if defined(__BIG_ENDIAN__)
145#define IMAGE_BYTE_ORDER MSBFirst
146#define BITMAP_BIT_ORDER MSBFirst
147#define GLYPHPADBYTES 4
148#else
149#define IMAGE_BYTE_ORDER LSBFirst
150#define BITMAP_BIT_ORDER LSBFirst
151#define GLYPHPADBYTES 4
152#endif
153
154#endif /* __m32r__ */
155
156#if (defined(sun) && (defined(__sparc) || defined(sparc))) || \
157 (defined(__uxp__) && (defined(sparc) || defined(mc68000))) || \
158 defined(__sparc__) || defined(__mc68000__)
159
160#if defined(__sparc) || defined(__sparc__)
161#if !defined(sparc)
162#define sparc 1
163#endif
164#endif
165
166#if defined(sun386) || defined(sun5)
167#define IMAGE_BYTE_ORDER LSBFirst /* Values for the SUN only */
168#define BITMAP_BIT_ORDER LSBFirst
169#else
170#define IMAGE_BYTE_ORDER MSBFirst /* Values for the SUN only */
171#define BITMAP_BIT_ORDER MSBFirst
172#endif
173
174#define GLYPHPADBYTES 4
175
176#endif /* sun && !(i386 && SVR4) */
177
178#if defined(ibm032) || defined (ibm)
179
180#ifdef __i386__
181#define IMAGE_BYTE_ORDER LSBFirst /* Value for PS/2 only */
182#else
183#define IMAGE_BYTE_ORDER MSBFirst /* Values for the RT only */
184#endif
185#define BITMAP_BIT_ORDER MSBFirst
186#define GLYPHPADBYTES 1
187/* ibm pcc doesn't understand pragmas. */
188
189#ifdef __i386__
190#define BITMAP_SCANLINE_UNIT 8
191#endif
192
193#endif /* ibm */
194
195#if (defined(mips) || defined(__mips))
196
197#if defined(MIPSEL) || defined(__MIPSEL__)
198#define IMAGE_BYTE_ORDER LSBFirst /* Values for the PMAX only */
199#define BITMAP_BIT_ORDER LSBFirst
200#define GLYPHPADBYTES 4
201#else
202#define IMAGE_BYTE_ORDER MSBFirst /* Values for the MIPS only */
203#define BITMAP_BIT_ORDER MSBFirst
204#define GLYPHPADBYTES 4
205#endif
206
207#endif /* mips */
208
209#if defined(__alpha) || defined(__alpha__)
210#define IMAGE_BYTE_ORDER LSBFirst /* Values for the Alpha only */
211#define BITMAP_BIT_ORDER LSBFirst
212#define GLYPHPADBYTES 4
213
214#endif /* alpha */
215
216#if defined (linux) && defined (__s390__)
217
218#define IMAGE_BYTE_ORDER MSBFirst
219#define BITMAP_BIT_ORDER MSBFirst
220#define GLYPHPADBYTES 4
221
222#define BITMAP_SCANLINE_UNIT 8
223#define FAST_UNALIGNED_READ
224
225#endif /* linux/s390 */
226
227#if defined (linux) && defined (__s390x__)
228
229#define IMAGE_BYTE_ORDER MSBFirst
230#define BITMAP_BIT_ORDER MSBFirst
231#define GLYPHPADBYTES 4
232
233#define BITMAP_SCANLINE_UNIT 8
234#define FAST_UNALIGNED_READ
235
236#endif /* linux/s390x */
237
238#if defined(__ia64__) || defined(ia64)
239
240#define IMAGE_BYTE_ORDER LSBFirst
241#define BITMAP_BIT_ORDER LSBFirst
242#define GLYPHPADBYTES 4
243
244#endif /* ia64 */
245
246#if defined(__amd64__) || defined(amd64) || defined(__amd64)
247#define IMAGE_BYTE_ORDER LSBFirst
248#define BITMAP_BIT_ORDER LSBFirst
249#define GLYPHPADBYTES 4
250/* ???? */
251#endif /* AMD64 */
252
253#if defined(SVR4) && (defined(__i386__) || defined(__i386) ) || \
254 defined(__alpha__) || defined(__alpha) || \
255 defined(__i386__) || \
256 defined(__s390x__) || defined(__s390__)
257
258#ifndef IMAGE_BYTE_ORDER
259#define IMAGE_BYTE_ORDER LSBFirst
260#endif
261
262#ifndef BITMAP_BIT_ORDER
263#define BITMAP_BIT_ORDER LSBFirst
264#endif
265
266#ifndef GLYPHPADBYTES
267#define GLYPHPADBYTES 4
268#endif
269
270#endif /* SVR4 / BSD / i386 */
271
272#if defined (linux) && defined (__mc68000__)
273
274#define IMAGE_BYTE_ORDER MSBFirst
275#define BITMAP_BIT_ORDER MSBFirst
276#define GLYPHPADBYTES 4
277
278#endif /* linux/m68k */
279
280/* linux on ARM */
281#if defined(linux) && defined(__arm__)
282#define IMAGE_BYTE_ORDER LSBFirst
283#define BITMAP_BIT_ORDER LSBFirst
284#define GLYPHPADBYTES 4
285#endif
286
287/* linux on IBM S/390 */
288#if defined (linux) && defined (__s390__)
289#define IMAGE_BYTE_ORDER MSBFirst
290#define BITMAP_BIT_ORDER MSBFirst
291#define GLYPHPADBYTES 4
292#endif /* linux/s390 */
293
294#ifdef __aarch64__
295
296#ifdef __AARCH64EL__
297#define IMAGE_BYTE_ORDER LSBFirst
298#define BITMAP_BIT_ORDER LSBFirst
299#endif
300#ifdef __AARCH64EB__
301#define IMAGE_BYTE_ORDER MSBFirst
302#define BITMAP_BIT_ORDER MSBFirst
303#endif
304#define GLYPHPADBYTES 4
305
306#endif /* __aarch64__ */
307
308#if defined(__arc__)
309
310#if defined(__BIG_ENDIAN__)
311#define IMAGE_BYTE_ORDER MSBFirst
312#define BITMAP_BIT_ORDER MSBFirst
313#else
314#define IMAGE_BYTE_ORDER LSBFirst
315#define BITMAP_BIT_ORDER LSBFirst
316#endif
317#define GLYPHPADBYTES 4
318
319#endif /* ARC */
320
321#ifdef __xtensa__
322
323#ifdef __XTENSA_EL__
324#define IMAGE_BYTE_ORDER LSBFirst
325#define BITMAP_BIT_ORDER LSBFirst
326#endif
327#ifdef __XTENSA_EB__
328#define IMAGE_BYTE_ORDER MSBFirst
329#define BITMAP_BIT_ORDER MSBFirst
330#endif
331#define GLYPHPADBYTES 4
332
333#endif /* __xtensa__ */
334
335/* size of buffer to use with GetImage, measured in bytes. There's obviously
336 * a trade-off between the amount of heap used and the number of times the
337 * ddx routine has to be called.
338 */
339#ifndef IMAGE_BUFSIZE
340#define IMAGE_BUFSIZE (64*1024)
341#endif
342
343/* pad scanline to a longword */
344#ifndef BITMAP_SCANLINE_UNIT
345#define BITMAP_SCANLINE_UNIT 32
346#endif
347
348#ifndef BITMAP_SCANLINE_PAD
349#define BITMAP_SCANLINE_PAD 32
350#define LOG2_BITMAP_PAD 5
351#define LOG2_BYTES_PER_SCANLINE_PAD 2
352#endif
353
354#include <X11/Xfuncproto.h>
355/*
356 * This returns the number of padding units, for depth d and width w.
357 * For bitmaps this can be calculated with the macros above.
358 * Other depths require either grovelling over the formats field of the
359 * screenInfo or hardwired constants.
360 */
361
362typedef struct _PaddingInfo {
363 int padRoundUp; /* pixels per pad unit - 1 */
364 int padPixelsLog2; /* log 2 (pixels per pad unit) */
365 int padBytesLog2; /* log 2 (bytes per pad unit) */
366 int notPower2; /* bitsPerPixel not a power of 2 */
367 int bytesPerPixel; /* only set when notPower2 is TRUE */
368 int bitsPerPixel; /* bits per pixel */
369} PaddingInfo;
370extern _X_EXPORT PaddingInfo PixmapWidthPaddingInfo[];
371
372/* The only portable way to get the bpp from the depth is to look it up */
373#define BitsPerPixel(d) (PixmapWidthPaddingInfo[d].bitsPerPixel)
374
375#define PixmapWidthInPadUnits(w, d) \
376 (PixmapWidthPaddingInfo[d].notPower2 ? \
377 (((int)(w) * PixmapWidthPaddingInfo[d].bytesPerPixel + \
378 PixmapWidthPaddingInfo[d].bytesPerPixel) >> \
379 PixmapWidthPaddingInfo[d].padBytesLog2) : \
380 ((int)((w) + PixmapWidthPaddingInfo[d].padRoundUp) >> \
381 PixmapWidthPaddingInfo[d].padPixelsLog2))
382
383/*
384 * Return the number of bytes to which a scanline of the given
385 * depth and width will be padded.
386 */
387#define PixmapBytePad(w, d) \
388 (PixmapWidthInPadUnits(w, d) << PixmapWidthPaddingInfo[d].padBytesLog2)
389
390#define BitmapBytePad(w) \
391 (((int)((w) + BITMAP_SCANLINE_PAD - 1) >> LOG2_BITMAP_PAD) << LOG2_BYTES_PER_SCANLINE_PAD)
392
393#define PixmapWidthInPadUnitsProto(w, d) PixmapWidthInPadUnits(w, d)
394#define PixmapBytePadProto(w, d) PixmapBytePad(w, d)
395#define BitmapBytePadProto(w) BitmapBytePad(w)
396
397#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