Merge branch 'randr-1.2' into nv50-branch
[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 drm_nouveau_notifier_alloc_t *NVNotifierAlloc(ScrnInfoPtr, uint32_t handle);
24 void        NVNotifierDestroy(ScrnInfoPtr, drm_nouveau_notifier_alloc_t *);
25 void        NVNotifierReset(ScrnInfoPtr, drm_nouveau_notifier_alloc_t *);
26 uint32_t    NVNotifierStatus(ScrnInfoPtr, drm_nouveau_notifier_alloc_t *);
27 uint32_t    NVNotifierErrorCode(ScrnInfoPtr, drm_nouveau_notifier_alloc_t *);
28 uint32_t    NVNotifierReturnVal(ScrnInfoPtr, drm_nouveau_notifier_alloc_t *);
29 Bool        NVNotifierWaitStatus(ScrnInfoPtr, drm_nouveau_notifier_alloc_t *,
30                                  uint32_t status, uint32_t timeout);
31
32 /* in nv_dri.c */
33 unsigned int NVDRMGetParam(NVPtr pNv, unsigned int param);
34 Bool NVDRMSetParam(NVPtr pNv, unsigned int param, unsigned int value);
35 Bool NVDRIScreenInit(ScrnInfoPtr pScrn);
36 Bool NVDRIFinishScreenInit(ScrnInfoPtr pScrn);
37 extern const char *drmSymbols[], *driSymbols[];
38 Bool NVDRIGetVersion(ScrnInfoPtr pScrn);
39
40 /* in nv_video.c */
41 void NVInitVideo(ScreenPtr);
42 void NVResetVideo (ScrnInfoPtr pScrnInfo);
43
44 /* in nv_setup.c */
45 void   RivaEnterLeave(ScrnInfoPtr pScrn, Bool enter);
46 void   NVCommonSetup(ScrnInfoPtr pScrn);
47
48 /* in nv_cursor.c */
49 Bool   NVCursorInit(ScreenPtr pScreen);
50
51 /* in nv_dma.c */
52 void  NVDmaKickoff(NVPtr pNv);
53 void  NVDmaKickoffCallback(NVPtr pNv);
54 void  NVDmaWait(ScrnInfoPtr pScrn, int size);
55 void  NVSync(ScrnInfoPtr pScrn);
56 void  NVResetGraphics(ScrnInfoPtr pScrn);
57 Bool  NVDmaCreateContextObject(NVPtr pNv, int handle, int class);
58 Bool  NVInitDma(ScrnInfoPtr pScrn);
59
60 /* in nv_xaa.c */
61 Bool   NVXaaInit(ScreenPtr pScreen);
62 void   NVWaitVSync(ScrnInfoPtr pScrn);
63 void   NVSetRopSolid(ScrnInfoPtr pScrn, CARD32 rop, CARD32 planemask);
64
65 /* in nv_exa.c */
66 Bool NVExaInit(ScreenPtr pScreen);
67 Bool NVAccelUploadM2MF(ScrnInfoPtr, uint64_t, const char * , int, int, int, int);
68
69 /* in riva_hw.c */
70 void NVCalcStateExt(NVPtr,struct _riva_hw_state *,int,int,int,int,int,int);
71 void NVLoadStateExt(ScrnInfoPtr pScrn,struct _riva_hw_state *);
72 void NVUnloadStateExt(NVPtr,struct _riva_hw_state *);
73 void NVSetStartAddress(NVPtr,CARD32);
74 uint8_t nvReadVGA(NVPtr pNv, uint8_t index);
75 void nvWriteVGA(NVPtr pNv, uint8_t index, uint8_t data);
76 void nvWriteRAMDAC(NVPtr pNv, uint8_t head, uint32_t ramdac_reg, CARD32 val);
77 CARD32 nvReadRAMDAC(NVPtr pNv, uint8_t head, uint32_t ramdac_reg);
78 void nvWriteCRTC(NVPtr pNv, uint8_t head, uint32_t reg, CARD32 val);
79 CARD32 nvReadCRTC(NVPtr pNv, uint8_t head, uint32_t reg);
80
81 /* in nv_shadow.c */
82 void NVRefreshArea(ScrnInfoPtr pScrn, int num, BoxPtr pbox);
83 void NVRefreshArea8(ScrnInfoPtr pScrn, int num, BoxPtr pbox);
84 void NVRefreshArea16(ScrnInfoPtr pScrn, int num, BoxPtr pbox);
85 void NVRefreshArea32(ScrnInfoPtr pScrn, int num, BoxPtr pbox);
86 void NVPointerMoved(int index, int x, int y);
87
88 /* in nv_bios.c */
89 unsigned int NVParseBios(ScrnInfoPtr pScrn);
90
91 void nForceUpdateArbitrationSettings (unsigned      VClk,  unsigned      pixelDepth,
92                                       unsigned     *burst, unsigned     *lwm,
93                                       NVPtr        pNv);
94
95
96 /* nv_crtc.c */
97 Bool NVSetMode(ScrnInfoPtr pScrn, DisplayModePtr pMode, Rotation rotation);
98 Bool NVCrtcSetMode(xf86CrtcPtr crtc, DisplayModePtr pMode, Rotation rotation, int x, int y);
99 DisplayModePtr NVCrtcFindClosestMode(xf86CrtcPtr crtc, DisplayModePtr pMode);
100 void NVCrtcSetBase (xf86CrtcPtr crtc, int x, int y);
101 void NVCrtcLoadPalette(xf86CrtcPtr crtc);
102 void NVCrtcBlankScreen(xf86CrtcPtr crtc, Bool on);
103
104 /* nv_hw.c */
105 void nForceUpdateArbitrationSettings (unsigned VClk, unsigned pixelDepth,
106                                       unsigned     *burst, unsigned     *lwm,
107                                       NVPtr        pNv);
108 void nv30UpdateArbitrationSettings (NVPtr        pNv,
109                                     unsigned     *burst,
110                                     unsigned     *lwm);
111 void nv10UpdateArbitrationSettings (unsigned      VClk, 
112                                     unsigned      pixelDepth, 
113                                     unsigned     *burst,
114                                     unsigned     *lwm,
115                                     NVPtr        pNv);
116 void nv4UpdateArbitrationSettings (unsigned      VClk, 
117                                    unsigned      pixelDepth, 
118                                    unsigned     *burst,
119                                    unsigned     *lwm,
120                                    NVPtr        pNv);
121
122 void NVInitSurface(ScrnInfoPtr pScrn, RIVA_HW_STATE *state);
123 void NVInitGraphContext(ScrnInfoPtr pScrn);
124
125 /* nv_i2c.c */
126 Bool NV_I2CInit(ScrnInfoPtr pScrn, I2CBusPtr *bus_ptr, int i2c_reg, char *name);
127
128 /* in nv30_exa.c */
129 Bool NVAccelInitNV40TCL(ScrnInfoPtr pScrn);
130 Bool NV30EXACheckComposite(int, PicturePtr, PicturePtr, PicturePtr);
131 Bool NV30EXAPrepareComposite(int, PicturePtr, PicturePtr, PicturePtr,
132                                   PixmapPtr, PixmapPtr, PixmapPtr);
133 void NV30EXAComposite(PixmapPtr, int, int, int, int, int, int, int, int);
134 void NV30EXADoneComposite(PixmapPtr);
135
136 /* in nv50_exa.c */
137 Bool NV50EXAPrepareSolid(PixmapPtr, int, Pixel, Pixel);
138 void NV50EXASolid(PixmapPtr, int, int, int, int);
139 void NV50EXADoneSolid(PixmapPtr);
140 Bool NV50EXAPrepareCopy(PixmapPtr, PixmapPtr, int, int, int, Pixel);
141 void NV50EXACopy(PixmapPtr, int, int, int, int, int, int);
142 void NV50EXADoneCopy(PixmapPtr);
143 Bool NV50EXACheckComposite(int, PicturePtr, PicturePtr, PicturePtr);
144 Bool NV50EXAPrepareComposite(int, PicturePtr, PicturePtr, PicturePtr,
145                                   PixmapPtr, PixmapPtr, PixmapPtr);
146 void NV50EXAComposite(PixmapPtr, int, int, int, int, int, int, int, int);
147 void NV50EXADoneComposite(PixmapPtr);
148
149 #endif /* __NV_PROTO_H__ */
150