remove use of implicit variables from pushbuf macros
[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 Bool NVAccelGetCtxSurf2DFormatFromPixmap(PixmapPtr pPix, int *fmt_ret);
9 Bool NVAccelGetCtxSurf2DFormatFromPicture(PicturePtr pPix, int *fmt_ret);
10 PixmapPtr NVGetDrawablePixmap(DrawablePtr pDraw);
11
12 /* in nv_driver.c */
13 Bool   NVI2CInit(ScrnInfoPtr pScrn);
14 Bool NVMatchModePrivate(DisplayModePtr mode, uint32_t flags);
15
16 /* in nv_dri.c */
17 Bool NVDRIScreenInit(ScrnInfoPtr pScrn);
18 Bool NVDRIFinishScreenInit(ScrnInfoPtr pScrn);
19 void NVDRICloseScreen(ScrnInfoPtr pScrn);
20 extern const char *drmSymbols[], *driSymbols[];
21 Bool NVDRIGetVersion(ScrnInfoPtr pScrn);
22
23 /* in nv_dac.c */
24 Bool   NVDACInit(ScrnInfoPtr pScrn, DisplayModePtr mode);
25 void   NVDACSave(ScrnInfoPtr pScrn, vgaRegPtr vgaReg,
26                  NVRegPtr nvReg, Bool saveFonts);
27 void   NVDACRestore(ScrnInfoPtr pScrn, vgaRegPtr vgaReg,
28                     NVRegPtr nvReg, Bool restoreFonts);
29 void   NVDACLoadPalette(ScrnInfoPtr pScrn, int numColors, int *indices,
30                         LOCO *colors, VisualPtr pVisual );
31 Bool   NVDACi2cInit(ScrnInfoPtr pScrn);
32
33 /* in nv_video.c */
34 void NVInitVideo(ScreenPtr);
35 void NVWaitVSync(ScrnInfoPtr pScrn, int crtc);
36 void NVSetPortDefaults (ScrnInfoPtr pScrn, NVPortPrivPtr pPriv);
37 unsigned int nv_window_belongs_to_crtc(ScrnInfoPtr, int, int, int, int);
38
39 /* in nv_setup.c */
40 void   RivaEnterLeave(ScrnInfoPtr pScrn, Bool enter);
41 void   NVCommonSetup(ScrnInfoPtr pScrn);
42
43 /* in nv_cursor.c */
44 Bool   NVCursorInit(ScreenPtr pScreen);
45 Bool NVCursorInitRandr12(ScreenPtr pScreen);
46 void nv_crtc_show_cursor(xf86CrtcPtr crtc);
47 void nv_crtc_hide_cursor(xf86CrtcPtr crtc);
48 void nv_crtc_set_cursor_position(xf86CrtcPtr crtc, int x, int y);
49 void nv_crtc_set_cursor_colors(xf86CrtcPtr crtc, int bg, int fg);
50 void nv_crtc_load_cursor_image(xf86CrtcPtr crtc, CARD8 *image);
51 void nv_crtc_load_cursor_argb(xf86CrtcPtr crtc, CARD32 *image);
52 void nv_crtc_fix_nv40_hw_cursor(ScrnInfoPtr pScrn, uint8_t head);
53 void nv_crtc_show_hide_cursor(ScrnInfoPtr pScrn, uint8_t head, Bool show);
54
55 /* in nv_dma.c */
56 void  NVSync(ScrnInfoPtr pScrn);
57 Bool  NVInitDma(ScrnInfoPtr pScrn);
58
59 /* in nv_exa.c */
60 Bool NVExaInit(ScreenPtr pScreen);
61 Bool NVExaPixmapIsOnscreen(PixmapPtr pPixmap);
62
63 /* in nv_hw.c */
64 void NVCalcStateExt(NVPtr,struct _riva_hw_state *,int,int,int,int,int,int);
65 void NVLoadStateExt(ScrnInfoPtr pScrn,struct _riva_hw_state *);
66 void NVUnloadStateExt(NVPtr,struct _riva_hw_state *);
67 void NVSetStartAddress(NVPtr,CARD32);
68
69 /* in nv_shadow.c */
70 void NVRefreshArea(ScrnInfoPtr pScrn, int num, BoxPtr pbox);
71 void NVRefreshArea8(ScrnInfoPtr pScrn, int num, BoxPtr pbox);
72 void NVRefreshArea16(ScrnInfoPtr pScrn, int num, BoxPtr pbox);
73 void NVRefreshArea32(ScrnInfoPtr pScrn, int num, BoxPtr pbox);
74 void NVPointerMoved(int index, int x, int y);
75
76 /* in nv_bios.c */
77 unsigned int NVParseBios(ScrnInfoPtr pScrn);
78 void call_lvds_script(ScrnInfoPtr pScrn, struct dcb_entry *dcbent, int head, enum LVDS_script script, int pxclk);
79 void run_tmds_table(ScrnInfoPtr pScrn, struct dcb_entry *dcbent, int head, int pxclk);
80 int getMNP_single(ScrnInfoPtr pScrn, struct pll_lims *pll_lim, int clk, int *NM, int *log2P);
81 int getMNP_double(ScrnInfoPtr pScrn, struct pll_lims *pll_lim, int clk, int *NM1, int *NM2, int *log2P);
82 bool get_pll_limits(ScrnInfoPtr pScrn, uint32_t limit_match, struct pll_lims *pll_lim);
83 void setup_edid_dual_link_lvds(ScrnInfoPtr pScrn, int pxclk);
84
85 /* nv_crtc.c */
86 void NVCrtcSetBase (xf86CrtcPtr crtc, int x, int y, Bool bios_restore);
87 void nv_crtc_init(ScrnInfoPtr pScrn, int crtc_num);
88 void NVCrtcLockUnlock(xf86CrtcPtr crtc, Bool lock);
89 void NVCrtcWriteCRTC(xf86CrtcPtr crtc, uint32_t reg, uint32_t val);
90 void NVCrtcWriteRAMDAC(xf86CrtcPtr crtc, uint32_t reg, uint32_t val);
91
92 /* nv_output.c */
93 void NvSetupOutputs(ScrnInfoPtr pScrn);
94 uint32_t nv_get_clock_from_crtc(ScrnInfoPtr pScrn, RIVA_HW_STATE *state, uint8_t crtc);
95
96 /* nv_hw.c */
97 uint32_t NVRead(NVPtr pNv, uint32_t reg);
98 void NVWrite(NVPtr pNv, uint32_t reg, uint32_t val);
99 uint32_t NVReadCRTC(NVPtr pNv, int head, uint32_t reg);
100 void NVWriteCRTC(NVPtr pNv, int head, uint32_t reg, uint32_t val);
101 uint32_t NVReadRAMDAC(NVPtr pNv, int head, uint32_t reg);
102 void NVWriteRAMDAC(NVPtr pNv, int head, uint32_t reg, uint32_t val);
103 uint8_t nv_read_tmds(NVPtr pNv, int or, int dl, uint8_t address);
104 int nv_get_digital_bound_head(NVPtr pNv, int or);
105 void nv_write_tmds(NVPtr pNv, int or, int dl, uint8_t address, uint8_t data);
106 void NVWriteVgaCrtc(NVPtr pNv, int head, uint8_t index, uint8_t value);
107 uint8_t NVReadVgaCrtc(NVPtr pNv, int head, uint8_t index);
108 void NVWriteVgaCrtc5758(NVPtr pNv, int head, uint8_t index, uint8_t value);
109 uint8_t NVReadVgaCrtc5758(NVPtr pNv, int head, uint8_t index);
110 uint8_t NVReadPVIO(NVPtr pNv, int head, uint16_t port);
111 void NVWritePVIO(NVPtr pNv, int head, uint16_t port, uint8_t value);
112 void NVWriteVgaSeq(NVPtr pNv, int head, uint8_t index, uint8_t value);
113 uint8_t NVReadVgaSeq(NVPtr pNv, int head, uint8_t index);
114 void NVWriteVgaGr(NVPtr pNv, int head, uint8_t index, uint8_t value);
115 uint8_t NVReadVgaGr(NVPtr pNv, int head, uint8_t index);
116 void NVSetEnablePalette(NVPtr pNv, int head, bool enable);
117 void NVWriteVgaAttr(NVPtr pNv, int head, uint8_t index, uint8_t value);
118 uint8_t NVReadVgaAttr(NVPtr pNv, int head, uint8_t index);
119 void NVVgaSeqReset(NVPtr pNv, int head, bool start);
120 void NVVgaProtect(NVPtr pNv, int head, bool protect);
121 void NVSetOwner(ScrnInfoPtr pScrn, int head);
122 void NVLockVgaCrtc(NVPtr pNv, int head, bool lock);
123 void NVBlankScreen(ScrnInfoPtr pScrn, int head, bool blank);
124 int nv_decode_pll_highregs(NVPtr pNv, uint32_t pll1, uint32_t pll2, bool force_single, int refclk);
125 void nForceUpdateArbitrationSettings (unsigned VClk, unsigned pixelDepth,
126                                       unsigned     *burst, unsigned     *lwm,
127                                       NVPtr        pNv);
128 void nv30UpdateArbitrationSettings (NVPtr        pNv,
129                                     unsigned     *burst,
130                                     unsigned     *lwm);
131 void nv10UpdateArbitrationSettings (unsigned      VClk, 
132                                     unsigned      pixelDepth, 
133                                     unsigned     *burst,
134                                     unsigned     *lwm,
135                                     NVPtr        pNv);
136 void nv4UpdateArbitrationSettings (unsigned      VClk, 
137                                    unsigned      pixelDepth, 
138                                    unsigned     *burst,
139                                    unsigned     *lwm,
140                                    NVPtr        pNv);
141 uint32_t nv_pitch_align(NVPtr pNv, uint32_t width, int bpp);
142 void nv_save_restore_vga_fonts(ScrnInfoPtr pScrn, bool save);
143
144 /* in nv_i2c.c */
145 Bool NV_I2CInit(ScrnInfoPtr pScrn, I2CBusPtr *bus_ptr, int i2c_reg, char *name);
146
147 /* in nv04_video_overlay.c */
148 void NV04PutOverlayImage(ScrnInfoPtr, struct nouveau_bo *, int, int, int,
149                          BoxPtr, int, int, int, int, short, short, short,
150                          short, short, short, RegionPtr clipBoxes);
151 int NV04SetOverlayPortAttribute(ScrnInfoPtr, Atom, INT32, pointer);
152 int NV04GetOverlayPortAttribute(ScrnInfoPtr, Atom, INT32 *, pointer);
153 void NV04StopOverlay(ScrnInfoPtr);
154
155 /* in nv04_video_blitter.c */
156 void NVPutBlitImage(ScrnInfoPtr, struct nouveau_bo *, int, int, int, BoxPtr,
157                     int, int, int, int, short, short, short, short, short,
158                     short, RegionPtr, PixmapPtr);
159 int NVSetBlitPortAttribute(ScrnInfoPtr, Atom, INT32, pointer);
160 int NVGetBlitPortAttribute(ScrnInfoPtr, Atom, INT32 *, pointer);
161 void NVStopBlitVideo(ScrnInfoPtr, pointer, Bool);
162
163 /* in nv10_exa.c */
164 Bool NVAccelInitNV10TCL(ScrnInfoPtr pScrn);
165 Bool NV10CheckComposite(int, PicturePtr, PicturePtr, PicturePtr);
166 Bool NV10PrepareComposite(int, PicturePtr, PicturePtr, PicturePtr,
167                                   PixmapPtr, PixmapPtr, PixmapPtr);
168 void NV10Composite(PixmapPtr, int, int, int, int, int, int, int, int);
169 void NV10DoneComposite(PixmapPtr);
170
171 /* in nv10_video_overlay.c */
172 void NV10PutOverlayImage(ScrnInfoPtr, struct nouveau_bo *, int, int, int, int,
173                          BoxPtr, int, int, int, int, short, short, short,
174                          short, short, short, RegionPtr clipBoxes);
175 int NV10SetOverlayPortAttribute(ScrnInfoPtr, Atom, INT32, pointer);
176 int NV10GetOverlayPortAttribute(ScrnInfoPtr, Atom, INT32 *, pointer);
177 void NV10StopOverlay(ScrnInfoPtr);
178 void NV10WriteOverlayParameters(ScrnInfoPtr);
179
180 /* in nv30_exa.c */
181 Bool NVAccelInitNV30TCL(ScrnInfoPtr pScrn);
182 Bool NV30EXACheckComposite(int, PicturePtr, PicturePtr, PicturePtr);
183 Bool NV30EXAPrepareComposite(int, PicturePtr, PicturePtr, PicturePtr,
184                                   PixmapPtr, PixmapPtr, PixmapPtr);
185 void NV30EXAComposite(PixmapPtr, int, int, int, int, int, int, int, int);
186 void NV30EXADoneComposite(PixmapPtr);
187
188 /* in nv30_video_texture.c */
189 int NV30PutTextureImage(ScrnInfoPtr, struct nouveau_bo *, int, int, int, int,
190                         BoxPtr, int, int, int, int, uint16_t, uint16_t,
191                         uint16_t, uint16_t, uint16_t, uint16_t,
192                         RegionPtr, PixmapPtr, NVPortPrivPtr);
193 void NV30StopTexturedVideo(ScrnInfoPtr, pointer, Bool);
194 int NV30GetTexturePortAttribute(ScrnInfoPtr, Atom, INT32 *, pointer);
195 int NV30SetTexturePortAttribute(ScrnInfoPtr, Atom, INT32, pointer);
196
197 /* in nv40_exa.c */
198 Bool NVAccelInitNV40TCL(ScrnInfoPtr pScrn);
199 Bool NV40EXACheckComposite(int, PicturePtr, PicturePtr, PicturePtr);
200 Bool NV40EXAPrepareComposite(int, PicturePtr, PicturePtr, PicturePtr,
201                                   PixmapPtr, PixmapPtr, PixmapPtr);
202 void NV40EXAComposite(PixmapPtr, int, int, int, int, int, int, int, int);
203 void NV40EXADoneComposite(PixmapPtr);
204
205 /* in nv40_video_texture.c */
206 int NV40PutTextureImage(ScrnInfoPtr, struct nouveau_bo *, int, int, int, int,
207                         BoxPtr, int, int, int, int, uint16_t, uint16_t,
208                         uint16_t, uint16_t, uint16_t, uint16_t,
209                         RegionPtr, PixmapPtr, NVPortPrivPtr);
210 void NV40StopTexturedVideo(ScrnInfoPtr, pointer, Bool);
211 int NV40GetTexturePortAttribute(ScrnInfoPtr, Atom, INT32 *, pointer);
212 int NV40SetTexturePortAttribute(ScrnInfoPtr, Atom, INT32, pointer);
213
214 /* in nv50_accel.c */
215 Bool NVAccelInitNV50TCL(ScrnInfoPtr pScrn);
216
217 /* in nv50_exa.c */
218 Bool NV50EXAPrepareSolid(PixmapPtr, int, Pixel, Pixel);
219 void NV50EXASolid(PixmapPtr, int, int, int, int);
220 void NV50EXADoneSolid(PixmapPtr);
221 Bool NV50EXAPrepareCopy(PixmapPtr, PixmapPtr, int, int, int, Pixel);
222 void NV50EXACopy(PixmapPtr, int, int, int, int, int, int);
223 void NV50EXADoneCopy(PixmapPtr);
224 Bool NV50EXACheckComposite(int, PicturePtr, PicturePtr, PicturePtr);
225 Bool NV50EXAPrepareComposite(int, PicturePtr, PicturePtr, PicturePtr,
226                                   PixmapPtr, PixmapPtr, PixmapPtr);
227 void NV50EXAComposite(PixmapPtr, int, int, int, int, int, int, int, int);
228 void NV50EXADoneComposite(PixmapPtr);
229 Bool NV50EXAUploadSIFC(const char *src, int src_pitch,
230                        PixmapPtr pdPix, int x, int y, int w, int h, int cpp);
231
232 /* in nv50_display.c */
233 Bool NV50DispPreInit(ScrnInfoPtr);
234 Bool NV50DispInit(ScrnInfoPtr);
235 void NV50DispShutdown(ScrnInfoPtr);
236
237 /* in nv50_cursor.c */
238 Bool NV50CursorInit(ScreenPtr);
239 Bool NV50CursorAcquire(ScrnInfoPtr);
240 void NV50CursorRelease(ScrnInfoPtr);
241
242 /* in nv50_crtc.c */
243 void NV50DisplayCommand(ScrnInfoPtr pScrn, uint32_t addr, uint32_t value);
244 void NV50CrtcCommand(nouveauCrtcPtr crtc, uint32_t addr, uint32_t value);
245 void NV50CrtcInit(ScrnInfoPtr pScrn);
246 void NV50CrtcDestroy(ScrnInfoPtr pScrn);
247
248 /* in nv50_output.c */
249 int NV50OrOffset(nouveauOutputPtr output);
250 void NV50OutputSetup(ScrnInfoPtr pScrn);
251 void NV50OutputDestroy(ScrnInfoPtr pScrn);
252
253 /* nv50_dac.c */
254 void NV50DacSetFunctionPointers(nouveauOutputPtr output);
255
256 /* nv50_sor.c */
257 void NV50SorSetFunctionPointers(nouveauOutputPtr output);
258 DisplayModePtr GetLVDSNativeMode(ScrnInfoPtr pScrn);
259
260 /* nv50_connector.c */
261 void NV50ConnectorInit(ScrnInfoPtr pScrn);
262 void NV50ConnectorDestroy(ScrnInfoPtr pScrn);
263
264 /* nv50_randr.c */
265 void nv50_crtc_init(ScrnInfoPtr pScrn, int crtc_num);
266 void nv50_output_create(ScrnInfoPtr pScrn);
267 int nv_scaling_mode_lookup(char *name, int size);
268
269 /* nv50_xv.c */
270 int nv50_xv_image_put(ScrnInfoPtr, struct nouveau_bo *, int, int, int, int,
271                       BoxPtr, int, int, int, int, uint16_t, uint16_t,
272                       uint16_t, uint16_t, uint16_t, uint16_t,
273                       RegionPtr, PixmapPtr, NVPortPrivPtr);
274 void nv50_xv_video_stop(ScrnInfoPtr, pointer, Bool);
275 int nv50_xv_port_attribute_set(ScrnInfoPtr, Atom, INT32, pointer);
276 int nv50_xv_port_attribute_get(ScrnInfoPtr, Atom, INT32 *, pointer);
277
278 /* To support EXA 2.0, 2.1 has this in the header */
279 #ifndef exaMoveInPixmap
280 extern void exaMoveInPixmap(PixmapPtr pPixmap);
281 #endif
282
283 #endif /* __NV_PROTO_H__ */
284