VirtualBox

source: vbox/trunk/src/VBox/Additions/x11/x11include/xorg-server-1.5.3/xf86RamDac.h@ 99743

Last change on this file since 99743 was 17471, checked in by vboxsync, 16 years ago

export to OSE

  • Property svn:eol-style set to native
File size: 2.8 KB
Line 
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
13typedef 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
24typedef struct _RamDacHWRegRec {
25 RamDacRegRec SavedReg;
26 RamDacRegRec ModeReg;
27} RamDacHWRec, *RamDacHWRecPtr;
28
29typedef 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
72typedef 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
99typedef struct _RamdacScreenRec {
100 RamDacRecPtr RamDacRec;
101} RamDacScreenRec, *RamDacScreenRecPtr;
102#define RAMDACSCRPTR(p) ((RamDacScreenRecPtr)((p)->privates[RamDacGetScreenIndex()].ptr))->RamDacRec
103
104extern int RamDacHWPrivateIndex;
105extern int RamDacScreenPrivateIndex;
106
107typedef struct {
108 int token;
109} RamDacSupportedInfoRec, *RamDacSupportedInfoRecPtr;
110
111RamDacRecPtr RamDacCreateInfoRec(void);
112RamDacHelperRecPtr RamDacHelperCreateInfoRec(void);
113void RamDacDestroyInfoRec(RamDacRecPtr RamDacRec);
114void RamDacHelperDestroyInfoRec(RamDacHelperRecPtr RamDacRec);
115Bool RamDacInit(ScrnInfoPtr pScrn, RamDacRecPtr RamDacRec);
116void RamDacSetGamma(ScrnInfoPtr pScrn, Bool Real8BitDac);
117void RamDacRestoreDACValues(ScrnInfoPtr pScrn);
118Bool RamDacHandleColormaps(ScreenPtr pScreen, int maxColors, int sigRGBbits,
119 unsigned int flags);
120void RamDacFreeRec(ScrnInfoPtr pScrn);
121int RamDacGetHWIndex(void);
122
123#endif /* _XF86RAMDAC_H */
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette