1 /*
2  * Common strutures and function for CL-GD546x -- The Laguna family
3  *
4  * lg.h
5  *
6  * (c) 1998 Corin Anderson.
7  *          corina@the4cs.com
8  *          Tukwila, WA
9  *
10  *  Inspired by cir.h
11  */
12 
13 #ifndef LG_H
14 #define LG_H
15 #define LG_DEBUG
16 
17 extern ScrnInfoPtr LgProbe(int entity);
18 extern const OptionInfoRec *	LgAvailableOptions(int chipid);
19 
20 # ifdef _LG_PRIVATE_
21 
22 /* Saved registers that are not part of the core VGA */
23 /* CRTC >= 0x19; Sequencer >= 0x05; Graphics >= 0x09; Attribute >= 0x15 */
24 	/* CR regs */
25 enum {
26 	/* CR regs */
27 	CR1A,
28 	CR1B,
29 	CR1D,
30 	CR1E,
31 	/* SR regs */
32 	SR07,
33 	SR0E,
34 	SR12,
35 	SR13,
36 	SR1E,
37 	/* Must be last! */
38 	LG_LAST_REG
39 };
40 
41 #undef FORMAT
42 
43 typedef struct {
44 	unsigned char ExtVga[LG_LAST_REG];
45 
46 	/* Laguna regs */
47 	CARD8 TILE, BCLK;
48 	CARD16 FORMAT, DTTC, TileCtrl, CONTROL;
49 	CARD32 VSC;
50 } LgRegRec, *LgRegPtr;
51 
52 typedef struct {
53 	int tilesPerLine;	/* Number of tiles per line */
54 	int pitch;			/* Display pitch, in bytes */
55 	int width;			/* Tile width.  0 = 128 byte  1 = 256 byte */
56 } LgLineDataRec, *LgLineDataPtr;
57 
58 
59 /* lg_driver.c */
60 extern LgLineDataRec LgLineData[];
61 
62 #ifdef HAVE_XAA_H
63 /* lg_xaa.c */
64 extern Bool LgXAAInit(ScreenPtr pScreen);
65 #endif
66 
67 /* lg_hwcurs.c */
68 extern Bool LgHWCursorInit(ScreenPtr pScreen);
69 extern void LgHideCursor(ScrnInfoPtr pScrn);
70 extern void LgShowCursor(ScrnInfoPtr pScrn);
71 
72 /* lg_i2c.c */
73 extern Bool LgI2CInit(ScrnInfoPtr pScrn);
74 
75 #define memrb(off) MMIO_IN8(pCir->IOBase,off)
76 #define memrw(off) MMIO_IN16(pCir->IOBase,off)
77 #define memrl(off) MMIO_IN32(pCir->IOBase,off)
78 #define memwb(off,val) MMIO_OUT8(pCir->IOBase,off,val)
79 #define memww(off,val) MMIO_OUT16(pCir->IOBase,off,val)
80 #define memwl(off,val) MMIO_OUT32(pCir->IOBase,off,val)
81 
82 /* Card-specific driver information */
83 #define LGPTR(p) ((LgPtr)((p)->chip.lg))
84 
85 typedef struct lgRec {
86 	CARD32		HWCursorAddr;
87 	int			HWCursorImageX;
88 	int			HWCursorImageY;
89 	int			HWCursorTileWidth;
90 	int			HWCursorTileHeight;
91 
92 	int			lineDataIndex;
93 
94 	int			memInterleave;
95 
96 	LgRegRec	SavedReg;
97 	LgRegRec	ModeReg;
98 
99 	CARD32		oldBitmask;
100 	Bool		blitTransparent;
101 	int			blitYDir;
102 } LgRec, *LgPtr;
103 
104 # endif /* _LG_PRIVATE_ */
105 #endif /* LG_H */
106 
107 
108 
109 
110 
111