1 |
|
---|
2 | #ifndef _XF86RAMDAC_H
|
---|
3 | #define _XF86RAMDAC_H 1
|
---|
4 |
|
---|
5 | #include "colormapst.h"
|
---|
6 | #include "xf86Cursor.h"
|
---|
7 |
|
---|
8 | /* Define unique vendor codes for RAMDAC's */
|
---|
9 | #define VENDOR_IBM 0x0000
|
---|
10 | #define VENDOR_BT 0x0001
|
---|
11 | #define VENDOR_TI 0x0002
|
---|
12 |
|
---|
13 | typedef struct _RamDacRegRec {
|
---|
14 | /* This is probably the nastiest assumption, we allocate 1024 slots for
|
---|
15 | * ramdac registers, should be enough. I've checked IBM and TVP series
|
---|
16 | * and they seem o.k
|
---|
17 | * Then we allocate 768 entries for the DAC too. IBM640 needs 1024 -FIXME
|
---|
18 | */
|
---|
19 | unsigned short DacRegs[0x400]; /* register set */
|
---|
20 | unsigned char DAC[0x300]; /* colour map */
|
---|
21 | Bool Overlay;
|
---|
22 | } RamDacRegRec, *RamDacRegRecPtr;
|
---|
23 |
|
---|
24 | typedef struct _RamDacHWRegRec {
|
---|
25 | RamDacRegRec SavedReg;
|
---|
26 | RamDacRegRec ModeReg;
|
---|
27 | } RamDacHWRec, *RamDacHWRecPtr;
|
---|
28 |
|
---|
29 | typedef struct _RamDacRec {
|
---|
30 | CARD32 RamDacType;
|
---|
31 |
|
---|
32 | void (*LoadPalette)(
|
---|
33 | ScrnInfoPtr pScrn,
|
---|
34 | int numColors,
|
---|
35 | int *indices,
|
---|
36 | LOCO *colors,
|
---|
37 | VisualPtr pVisual
|
---|
38 | );
|
---|
39 |
|
---|
40 | unsigned char (*ReadDAC)(
|
---|
41 | ScrnInfoPtr pScrn,
|
---|
42 | CARD32
|
---|
43 | );
|
---|
44 |
|
---|
45 | void (*WriteDAC)(
|
---|
46 | ScrnInfoPtr pScrn,
|
---|
47 | CARD32,
|
---|
48 | unsigned char,
|
---|
49 | unsigned char
|
---|
50 | );
|
---|
51 |
|
---|
52 | void (*WriteAddress)(
|
---|
53 | ScrnInfoPtr pScrn,
|
---|
54 | CARD32
|
---|
55 | );
|
---|
56 |
|
---|
57 | void (*WriteData)(
|
---|
58 | ScrnInfoPtr pScrn,
|
---|
59 | unsigned char
|
---|
60 | );
|
---|
61 |
|
---|
62 | void (*ReadAddress)(
|
---|
63 | ScrnInfoPtr pScrn,
|
---|
64 | CARD32
|
---|
65 | );
|
---|
66 |
|
---|
67 | unsigned char (*ReadData)(
|
---|
68 | ScrnInfoPtr pScrn
|
---|
69 | );
|
---|
70 | } RamDacRec, *RamDacRecPtr;
|
---|
71 |
|
---|
72 | typedef struct _RamDacHelperRec {
|
---|
73 | CARD32 RamDacType;
|
---|
74 |
|
---|
75 | void (*Restore)(
|
---|
76 | ScrnInfoPtr pScrn,
|
---|
77 | RamDacRecPtr ramdacPtr,
|
---|
78 | RamDacRegRecPtr ramdacReg
|
---|
79 | );
|
---|
80 |
|
---|
81 | void (*Save)(
|
---|
82 | ScrnInfoPtr pScrn,
|
---|
83 | RamDacRecPtr ramdacPtr,
|
---|
84 | RamDacRegRecPtr ramdacReg
|
---|
85 | );
|
---|
86 |
|
---|
87 | void (*SetBpp)(
|
---|
88 | ScrnInfoPtr pScrn,
|
---|
89 | RamDacRegRecPtr ramdacReg
|
---|
90 | );
|
---|
91 |
|
---|
92 | void (*HWCursorInit)(
|
---|
93 | xf86CursorInfoPtr infoPtr
|
---|
94 | );
|
---|
95 | } RamDacHelperRec, *RamDacHelperRecPtr;
|
---|
96 |
|
---|
97 | #define RAMDACHWPTR(p) ((RamDacHWRecPtr)((p)->privates[RamDacGetHWIndex()].ptr))
|
---|
98 |
|
---|
99 | typedef struct _RamdacScreenRec {
|
---|
100 | RamDacRecPtr RamDacRec;
|
---|
101 | } RamDacScreenRec, *RamDacScreenRecPtr;
|
---|
102 | #define RAMDACSCRPTR(p) ((RamDacScreenRecPtr)((p)->privates[RamDacGetScreenIndex()].ptr))->RamDacRec
|
---|
103 |
|
---|
104 | extern int RamDacHWPrivateIndex;
|
---|
105 | extern int RamDacScreenPrivateIndex;
|
---|
106 |
|
---|
107 | typedef struct {
|
---|
108 | int token;
|
---|
109 | } RamDacSupportedInfoRec, *RamDacSupportedInfoRecPtr;
|
---|
110 |
|
---|
111 | RamDacRecPtr RamDacCreateInfoRec(void);
|
---|
112 | RamDacHelperRecPtr RamDacHelperCreateInfoRec(void);
|
---|
113 | void RamDacDestroyInfoRec(RamDacRecPtr RamDacRec);
|
---|
114 | void RamDacHelperDestroyInfoRec(RamDacHelperRecPtr RamDacRec);
|
---|
115 | Bool RamDacInit(ScrnInfoPtr pScrn, RamDacRecPtr RamDacRec);
|
---|
116 | void RamDacSetGamma(ScrnInfoPtr pScrn, Bool Real8BitDac);
|
---|
117 | void RamDacRestoreDACValues(ScrnInfoPtr pScrn);
|
---|
118 | Bool RamDacHandleColormaps(ScreenPtr pScreen, int maxColors, int sigRGBbits,
|
---|
119 | unsigned int flags);
|
---|
120 | void RamDacFreeRec(ScrnInfoPtr pScrn);
|
---|
121 | int RamDacGetHWIndex(void);
|
---|
122 |
|
---|
123 | #endif /* _XF86RAMDAC_H */
|
---|