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) (ScrnInfoPtr pScrn,
|
---|
33 | int numColors,
|
---|
34 | int *indices, LOCO * colors, VisualPtr pVisual);
|
---|
35 |
|
---|
36 | unsigned char (*ReadDAC) (ScrnInfoPtr pScrn, CARD32);
|
---|
37 |
|
---|
38 | void (*WriteDAC) (ScrnInfoPtr pScrn, CARD32, unsigned char, unsigned char);
|
---|
39 |
|
---|
40 | void (*WriteAddress) (ScrnInfoPtr pScrn, CARD32);
|
---|
41 |
|
---|
42 | void (*WriteData) (ScrnInfoPtr pScrn, unsigned char);
|
---|
43 |
|
---|
44 | void (*ReadAddress) (ScrnInfoPtr pScrn, CARD32);
|
---|
45 |
|
---|
46 | unsigned char (*ReadData) (ScrnInfoPtr pScrn);
|
---|
47 | } RamDacRec, *RamDacRecPtr;
|
---|
48 |
|
---|
49 | typedef struct _RamDacHelperRec {
|
---|
50 | CARD32 RamDacType;
|
---|
51 |
|
---|
52 | void (*Restore) (ScrnInfoPtr pScrn,
|
---|
53 | RamDacRecPtr ramdacPtr, RamDacRegRecPtr ramdacReg);
|
---|
54 |
|
---|
55 | void (*Save) (ScrnInfoPtr pScrn,
|
---|
56 | RamDacRecPtr ramdacPtr, RamDacRegRecPtr ramdacReg);
|
---|
57 |
|
---|
58 | void (*SetBpp) (ScrnInfoPtr pScrn, RamDacRegRecPtr ramdacReg);
|
---|
59 |
|
---|
60 | void (*HWCursorInit) (xf86CursorInfoPtr infoPtr);
|
---|
61 | } RamDacHelperRec, *RamDacHelperRecPtr;
|
---|
62 |
|
---|
63 | #define RAMDACHWPTR(p) ((RamDacHWRecPtr)((p)->privates[RamDacGetHWIndex()].ptr))
|
---|
64 |
|
---|
65 | typedef struct _RamdacScreenRec {
|
---|
66 | RamDacRecPtr RamDacRec;
|
---|
67 | } RamDacScreenRec, *RamDacScreenRecPtr;
|
---|
68 |
|
---|
69 | #define RAMDACSCRPTR(p) ((RamDacScreenRecPtr)((p)->privates[RamDacGetScreenIndex()].ptr))->RamDacRec
|
---|
70 |
|
---|
71 | extern _X_EXPORT int RamDacHWPrivateIndex;
|
---|
72 | extern _X_EXPORT int RamDacScreenPrivateIndex;
|
---|
73 |
|
---|
74 | typedef struct {
|
---|
75 | int token;
|
---|
76 | } RamDacSupportedInfoRec, *RamDacSupportedInfoRecPtr;
|
---|
77 |
|
---|
78 | extern _X_EXPORT RamDacRecPtr RamDacCreateInfoRec(void);
|
---|
79 | extern _X_EXPORT RamDacHelperRecPtr RamDacHelperCreateInfoRec(void);
|
---|
80 | extern _X_EXPORT void RamDacDestroyInfoRec(RamDacRecPtr RamDacRec);
|
---|
81 | extern _X_EXPORT void RamDacHelperDestroyInfoRec(RamDacHelperRecPtr RamDacRec);
|
---|
82 | extern _X_EXPORT Bool RamDacInit(ScrnInfoPtr pScrn, RamDacRecPtr RamDacRec);
|
---|
83 | extern _X_EXPORT Bool RamDacHandleColormaps(ScreenPtr pScreen, int maxColors,
|
---|
84 | int sigRGBbits, unsigned int flags);
|
---|
85 | extern _X_EXPORT void RamDacFreeRec(ScrnInfoPtr pScrn);
|
---|
86 | extern _X_EXPORT int RamDacGetHWIndex(void);
|
---|
87 |
|
---|
88 | #endif /* _XF86RAMDAC_H */
|
---|