1
/* $XFree86: xc/programs/Xserver/hw/xfree86/ramdac/xf86RamDac.h,v 1.11 2000/03/21 21:15:28 alanh Exp $ */
4
#define _XF86RAMDAC_H 1
6
#include "colormapst.h"
7
#include "xf86Cursor.h"
9
/* Define unique vendor codes for RAMDAC's */
10
#define VENDOR_IBM 0x0000
11
#define VENDOR_BT 0x0001
12
#define VENDOR_TI 0x0002
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
18
* Then we allocate 768 entries for the DAC too. IBM640 needs 1024 -FIXME
20
unsigned short DacRegs[0x400]; /* register set */
21
unsigned char DAC[0x300]; /* colour map */
23
} RamDacRegRec, *RamDacRegRecPtr;
25
typedef struct _RamDacHWRegRec {
26
RamDacRegRec SavedReg;
28
} RamDacHWRec, *RamDacHWRecPtr;
30
typedef struct _RamDacRec {
41
unsigned char (*ReadDAC)(
68
unsigned char (*ReadData)(
71
} RamDacRec, *RamDacRecPtr;
73
typedef struct _RamDacHelperRec {
78
RamDacRecPtr ramdacPtr,
79
RamDacRegRecPtr ramdacReg
84
RamDacRecPtr ramdacPtr,
85
RamDacRegRecPtr ramdacReg
90
RamDacRegRecPtr ramdacReg
94
xf86CursorInfoPtr infoPtr
96
} RamDacHelperRec, *RamDacHelperRecPtr;
98
#define RAMDACHWPTR(p) ((RamDacHWRecPtr)((p)->privates[RamDacGetHWIndex()].ptr))
100
typedef struct _RamdacScreenRec {
101
RamDacRecPtr RamDacRec;
102
} RamDacScreenRec, *RamDacScreenRecPtr;
103
#define RAMDACSCRPTR(p) ((RamDacScreenRecPtr)((p)->privates[RamDacGetScreenIndex()].ptr))->RamDacRec
105
extern int RamDacHWPrivateIndex;
106
extern int RamDacScreenPrivateIndex;
110
} RamDacSupportedInfoRec, *RamDacSupportedInfoRecPtr;
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,
121
void RamDacFreeRec(ScrnInfoPtr pScrn);
122
int RamDacGetHWIndex(void);
124
#endif /* _XF86RAMDAC_H */