Add suggestion/patch by Bernhard Kaindl <bk@suse.de> and fix NVRestore().
[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
65 /* in nv_dma.c */
66 void  NVDmaKickoff(NVPtr pNv);
67 void  NVDmaKickoffCallback(NVPtr pNv);
68 void  NVDmaWait(ScrnInfoPtr pScrn, int size);
69 void  NVSync(ScrnInfoPtr pScrn);
70 void  NVResetGraphics(ScrnInfoPtr pScrn);
71 Bool  NVDmaCreateContextObject(NVPtr pNv, int handle, int class);
72 Bool  NVInitDma(ScrnInfoPtr pScrn);
73
74 /* in nv_xaa.c */
75 Bool   NVXaaInit(ScreenPtr pScreen);
76 void   NVWaitVSync(ScrnInfoPtr pScrn);
77 void   NVSetRopSolid(ScrnInfoPtr pScrn, CARD32 rop, CARD32 planemask);
78
79 /* in nv_exa.c */
80 Bool NVExaInit(ScreenPtr pScreen);
81 Bool NVAccelUploadM2MF(ScrnInfoPtr, uint64_t, const char * , int, int, int, int);
82
83 /* in riva_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 void nvWriteRAMDAC(NVPtr pNv, uint8_t head, uint32_t ramdac_reg, CARD32 val);
93 CARD32 nvReadRAMDAC(NVPtr pNv, uint8_t head, uint32_t ramdac_reg);
94 void nvWriteCRTC(NVPtr pNv, uint8_t head, uint32_t reg, CARD32 val);
95 CARD32 nvReadCRTC(NVPtr pNv, uint8_t head, uint32_t reg);
96
97 /* in nv_shadow.c */
98 void NVRefreshArea(ScrnInfoPtr pScrn, int num, BoxPtr pbox);
99 void NVRefreshArea8(ScrnInfoPtr pScrn, int num, BoxPtr pbox);
100 void NVRefreshArea16(ScrnInfoPtr pScrn, int num, BoxPtr pbox);
101 void NVRefreshArea32(ScrnInfoPtr pScrn, int num, BoxPtr pbox);
102 void NVPointerMoved(int index, int x, int y);
103
104 /* in nv_bios.c */
105 unsigned int NVParseBios(ScrnInfoPtr pScrn);
106
107 void nForceUpdateArbitrationSettings (unsigned      VClk,  unsigned      pixelDepth,
108                                       unsigned     *burst, unsigned     *lwm,
109                                       NVPtr        pNv);
110
111
112 /* nv_crtc.c */
113 Bool NVSetMode(ScrnInfoPtr pScrn, DisplayModePtr pMode, Rotation rotation);
114 Bool NVCrtcSetMode(xf86CrtcPtr crtc, DisplayModePtr pMode, Rotation rotation, int x, int y);
115 DisplayModePtr NVCrtcFindClosestMode(xf86CrtcPtr crtc, DisplayModePtr pMode);
116 void NVCrtcSetBase (xf86CrtcPtr crtc, int x, int y);
117 void NVCrtcLoadPalette(xf86CrtcPtr crtc);
118 void NVCrtcBlankScreen(xf86CrtcPtr crtc, Bool on);
119 void NVCrtcSetCursor(xf86CrtcPtr crtc, Bool state);
120
121 /* nv_hw.c */
122 void nForceUpdateArbitrationSettings (unsigned VClk, unsigned pixelDepth,
123                                       unsigned     *burst, unsigned     *lwm,
124                                       NVPtr        pNv);
125 void nv30UpdateArbitrationSettings (NVPtr        pNv,
126                                     unsigned     *burst,
127                                     unsigned     *lwm);
128 void nv10UpdateArbitrationSettings (unsigned      VClk, 
129                                     unsigned      pixelDepth, 
130                                     unsigned     *burst,
131                                     unsigned     *lwm,
132                                     NVPtr        pNv);
133 void nv4UpdateArbitrationSettings (unsigned      VClk, 
134                                    unsigned      pixelDepth, 
135                                    unsigned     *burst,
136                                    unsigned     *lwm,
137                                    NVPtr        pNv);
138
139 void NVInitSurface(ScrnInfoPtr pScrn, RIVA_HW_STATE *state);
140 void NVInitGraphContext(ScrnInfoPtr pScrn);
141
142 /* nv_i2c.c */
143 Bool NV_I2CInit(ScrnInfoPtr pScrn, I2CBusPtr *bus_ptr, int i2c_reg, char *name);
144
145 /* in nv30_exa.c */
146 Bool NVAccelInitNV30TCL(ScrnInfoPtr pScrn);
147 Bool NVAccelInitNV40TCL(ScrnInfoPtr pScrn);
148 Bool NV30EXACheckComposite(int, PicturePtr, PicturePtr, PicturePtr);
149 Bool NV30EXAPrepareComposite(int, PicturePtr, PicturePtr, PicturePtr,
150                                   PixmapPtr, PixmapPtr, PixmapPtr);
151 void NV30EXAComposite(PixmapPtr, int, int, int, int, int, int, int, int);
152 void NV30EXADoneComposite(PixmapPtr);
153
154 /* in nv50_exa.c */
155 Bool NV50EXAPrepareSolid(PixmapPtr, int, Pixel, Pixel);
156 void NV50EXASolid(PixmapPtr, int, int, int, int);
157 void NV50EXADoneSolid(PixmapPtr);
158 Bool NV50EXAPrepareCopy(PixmapPtr, PixmapPtr, int, int, int, Pixel);
159 void NV50EXACopy(PixmapPtr, int, int, int, int, int, int);
160 void NV50EXADoneCopy(PixmapPtr);
161 Bool NV50EXACheckComposite(int, PicturePtr, PicturePtr, PicturePtr);
162 Bool NV50EXAPrepareComposite(int, PicturePtr, PicturePtr, PicturePtr,
163                                   PixmapPtr, PixmapPtr, PixmapPtr);
164 void NV50EXAComposite(PixmapPtr, int, int, int, int, int, int, int, int);
165 void NV50EXADoneComposite(PixmapPtr);
166
167 #endif /* __NV_PROTO_H__ */
168