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