1 #ifndef __NOUVEAU_CONTEXT_H__
2 #define __NOUVEAU_CONTEXT_H__
4 #include "nouveau/nouveau_winsys.h"
5 #include "nouveau_drmif.h"
6 #include "nouveau_device.h"
7 #include "nouveau_channel.h"
8 #include "nouveau_pushbuf.h"
9 #include "nouveau_bo.h"
10 #include "nouveau_grobj.h"
11 #include "nouveau_notifier.h"
12 #include "nouveau_class.h"
13 #include "nouveau_local.h"
15 struct nouveau_channel_context
{
16 struct pipe_screen
*pscreen
;
21 struct pipe_context
**pctx
;
23 struct nouveau_channel
*channel
;
27 struct nouveau_context
{
29 struct nouveau_screen
*nv_screen
;
30 struct pipe_surface
*frontbuffer
;
31 struct pipe_texture
*frontbuffer_texture
;
38 /* Hardware context */
39 struct nouveau_channel_context
*nvc
;
43 extern int nouveau_context_init(struct nouveau_screen
*nv_screen
,
44 drm_context_t hHWContext
, drmLock
*sarea_lock
,
45 struct nouveau_context
*nv_share
,
46 struct nouveau_context
*nv
);
47 extern void nouveau_context_cleanup(struct nouveau_context
*nv
);
49 extern void LOCK_HARDWARE(struct nouveau_context
*);
50 extern void UNLOCK_HARDWARE(struct nouveau_context
*);
52 extern uint32_t *nouveau_pipe_dma_beginp(struct nouveau_grobj
*, int, int);
53 extern void nouveau_pipe_dma_kickoff(struct nouveau_channel
*);
55 /* Must be provided by clients of common code */
57 nouveau_contended_lock(struct nouveau_context
*nv
);