1 #ifndef __NV_INCLUDE_H__
2 #define __NV_INCLUDE_H__
4 Copyright © 2011, The AROS Development Team. All rights reserved.
8 #include "nouveau_intern.h"
9 #include "nouveau_class.h"
11 #include "nouveau_local.h"
13 /* Some overriding defines for AROS */
15 #define ScrnInfoPtr struct CardData *
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
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
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
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
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
)
97 case(PICT_a2b10g10r10
):
98 case(PICT_a2r10g10b10
):
110 static inline BOOL
PICT_FORMAT_RGB(int format
)
120 case(PICT_a2b10g10r10
):
121 case(PICT_x2b10g10r10
):
122 case(PICT_a2r10g10b10
):
123 case(PICT_x2r10g10b10
):
141 static inline VOID
HIDDNouveauFillPictureFromBitMapData(struct Picture
* pPict
,
142 struct HIDDNouveauBitMapData
* bmdata
)
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
;
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__ */