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