1 /* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nv/nv_proto.h,v 1.11 2004/03/20 01:52:16 mvojkovi Exp $ */
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);
12 Bool NVSwitchMode(int scrnIndex, DisplayModePtr mode, int flags);
13 void NVAdjustFrame(int scrnIndex, int x, int y, int flags);
14 Bool NVI2CInit(ScrnInfoPtr pScrn);
15 Bool NVMatchModePrivate(DisplayModePtr mode, uint32_t flags);
18 Bool NVDRIScreenInit(ScrnInfoPtr pScrn);
19 Bool NVDRIFinishScreenInit(ScrnInfoPtr pScrn);
20 extern const char *drmSymbols[], *driSymbols[];
21 Bool NVDRIGetVersion(ScrnInfoPtr pScrn);
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);
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);
40 void RivaEnterLeave(ScrnInfoPtr pScrn, Bool enter);
41 void NVCommonSetup(ScrnInfoPtr pScrn);
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);
54 void NVSync(ScrnInfoPtr pScrn);
55 void NVResetGraphics(ScrnInfoPtr pScrn);
56 Bool NVInitDma(ScrnInfoPtr pScrn);
59 Bool NVExaInit(ScreenPtr pScreen);
62 void NVCalcStateExt(NVPtr,struct _riva_hw_state *,int,int,int,int,int,int);
63 void NVLoadStateExt(ScrnInfoPtr pScrn,struct _riva_hw_state *);
64 void NVUnloadStateExt(NVPtr,struct _riva_hw_state *);
65 void NVSetStartAddress(NVPtr,CARD32);
66 int NVShowHideCursor(NVPtr,int);
67 void NVLockUnlock(NVPtr,int);
68 uint8_t nvReadVGA(NVPtr pNv, uint8_t index);
69 void nvWriteVGA(NVPtr pNv, uint8_t index, uint8_t data);
70 uint8_t NVReadVGA0(NVPtr pNv, uint8_t index);
71 uint8_t NVReadVGA1(NVPtr pNv, uint8_t index);
72 void NVWriteVGA0(NVPtr pNv, uint8_t index, uint8_t data);
73 void NVWriteVGA1(NVPtr pNv, uint8_t index, uint8_t data);
74 void nvWriteRAMDAC(NVPtr pNv, uint8_t head, uint32_t ramdac_reg, CARD32 val);
75 CARD32 nvReadRAMDAC(NVPtr pNv, uint8_t head, uint32_t ramdac_reg);
76 void nvWriteCRTC(NVPtr pNv, uint8_t head, uint32_t reg, CARD32 val);
77 CARD32 nvReadCRTC(NVPtr pNv, uint8_t head, uint32_t reg);
80 void NVRefreshArea(ScrnInfoPtr pScrn, int num, BoxPtr pbox);
81 void NVRefreshArea8(ScrnInfoPtr pScrn, int num, BoxPtr pbox);
82 void NVRefreshArea16(ScrnInfoPtr pScrn, int num, BoxPtr pbox);
83 void NVRefreshArea32(ScrnInfoPtr pScrn, int num, BoxPtr pbox);
84 void NVPointerMoved(int index, int x, int y);
87 unsigned int NVParseBios(ScrnInfoPtr pScrn);
88 void link_head_and_output(ScrnInfoPtr pScrn, int head, int dcb_entry, Bool overrideval);
89 void call_lvds_script(ScrnInfoPtr pScrn, int head, int dcb_entry, enum LVDS_script script, int pxclk);
90 void run_tmds_table(ScrnInfoPtr pScrn, int dcb_entry, int head, int pxclk);
91 uint32_t getMNP_single(ScrnInfoPtr pScrn, uint32_t clk, int *NM, int *log2P);
92 int getMNP_double(ScrnInfoPtr pScrn, uint32_t reg, int clk, int *NM1, int *NM2, int *log2P);
93 //int getMNP_double_plltype(ScrnInfoPtr pScrn, enum pll_types plltype, int clk, int *NM1, int *NM2, int *log2P);
94 int get_pll_limits_plltype(ScrnInfoPtr pScrn, enum pll_types plltype, struct pll_lims *pll_lim);
96 void nForceUpdateArbitrationSettings (unsigned VClk, unsigned pixelDepth,
97 unsigned *burst, unsigned *lwm,
101 DisplayModePtr NVCrtcFindClosestMode(xf86CrtcPtr crtc, DisplayModePtr pMode);
102 void NVCrtcSetBase (xf86CrtcPtr crtc, int x, int y, Bool bios_restore);
103 void NVCrtcLoadPalette(xf86CrtcPtr crtc);
104 void NVCrtcBlankScreen(xf86CrtcPtr crtc, Bool on);
105 void NVCrtcSetCursor(xf86CrtcPtr crtc, Bool state);
106 void nv_crtc_init(ScrnInfoPtr pScrn, int crtc_num);
107 void NVCrtcLockUnlock(xf86CrtcPtr crtc, Bool Lock);
108 void NVWriteVgaCrtc(xf86CrtcPtr crtc, uint8_t index, uint8_t value);
109 uint8_t NVReadVgaCrtc(xf86CrtcPtr crtc, uint8_t index);
110 void NVWriteVGA(NVPtr pNv, int head, uint8_t index, uint8_t value);
111 uint8_t NVReadVGA(NVPtr pNv, int head, uint8_t index);
112 xf86OutputPtr NVGetOutputFromCRTC(xf86CrtcPtr crtc);
113 xf86CrtcPtr nv_find_crtc_by_index(ScrnInfoPtr pScrn, int index);
114 void NVWriteVGACR5758(NVPtr pNv, int head, uint8_t index, uint8_t value);
115 uint8_t NVReadVGACR5758(NVPtr pNv, int head, uint8_t index);
116 void NVCrtcModeFix(xf86CrtcPtr crtc);
119 void NvSetupOutputs(ScrnInfoPtr pScrn);
120 void NVOutputWriteRAMDAC(xf86OutputPtr output, uint32_t ramdac_reg, uint32_t val);
121 uint32_t NVOutputReadRAMDAC(xf86OutputPtr output, uint32_t ramdac_reg);
122 void NVWriteTMDS(NVPtr pNv, int ramdac, uint32_t tmds_reg, uint32_t val);
123 uint8_t NVReadTMDS(NVPtr pNv, int ramdac, uint32_t tmds_reg);
124 uint32_t nv_get_clock_from_crtc(ScrnInfoPtr pScrn, uint8_t crtc);
125 uint32_t nv_calc_tmds_clock_from_pll(xf86OutputPtr output);
126 void nv_set_tmds_registers(xf86OutputPtr output, uint32_t clock, Bool override, Bool crosswired);
129 void nForceUpdateArbitrationSettings (unsigned VClk, unsigned pixelDepth,
130 unsigned *burst, unsigned *lwm,
132 void nv30UpdateArbitrationSettings (NVPtr pNv,
135 void nv10UpdateArbitrationSettings (unsigned VClk,
140 void nv4UpdateArbitrationSettings (unsigned VClk,
146 void NVInitSurface(ScrnInfoPtr pScrn, RIVA_HW_STATE *state);
147 void NVInitGraphContext(ScrnInfoPtr pScrn);
150 Bool NV_I2CInit(ScrnInfoPtr pScrn, I2CBusPtr *bus_ptr, int i2c_reg, char *name);
152 /* in nv04_video_overlay.c */
153 void NV04PutOverlayImage(ScrnInfoPtr, int, int, int, BoxPtr,
154 int, int, int, int, short, short, short, short,
155 short, short, RegionPtr clipBoxes);
156 int NV04SetOverlayPortAttribute(ScrnInfoPtr, Atom, INT32, pointer);
157 int NV04GetOverlayPortAttribute(ScrnInfoPtr, Atom, INT32 *, pointer);
158 void NV04StopOverlay(ScrnInfoPtr);
160 /* in nv04_video_blitter.c */
161 void NVPutBlitImage(ScrnInfoPtr, int, int, int, BoxPtr,
165 RegionPtr, DrawablePtr);
166 int NVSetBlitPortAttribute(ScrnInfoPtr, Atom, INT32, pointer);
167 int NVGetBlitPortAttribute(ScrnInfoPtr, Atom, INT32 *, pointer);
168 void NVStopBlitVideo(ScrnInfoPtr, pointer, Bool);
171 Bool NVAccelInitNV10TCL(ScrnInfoPtr pScrn);
172 Bool NV10CheckComposite(int, PicturePtr, PicturePtr, PicturePtr);
173 Bool NV10PrepareComposite(int, PicturePtr, PicturePtr, PicturePtr,
174 PixmapPtr, PixmapPtr, PixmapPtr);
175 void NV10Composite(PixmapPtr, int, int, int, int, int, int, int, int);
176 void NV10DoneComposite(PixmapPtr);
178 /* in nv10_video_overlay.c */
179 void NV10PutOverlayImage(ScrnInfoPtr, int, int, int, int, BoxPtr,
180 int, int, int, int, short, short, short, short,
181 short, short, RegionPtr clipBoxes);
182 int NV10SetOverlayPortAttribute(ScrnInfoPtr, Atom, INT32, pointer);
183 int NV10GetOverlayPortAttribute(ScrnInfoPtr, Atom, INT32 *, pointer);
184 void NV10StopOverlay(ScrnInfoPtr);
185 void NV10WriteOverlayParameters(ScrnInfoPtr);
188 Bool NVAccelInitNV30TCL(ScrnInfoPtr pScrn);
189 Bool NV30EXACheckComposite(int, PicturePtr, PicturePtr, PicturePtr);
190 Bool NV30EXAPrepareComposite(int, PicturePtr, PicturePtr, PicturePtr,
191 PixmapPtr, PixmapPtr, PixmapPtr);
192 void NV30EXAComposite(PixmapPtr, int, int, int, int, int, int, int, int);
193 void NV30EXADoneComposite(PixmapPtr);
196 Bool NVAccelInitNV40TCL(ScrnInfoPtr pScrn);
197 Bool NV40EXACheckComposite(int, PicturePtr, PicturePtr, PicturePtr);
198 Bool NV40EXAPrepareComposite(int, PicturePtr, PicturePtr, PicturePtr,
199 PixmapPtr, PixmapPtr, PixmapPtr);
200 void NV40EXAComposite(PixmapPtr, int, int, int, int, int, int, int, int);
201 void NV40EXADoneComposite(PixmapPtr);
203 /* in nv40_video_texture.c */
204 int NV40PutTextureImage(ScrnInfoPtr, int, int, int, int, BoxPtr,
205 int, int, int, int, uint16_t, uint16_t,
206 uint16_t, uint16_t, uint16_t, uint16_t,
207 RegionPtr, DrawablePtr);
208 void NV40StopTexturedVideo(ScrnInfoPtr, pointer, Bool);
209 int NVGetTexturePortAttribute(ScrnInfoPtr, Atom, INT32 *, pointer);
210 int NVSetTexturePortAttribute(ScrnInfoPtr, Atom, INT32, pointer);
213 Bool NV50EXAPrepareSolid(PixmapPtr, int, Pixel, Pixel);
214 void NV50EXASolid(PixmapPtr, int, int, int, int);
215 void NV50EXADoneSolid(PixmapPtr);
216 Bool NV50EXAPrepareCopy(PixmapPtr, PixmapPtr, int, int, int, Pixel);
217 void NV50EXACopy(PixmapPtr, int, int, int, int, int, int);
218 void NV50EXADoneCopy(PixmapPtr);
219 Bool NV50EXACheckComposite(int, PicturePtr, PicturePtr, PicturePtr);
220 Bool NV50EXAPrepareComposite(int, PicturePtr, PicturePtr, PicturePtr,
221 PixmapPtr, PixmapPtr, PixmapPtr);
222 void NV50EXAComposite(PixmapPtr, int, int, int, int, int, int, int, int);
223 void NV50EXADoneComposite(PixmapPtr);
224 Bool NV50EXAUploadSIFC(ScrnInfoPtr pScrn, const char *src, int src_pitch,
225 PixmapPtr pdPix, int x, int y, int w, int h, int cpp);
227 /* in nv50_display.c */
228 Bool NV50CrtcModeFixup(xf86CrtcPtr crtc,
229 DisplayModePtr mode, DisplayModePtr adjusted_mode);
230 void NV50CrtcPrepare(xf86CrtcPtr crtc);
231 void NV50CrtcModeSet(xf86CrtcPtr crtc, DisplayModePtr mode,
232 DisplayModePtr adjusted_mode, int x, int y);
233 void NV50CrtcCommit(xf86CrtcPtr crtc);
234 void NV50CrtcSetPClk(xf86CrtcPtr crtc);
236 /* in nv50_cursor.c */
237 void NV50SetCursorPosition(xf86CrtcPtr crtc, int x, int y);
238 void NV50CrtcShowCursor(xf86CrtcPtr crtc);
239 void NV50CrtcHideCursor(xf86CrtcPtr crtc);
240 void NV50LoadCursorARGB(xf86CrtcPtr crtc, CARD32 *src);
243 void NV50DispCreateCrtcs(ScrnInfoPtr pScrn);
244 void NV50DisplayCommand(ScrnInfoPtr pScrn, CARD32 addr, CARD32 value);
245 void NV50CrtcCommand(xf86CrtcPtr crtc, CARD32 addr, CARD32 value);
246 void NV50CrtcWrite(xf86CrtcPtr crtc, CARD32 addr, CARD32 value);
247 CARD32 NV50CrtcRead(xf86CrtcPtr crtc, CARD32 addr);
248 void NV50DisplayWrite(ScrnInfoPtr pScrn, CARD32 addr, CARD32 value);
249 CARD32 NV50DisplayRead(ScrnInfoPtr pScrn, CARD32 addr);
251 /* in nv50_output.c */
252 void NV50OrWrite(ScrnInfoPtr pScrn, int or, CARD32 addr, CARD32 value);
253 CARD32 NV50OrRead(ScrnInfoPtr pScrn, int or, CARD32 addr);
254 void NV50OutputWrite(xf86OutputPtr output, CARD32 addr, CARD32 value);
255 CARD32 NV50OutputRead(xf86OutputPtr output, CARD32 addr);
258 #endif /* __NV_PROTO_H__ */