Enable nv30 exa on PPC.
[nouveau] / src / nv_proto.h
1 /* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nv/nv_proto.h,v 1.11 2004/03/20 01:52:16 mvojkovi Exp $ */
2
3 #ifndef __NV_PROTO_H__
4 #define __NV_PROTO_H__
5
6 /* in nv_accel_common.c */
7 Bool NVAccelCommonInit(ScrnInfoPtr pScrn);
8 uint32_t NVAccelGetPixmapOffset(PixmapPtr pPix);
9 Bool NVAccelGetCtxSurf2DFormatFromPixmap(PixmapPtr pPix, int *fmt_ret);
10 Bool NVAccelGetCtxSurf2DFormatFromPicture(PicturePtr pPix, int *fmt_ret);
11 Bool NVAccelSetCtxSurf2D(PixmapPtr psPix, PixmapPtr pdPix, int fmt);
12
13 /* in nv_driver.c */
14 Bool   NVSwitchMode(int scrnIndex, DisplayModePtr mode, int flags);
15 void   NVAdjustFrame(int scrnIndex, int x, int y, int flags);
16 Bool   NVI2CInit(ScrnInfoPtr pScrn);
17
18 /* in nv_mem.c */
19 NVAllocRec *NVAllocateMemory(NVPtr pNv, int type, int size);
20 void        NVFreeMemory(NVPtr pNv, NVAllocRec *mem);
21
22 /* in nv_notifier.c */
23 struct drm_nouveau_notifierobj_alloc *
24 NVNotifierAlloc(ScrnInfoPtr, uint32_t handle);
25 void NVNotifierDestroy(ScrnInfoPtr, struct drm_nouveau_notifierobj_alloc *);
26 void NVNotifierReset(ScrnInfoPtr, struct drm_nouveau_notifierobj_alloc *);
27 uint32_t NVNotifierStatus(ScrnInfoPtr, struct drm_nouveau_notifierobj_alloc *);
28 uint32_t NVNotifierErrorCode(ScrnInfoPtr,
29                              struct drm_nouveau_notifierobj_alloc *);
30 uint32_t NVNotifierReturnVal(ScrnInfoPtr,
31                              struct drm_nouveau_notifierobj_alloc *);
32 Bool NVNotifierWaitStatus(ScrnInfoPtr, struct drm_nouveau_notifierobj_alloc *,
33                           uint32_t status, uint32_t timeout);
34
35 /* in nv_dri.c */
36 unsigned int NVDRMGetParam(NVPtr pNv, unsigned int param);
37 Bool NVDRMSetParam(NVPtr pNv, unsigned int param, unsigned int value);
38 Bool NVDRIScreenInit(ScrnInfoPtr pScrn);
39 Bool NVDRIFinishScreenInit(ScrnInfoPtr pScrn);
40 extern const char *drmSymbols[], *driSymbols[];
41 Bool NVDRIGetVersion(ScrnInfoPtr pScrn);
42
43 /* in nv_dac.c */
44 Bool   NVDACInit(ScrnInfoPtr pScrn, DisplayModePtr mode);
45 void   NVDACSave(ScrnInfoPtr pScrn, vgaRegPtr vgaReg,
46                  NVRegPtr nvReg, Bool saveFonts);
47 void   NVDACRestore(ScrnInfoPtr pScrn, vgaRegPtr vgaReg,
48                     NVRegPtr nvReg, Bool restoreFonts);
49 void   NVDACLoadPalette(ScrnInfoPtr pScrn, int numColors, int *indices,
50                         LOCO *colors, VisualPtr pVisual );
51 Bool   NVDACi2cInit(ScrnInfoPtr pScrn);
52
53 /* in nv_video.c */
54 void NVInitVideo(ScreenPtr);
55 void NVResetVideo (ScrnInfoPtr pScrnInfo);
56
57 /* in nv_setup.c */
58 void   RivaEnterLeave(ScrnInfoPtr pScrn, Bool enter);
59 void   NVCommonSetup(ScrnInfoPtr pScrn);
60
61 /* in nv_cursor.c */
62 Bool   NVCursorInit(ScreenPtr pScreen);
63 Bool NVCursorInitRandr12(ScreenPtr pScreen);
64 void nv_crtc_show_cursor(xf86CrtcPtr crtc);
65 void nv_crtc_hide_cursor(xf86CrtcPtr crtc);
66 void nv_crtc_set_cursor_position(xf86CrtcPtr crtc, int x, int y);
67 void nv_crtc_set_cursor_colors(xf86CrtcPtr crtc, int bg, int fg);
68 void nv_crtc_load_cursor_image(xf86CrtcPtr crtc, CARD8 *image);
69 void nv_crtc_load_cursor_argb(xf86CrtcPtr crtc, CARD32 *image);
70
71 /* in nv_dma.c */
72 void  NVDmaKickoffNNN(NVPtr pNv);
73 void  NVDmaKickoffCallback(NVPtr pNv);
74 void  NVDmaWaitNNN(ScrnInfoPtr pScrn, int size);
75 void  NVSync(ScrnInfoPtr pScrn);
76 void  NVResetGraphics(ScrnInfoPtr pScrn);
77 Bool  NVDmaCreateContextObject(NVPtr pNv, int handle, int class);
78 Bool  NVInitDma(ScrnInfoPtr pScrn);
79
80 /* in nv_exa.c */
81 Bool NVExaInit(ScreenPtr pScreen);
82
83 /* in nv_hw.c */
84 void NVCalcStateExt(NVPtr,struct _riva_hw_state *,int,int,int,int,int,int);
85 void NVLoadStateExt(ScrnInfoPtr pScrn,struct _riva_hw_state *);
86 void NVUnloadStateExt(NVPtr,struct _riva_hw_state *);
87 void NVSetStartAddress(NVPtr,CARD32);
88 int  NVShowHideCursor(NVPtr,int);
89 void NVLockUnlock(NVPtr,int);
90 uint8_t nvReadVGA(NVPtr pNv, uint8_t index);
91 void nvWriteVGA(NVPtr pNv, uint8_t index, uint8_t data);
92 uint8_t NVReadVGA0(NVPtr pNv, uint8_t index);
93 uint8_t NVReadVGA1(NVPtr pNv, uint8_t index);
94 void NVWriteVGA0(NVPtr pNv, uint8_t index, uint8_t data);
95 void NVWriteVGA1(NVPtr pNv, uint8_t index, uint8_t data);
96 void nvWriteRAMDAC(NVPtr pNv, uint8_t head, uint32_t ramdac_reg, CARD32 val);
97 CARD32 nvReadRAMDAC(NVPtr pNv, uint8_t head, uint32_t ramdac_reg);
98 void nvWriteCRTC(NVPtr pNv, uint8_t head, uint32_t reg, CARD32 val);
99 CARD32 nvReadCRTC(NVPtr pNv, uint8_t head, uint32_t reg);
100
101 /* in nv_shadow.c */
102 void NVRefreshArea(ScrnInfoPtr pScrn, int num, BoxPtr pbox);
103 void NVRefreshArea8(ScrnInfoPtr pScrn, int num, BoxPtr pbox);
104 void NVRefreshArea16(ScrnInfoPtr pScrn, int num, BoxPtr pbox);
105 void NVRefreshArea32(ScrnInfoPtr pScrn, int num, BoxPtr pbox);
106 void NVPointerMoved(int index, int x, int y);
107
108 /* in nv_bios.c */
109 unsigned int NVParseBios(ScrnInfoPtr pScrn);
110
111 void nForceUpdateArbitrationSettings (unsigned      VClk,  unsigned      pixelDepth,
112                                       unsigned     *burst, unsigned     *lwm,
113                                       NVPtr        pNv);
114
115 /* nv_crtc.c */
116 DisplayModePtr NVCrtcFindClosestMode(xf86CrtcPtr crtc, DisplayModePtr pMode);
117 void NVCrtcSetBase (xf86CrtcPtr crtc, int x, int y);
118 void NVCrtcLoadPalette(xf86CrtcPtr crtc);
119 void NVCrtcBlankScreen(xf86CrtcPtr crtc, Bool on);
120 void NVCrtcSetCursor(xf86CrtcPtr crtc, Bool state);
121 void nv_crtc_init(ScrnInfoPtr pScrn, int crtc_num);
122 void NVCrtcLockUnlock(xf86CrtcPtr crtc, Bool Lock);
123 void NVWriteVgaCrtc(xf86CrtcPtr crtc, CARD8 index, CARD8 value);
124 CARD8 NVReadVgaCrtc(xf86CrtcPtr crtc, CARD8 index);
125 void NVWriteVGA(NVPtr pNv, int head, CARD8 index, CARD8 value);
126 CARD8 NVReadVGA(NVPtr pNv, int head, CARD8 index);
127 xf86OutputPtr NVGetOutputFromCRTC(xf86CrtcPtr crtc);
128 xf86CrtcPtr nv_find_crtc_by_index(ScrnInfoPtr pScrn, int index);
129
130 /* nv_output.c */
131 void NvSetupOutputs(ScrnInfoPtr pScrn);
132 void NVOutputWriteRAMDAC(xf86OutputPtr output, CARD32 ramdac_reg, CARD32 val);
133 CARD32 NVOutputReadRAMDAC(xf86OutputPtr output, CARD32 ramdac_reg);
134 void NVWriteTMDS(NVPtr pNv, int ramdac, CARD32 tmds_reg, CARD32 val);
135 CARD8 NVReadTMDS(NVPtr pNv, int ramdac, CARD32 tmds_reg);
136
137 /* nv_hw.c */
138 void nForceUpdateArbitrationSettings (unsigned VClk, unsigned pixelDepth,
139                                       unsigned     *burst, unsigned     *lwm,
140                                       NVPtr        pNv);
141 void nv30UpdateArbitrationSettings (NVPtr        pNv,
142                                     unsigned     *burst,
143                                     unsigned     *lwm);
144 void nv10UpdateArbitrationSettings (unsigned      VClk, 
145                                     unsigned      pixelDepth, 
146                                     unsigned     *burst,
147                                     unsigned     *lwm,
148                                     NVPtr        pNv);
149 void nv4UpdateArbitrationSettings (unsigned      VClk, 
150                                    unsigned      pixelDepth, 
151                                    unsigned     *burst,
152                                    unsigned     *lwm,
153                                    NVPtr        pNv);
154
155 void NVInitSurface(ScrnInfoPtr pScrn, RIVA_HW_STATE *state);
156 void NVInitGraphContext(ScrnInfoPtr pScrn);
157
158 /* nv_i2c.c */
159 Bool NV_I2CInit(ScrnInfoPtr pScrn, I2CBusPtr *bus_ptr, int i2c_reg, char *name);
160
161 /* in nv10_exa.c */
162 Bool NVAccelInitNV10TCL(ScrnInfoPtr pScrn);
163 Bool NV10CheckComposite(int, PicturePtr, PicturePtr, PicturePtr);
164 Bool NV10PrepareComposite(int, PicturePtr, PicturePtr, PicturePtr,
165                                   PixmapPtr, PixmapPtr, PixmapPtr);
166 void NV10Composite(PixmapPtr, int, int, int, int, int, int, int, int);
167 void NV10DoneComposite(PixmapPtr);
168  
169 /* in nv30_exa.c */
170 Bool NVAccelInitNV30TCL(ScrnInfoPtr pScrn);
171 Bool NV30EXACheckComposite(int, PicturePtr, PicturePtr, PicturePtr);
172 Bool NV30EXAPrepareComposite(int, PicturePtr, PicturePtr, PicturePtr,
173                                   PixmapPtr, PixmapPtr, PixmapPtr);
174 void NV30EXAComposite(PixmapPtr, int, int, int, int, int, int, int, int);
175 void NV30EXADoneComposite(PixmapPtr);
176
177 /* in nv40_exa.c */
178 Bool NVAccelInitNV40TCL(ScrnInfoPtr pScrn);
179 Bool NV40EXACheckComposite(int, PicturePtr, PicturePtr, PicturePtr);
180 Bool NV40EXAPrepareComposite(int, PicturePtr, PicturePtr, PicturePtr,
181                                   PixmapPtr, PixmapPtr, PixmapPtr);
182 void NV40EXAComposite(PixmapPtr, int, int, int, int, int, int, int, int);
183 void NV40EXADoneComposite(PixmapPtr);
184
185 /* in nv50_exa.c */
186 Bool NV50EXAPrepareSolid(PixmapPtr, int, Pixel, Pixel);
187 void NV50EXASolid(PixmapPtr, int, int, int, int);
188 void NV50EXADoneSolid(PixmapPtr);
189 Bool NV50EXAPrepareCopy(PixmapPtr, PixmapPtr, int, int, int, Pixel);
190 void NV50EXACopy(PixmapPtr, int, int, int, int, int, int);
191 void NV50EXADoneCopy(PixmapPtr);
192 Bool NV50EXACheckComposite(int, PicturePtr, PicturePtr, PicturePtr);
193 Bool NV50EXAPrepareComposite(int, PicturePtr, PicturePtr, PicturePtr,
194                                   PixmapPtr, PixmapPtr, PixmapPtr);
195 void NV50EXAComposite(PixmapPtr, int, int, int, int, int, int, int, int);
196 void NV50EXADoneComposite(PixmapPtr);
197
198 /* in nv50_display.c */
199 Bool NV50CrtcModeFixup(xf86CrtcPtr crtc,
200                 DisplayModePtr mode, DisplayModePtr adjusted_mode);
201 void NV50CrtcPrepare(xf86CrtcPtr crtc);
202 void NV50CrtcModeSet(xf86CrtcPtr crtc, DisplayModePtr mode,
203                 DisplayModePtr adjusted_mode, int x, int y);
204 void NV50CrtcCommit(xf86CrtcPtr crtc);
205 void NV50CrtcSetPClk(xf86CrtcPtr crtc);
206
207 /* in nv50_cursor.c */
208 void NV50SetCursorPosition(xf86CrtcPtr crtc, int x, int y);
209 void NV50CrtcShowCursor(xf86CrtcPtr crtc);
210 void NV50CrtcHideCursor(xf86CrtcPtr crtc);
211 void NV50LoadCursorARGB(xf86CrtcPtr crtc, CARD32 *src);
212
213 /* in nv50_crtc.c */
214 void NV50DispCreateCrtcs(ScrnInfoPtr pScrn);
215 void NV50DisplayCommand(ScrnInfoPtr pScrn, CARD32 addr, CARD32 value);
216 void NV50CrtcCommand(xf86CrtcPtr crtc, CARD32 addr, CARD32 value);
217 void NV50CrtcWrite(xf86CrtcPtr crtc, CARD32 addr, CARD32 value);
218 CARD32 NV50CrtcRead(xf86CrtcPtr crtc, CARD32 addr);
219 void NV50DisplayWrite(ScrnInfoPtr pScrn, CARD32 addr, CARD32 value);
220 CARD32 NV50DisplayRead(ScrnInfoPtr pScrn, CARD32 addr);
221
222 /* in nv50_output.c */
223 void NV50OrWrite(ScrnInfoPtr pScrn, int or, CARD32 addr, CARD32 value);
224 CARD32 NV50OrRead(ScrnInfoPtr pScrn, int or, CARD32 addr);
225 void NV50OutputWrite(xf86OutputPtr output, CARD32 addr, CARD32 value);
226 CARD32 NV50OutputRead(xf86OutputPtr output, CARD32 addr);
227
228
229 #endif /* __NV_PROTO_H__ */
230