Hint added.
[AROS.git] / workbench / hidds / nouveau / xf86-video-nouveau / nv_include.h
blob2cff4c7f4f3029d4f02a31f0f47513631f6104a3
1 #ifndef __NV_INCLUDE_H__
2 #define __NV_INCLUDE_H__
3 /*
4 Copyright © 2011, The AROS Development Team. All rights reserved.
5 $Id$
6 */
8 #include "nouveau_intern.h"
9 #include "nouveau_class.h"
11 #include "nouveau_local.h"
13 /* Some overriding defines for AROS */
14 #define Bool BOOL
15 #define ScrnInfoPtr struct CardData *
16 #define NVPTR(x) x
17 #define NVPtr struct CardData *
18 #define Architecture architecture
19 #define PixmapPtr struct HIDDNouveauBitMapData *
20 #define xf86DrvMsg(a, b, fmt, ...) bug(fmt, ##__VA_ARGS__)
21 #define ErrorF(msg, ...) bug(msg, ##__VA_ARGS__)
22 #define PictFormatShort LONG
23 #define PictTransformPtr APTR
24 #define Pixel HIDDT_Pixel
25 #define CARD32 LONG
27 struct Picture
29 LONG format;
30 BOOL componentAlpha;
31 LONG filter;
32 BOOL repeat;
33 LONG repeatType;
36 typedef struct Picture * PicturePtr;
38 /* This construction is implemented so that original EXA funtion calls don't
39 have to be extended with ScrnInfoPtr parameter which makes code harder to
40 maintain */
41 extern struct CardData * globalcarddataptr;
43 #define PictFilterNearest 1
44 #define PictFilterBilinear 2
46 #define RepeatNone 0 /* This must be zero/FALSE, see nv10_exa for usage against ppict->repeat which is BOOL */
47 #define RepeatNormal 1
48 #define RepeatReflect 2
49 #define RepeatPad 3
51 #define PICT_UNKNOWN 0
52 #define PICT_a8r8g8b8 1
53 #define PICT_x8r8g8b8 2
54 #define PICT_a8b8g8r8 3
55 #define PICT_x8b8g8r8 4
56 #define PICT_b8g8r8a8 5
57 #define PICT_b8g8r8x8 6
58 #define PICT_a2b10g10r10 7
59 #define PICT_x2b10g10r10 8
60 #define PICT_a2r10g10b10 9
61 #define PICT_x2r10g10b10 10
62 #define PICT_a1r5g5b5 11
63 #define PICT_x1r5g5b5 12
64 #define PICT_a1b5g5r5 13
65 #define PICT_x1b5g5r5 14
66 #define PICT_x4r4g4b4 15
67 #define PICT_a4r4g4b4 16
68 #define PICT_x4b4g4r4 17
69 #define PICT_a4b4g4r4 18
70 #define PICT_r5g6b5 19
71 #define PICT_b5g6r5 20
72 #define PICT_a8 21
75 #define nouveau_pixmap_bo(x) (x->bo)
76 #define exaGetPixmapPitch(x) (x->pitch)
78 #define PictOpSaturate 14
80 Bool NVAccelInitNV50TCL(ScrnInfoPtr pScrn);
81 Bool NVAccelInitNV40TCL(ScrnInfoPtr pScrn);
82 Bool NVAccelInitNV30TCL(ScrnInfoPtr pScrn);
83 Bool NVAccelInitNV10TCL(ScrnInfoPtr pScrn);
84 Bool NVAccelInitM2MF_NVC0(ScrnInfoPtr pScrn);
85 Bool NVAccelInit2D_NVC0(ScrnInfoPtr pScrn);
86 Bool NVAccelInit3D_NVC0(ScrnInfoPtr pScrn);
87 Bool nv50_style_tiled_pixmap(PixmapPtr ppix);
90 static inline BOOL PICT_FORMAT_A(int format)
92 switch(format)
94 case(PICT_a8r8g8b8):
95 case(PICT_a8b8g8r8):
96 case(PICT_b8g8r8a8):
97 case(PICT_a2b10g10r10):
98 case(PICT_a2r10g10b10):
99 case(PICT_a1r5g5b5):
100 case(PICT_a1b5g5r5):
101 case(PICT_a4r4g4b4):
102 case(PICT_a4b4g4r4):
103 case(PICT_a8):
104 return TRUE;
107 return FALSE;
110 static inline BOOL PICT_FORMAT_RGB(int format)
112 switch(format)
114 case(PICT_a8r8g8b8):
115 case(PICT_x8r8g8b8):
116 case(PICT_x8b8g8r8):
117 case(PICT_a8b8g8r8):
118 case(PICT_b8g8r8a8):
119 case(PICT_b8g8r8x8):
120 case(PICT_a2b10g10r10):
121 case(PICT_x2b10g10r10):
122 case(PICT_a2r10g10b10):
123 case(PICT_x2r10g10b10):
124 case(PICT_a1r5g5b5):
125 case(PICT_x1r5g5b5):
126 case(PICT_a1b5g5r5):
127 case(PICT_x1b5g5r5):
128 case(PICT_x4r4g4b4):
129 case(PICT_a4r4g4b4):
130 case(PICT_x4b4g4r4):
131 case(PICT_a4b4g4r4):
132 case(PICT_r5g6b5):
133 case(PICT_b5g6r5):
134 return TRUE;
137 return FALSE;
141 static inline VOID HIDDNouveauFillPictureFromBitMapData(struct Picture * pPict,
142 struct HIDDNouveauBitMapData * bmdata)
144 /* pPict->format */
145 if (bmdata->depth == 32)
146 pPict->format = PICT_a8r8g8b8;
147 else if (bmdata->depth == 24)
148 pPict->format = PICT_x8r8g8b8;
149 else if (bmdata->depth == 16)
150 pPict->format = PICT_r5g6b5;
151 else
152 pPict->format = PICT_UNKNOWN;
154 /* pPict->componentAlpha - keep this always as FALSE, used when mask
155 bitmap would be present (which is not the case in AROS */
156 pPict->componentAlpha = FALSE;
158 /* pPict->filter - keep this always as PictFilterNearest, unless you want
159 bi-linear (probably slower and might give weird effects */
160 pPict->filter = PictFilterNearest;
162 /* pPict->repeat - keep this always as FALSE */
163 pPict->repeat = FALSE;
164 /* pPict->repeatType - value does not matter as long as repeat is FALSE */
165 pPict->repeatType = RepeatNone;
168 #endif /* __NV_INCLUDE_H__ */