randr12: Some changes to output detection.
[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
54 /* in nv_video.c */
55 void NVInitVideo(ScreenPtr);
56 void NVResetVideo (ScrnInfoPtr pScrnInfo);
57
58 /* in nv_setup.c */
59 void   RivaEnterLeave(ScrnInfoPtr pScrn, Bool enter);
60 void   NVCommonSetup(ScrnInfoPtr pScrn);
61
62 /* in nv_cursor.c */
63 Bool   NVCursorInit(ScreenPtr pScreen);
64 #ifdef ENABLE_RANDR12
65 Bool NVCursorInitRandr12(ScreenPtr pScreen);
66 void nv_crtc_show_cursor(xf86CrtcPtr crtc);
67 void nv_crtc_hide_cursor(xf86CrtcPtr crtc);
68 void nv_crtc_set_cursor_position(xf86CrtcPtr crtc, int x, int y);
69 void nv_crtc_set_cursor_colors(xf86CrtcPtr crtc, int bg, int fg);
70 void nv_crtc_load_cursor_image(xf86CrtcPtr crtc, CARD8 *image);
71 void nv_crtc_load_cursor_argb(xf86CrtcPtr crtc, CARD32 *image);
72 #endif /* ENABLE_RANDR12 */
73
74 /* in nv_dma.c */
75 void  NVDmaKickoffNNN(NVPtr pNv);
76 void  NVDmaKickoffCallback(NVPtr pNv);
77 void  NVDmaWaitNNN(ScrnInfoPtr pScrn, int size);
78 void  NVSync(ScrnInfoPtr pScrn);
79 void  NVResetGraphics(ScrnInfoPtr pScrn);
80 Bool  NVDmaCreateContextObject(NVPtr pNv, int handle, int class);
81 Bool  NVInitDma(ScrnInfoPtr pScrn);
82
83 /* in nv_exa.c */
84 Bool NVExaInit(ScreenPtr pScreen);
85
86 /* in nv_hw.c */
87 void NVCalcStateExt(NVPtr,struct _riva_hw_state *,int,int,int,int,int,int);
88 void NVLoadStateExt(ScrnInfoPtr pScrn,struct _riva_hw_state *);
89 void NVUnloadStateExt(NVPtr,struct _riva_hw_state *);
90 void NVSetStartAddress(NVPtr,CARD32);
91 int  NVShowHideCursor(NVPtr,int);
92 void NVLockUnlock(NVPtr,int);
93 uint8_t nvReadVGA(NVPtr pNv, uint8_t index);
94 void nvWriteVGA(NVPtr pNv, uint8_t index, uint8_t data);
95 uint8_t NVReadVGA0(NVPtr pNv, uint8_t index);
96 uint8_t NVReadVGA1(NVPtr pNv, uint8_t index);
97 void NVWriteVGA0(NVPtr pNv, uint8_t index, uint8_t data);
98 void NVWriteVGA1(NVPtr pNv, uint8_t index, uint8_t data);
99 void nvWriteRAMDAC(NVPtr pNv, uint8_t head, uint32_t ramdac_reg, CARD32 val);
100 CARD32 nvReadRAMDAC(NVPtr pNv, uint8_t head, uint32_t ramdac_reg);
101 void nvWriteCRTC(NVPtr pNv, uint8_t head, uint32_t reg, CARD32 val);
102 CARD32 nvReadCRTC(NVPtr pNv, uint8_t head, uint32_t reg);
103
104 /* in nv_shadow.c */
105 void NVRefreshArea(ScrnInfoPtr pScrn, int num, BoxPtr pbox);
106 void NVRefreshArea8(ScrnInfoPtr pScrn, int num, BoxPtr pbox);
107 void NVRefreshArea16(ScrnInfoPtr pScrn, int num, BoxPtr pbox);
108 void NVRefreshArea32(ScrnInfoPtr pScrn, int num, BoxPtr pbox);
109 void NVPointerMoved(int index, int x, int y);
110
111 /* in nv_bios.c */
112 unsigned int NVParseBios(ScrnInfoPtr pScrn);
113
114 void nForceUpdateArbitrationSettings (unsigned      VClk,  unsigned      pixelDepth,
115                                       unsigned     *burst, unsigned     *lwm,
116                                       NVPtr        pNv);
117
118
119 /* nv_crtc.c */
120 #ifdef ENABLE_RANDR12
121 DisplayModePtr NVCrtcFindClosestMode(xf86CrtcPtr crtc, DisplayModePtr pMode);
122 void NVCrtcSetBase (xf86CrtcPtr crtc, int x, int y);
123 void NVCrtcLoadPalette(xf86CrtcPtr crtc);
124 void NVCrtcBlankScreen(xf86CrtcPtr crtc, Bool on);
125 void NVCrtcSetCursor(xf86CrtcPtr crtc, Bool state);
126 void nv_crtc_init(ScrnInfoPtr pScrn, int crtc_num);
127 void NVCrtcLockUnlock(xf86CrtcPtr crtc, Bool Lock);
128 void NVWriteVgaCrtc(xf86CrtcPtr crtc, CARD8 index, CARD8 value);
129 CARD8 NVReadVgaCrtc(xf86CrtcPtr crtc, CARD8 index);
130 #endif /* ENABLE_RANDR12 */
131
132 /* nv_output.c */
133 #ifdef ENABLE_RANDR12
134 void NvSetupOutputs(ScrnInfoPtr pScrn);
135 void NVOutputWriteRAMDAC(xf86OutputPtr output, CARD32 ramdac_reg, CARD32 val);
136 CARD32 NVOutputReadRAMDAC(xf86OutputPtr output, CARD32 ramdac_reg);
137 #endif /* ENABLE_RANDR12 */
138
139
140
141 /* nv_hw.c */
142 void nForceUpdateArbitrationSettings (unsigned VClk, unsigned pixelDepth,
143                                       unsigned     *burst, unsigned     *lwm,
144                                       NVPtr        pNv);
145 void nv30UpdateArbitrationSettings (NVPtr        pNv,
146                                     unsigned     *burst,
147                                     unsigned     *lwm);
148 void nv10UpdateArbitrationSettings (unsigned      VClk, 
149                                     unsigned      pixelDepth, 
150                                     unsigned     *burst,
151                                     unsigned     *lwm,
152                                     NVPtr        pNv);
153 void nv4UpdateArbitrationSettings (unsigned      VClk, 
154                                    unsigned      pixelDepth, 
155                                    unsigned     *burst,
156                                    unsigned     *lwm,
157                                    NVPtr        pNv);
158
159 void NVInitSurface(ScrnInfoPtr pScrn, RIVA_HW_STATE *state);
160 void NVInitGraphContext(ScrnInfoPtr pScrn);
161
162 /* nv_i2c.c */
163 Bool NV_I2CInit(ScrnInfoPtr pScrn, I2CBusPtr *bus_ptr, int i2c_reg, char *name);
164
165 /* in nv10_exa.c */
166 Bool NVAccelInitNV10TCL(ScrnInfoPtr pScrn);
167
168 /* in nv30_exa.c */
169 Bool NVAccelInitNV30TCL(ScrnInfoPtr pScrn);
170 Bool NV30EXACheckComposite(int, PicturePtr, PicturePtr, PicturePtr);
171 Bool NV30EXAPrepareComposite(int, PicturePtr, PicturePtr, PicturePtr,
172                                   PixmapPtr, PixmapPtr, PixmapPtr);
173 void NV30EXAComposite(PixmapPtr, int, int, int, int, int, int, int, int);
174 void NV30EXADoneComposite(PixmapPtr);
175
176 /* in nv40_exa.c */
177 Bool NVAccelInitNV40TCL(ScrnInfoPtr pScrn);
178 Bool NV40EXACheckComposite(int, PicturePtr, PicturePtr, PicturePtr);
179 Bool NV40EXAPrepareComposite(int, PicturePtr, PicturePtr, PicturePtr,
180                                   PixmapPtr, PixmapPtr, PixmapPtr);
181 void NV40EXAComposite(PixmapPtr, int, int, int, int, int, int, int, int);
182 void NV40EXADoneComposite(PixmapPtr);
183
184 /* in nv50_exa.c */
185 Bool NV50EXAPrepareSolid(PixmapPtr, int, Pixel, Pixel);
186 void NV50EXASolid(PixmapPtr, int, int, int, int);
187 void NV50EXADoneSolid(PixmapPtr);
188 Bool NV50EXAPrepareCopy(PixmapPtr, PixmapPtr, int, int, int, Pixel);
189 void NV50EXACopy(PixmapPtr, int, int, int, int, int, int);
190 void NV50EXADoneCopy(PixmapPtr);
191 Bool NV50EXACheckComposite(int, PicturePtr, PicturePtr, PicturePtr);
192 Bool NV50EXAPrepareComposite(int, PicturePtr, PicturePtr, PicturePtr,
193                                   PixmapPtr, PixmapPtr, PixmapPtr);
194 void NV50EXAComposite(PixmapPtr, int, int, int, int, int, int, int, int);
195 void NV50EXADoneComposite(PixmapPtr);
196
197 #ifdef ENABLE_RANDR12
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 #endif /* ENABLE_RANDR12 */
218
219
220 #endif /* __NV_PROTO_H__ */
221