3 #define _XF86RAMDAC_H 1
5 #include "colormapst.h"
6 #include "xf86Cursor.h"
8 /* Define unique vendor codes for RAMDAC's */
9 #define VENDOR_IBM 0x0000
10 #define VENDOR_BT 0x0001
11 #define VENDOR_TI 0x0002
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
17 * Then we allocate 768 entries for the DAC too. IBM640 needs 1024 -FIXME
19 unsigned short DacRegs
[0x400]; /* register set */
20 unsigned char DAC
[0x300]; /* colour map */
22 } RamDacRegRec
, *RamDacRegRecPtr
;
24 typedef struct _RamDacHWRegRec
{
25 RamDacRegRec SavedReg
;
27 } RamDacHWRec
, *RamDacHWRecPtr
;
29 typedef struct _RamDacRec
{
40 unsigned char (*ReadDAC
)(
67 unsigned char (*ReadData
)(
70 } RamDacRec
, *RamDacRecPtr
;
72 typedef struct _RamDacHelperRec
{
77 RamDacRecPtr ramdacPtr
,
78 RamDacRegRecPtr ramdacReg
83 RamDacRecPtr ramdacPtr
,
84 RamDacRegRecPtr ramdacReg
89 RamDacRegRecPtr ramdacReg
93 xf86CursorInfoPtr infoPtr
95 } RamDacHelperRec
, *RamDacHelperRecPtr
;
97 #define RAMDACHWPTR(p) ((RamDacHWRecPtr)((p)->privates[RamDacGetHWIndex()].ptr))
99 typedef struct _RamdacScreenRec
{
100 RamDacRecPtr RamDacRec
;
101 } RamDacScreenRec
, *RamDacScreenRecPtr
;
102 #define RAMDACSCRPTR(p) ((RamDacScreenRecPtr)((p)->privates[RamDacGetScreenIndex()].ptr))->RamDacRec
104 extern int RamDacHWPrivateIndex
;
105 extern int RamDacScreenPrivateIndex
;
109 } RamDacSupportedInfoRec
, *RamDacSupportedInfoRecPtr
;
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
,
120 void RamDacFreeRec(ScrnInfoPtr pScrn
);
121 int RamDacGetHWIndex(void);
123 #endif /* _XF86RAMDAC_H */