revert between 56095 -> 55830 in arch
[AROS.git] / workbench / libs / mesa / src / gallium / drivers / nouveau / nouveau_screen.h
blobd910809a0ec358b6f4d8dae24f194696b2fc4867
1 #ifndef __NOUVEAU_SCREEN_H__
2 #define __NOUVEAU_SCREEN_H__
4 #include "pipe/p_screen.h"
5 #include "util/u_memory.h"
6 typedef uint32_t u32;
8 struct nouveau_bo;
10 struct nouveau_screen {
11 struct pipe_screen base;
12 struct nouveau_device *device;
13 struct nouveau_channel *channel;
15 /* note that OpenGL doesn't distinguish between these, so
16 * these almost always should be set to the same value */
17 unsigned vertex_buffer_flags;
18 unsigned index_buffer_flags;
19 unsigned sysmem_bindings;
21 struct {
22 struct nouveau_fence *head;
23 struct nouveau_fence *tail;
24 struct nouveau_fence *current;
25 u32 sequence;
26 u32 sequence_ack;
27 void (*emit)(struct pipe_screen *, u32 sequence);
28 u32 (*update)(struct pipe_screen *);
29 } fence;
31 struct nouveau_mman *mm_VRAM;
32 struct nouveau_mman *mm_GART;
35 static INLINE struct nouveau_screen *
36 nouveau_screen(struct pipe_screen *pscreen)
38 return (struct nouveau_screen *)pscreen;
43 /* Not really sure if this is needed, or whether the individual
44 * drivers are happy to talk to the bo functions themselves. In a way
45 * this is what we'd expect from a regular winsys interface.
47 struct nouveau_bo *
48 nouveau_screen_bo_new(struct pipe_screen *pscreen, unsigned alignment,
49 unsigned usage, unsigned bind, unsigned size);
50 void *
51 nouveau_screen_bo_map(struct pipe_screen *pscreen,
52 struct nouveau_bo *pb,
53 unsigned usage);
54 void *
55 nouveau_screen_bo_map_range(struct pipe_screen *pscreen, struct nouveau_bo *bo,
56 unsigned offset, unsigned length, unsigned usage);
57 void
58 nouveau_screen_bo_map_flush_range(struct pipe_screen *pscreen, struct nouveau_bo *bo,
59 unsigned offset, unsigned length);
60 void
61 nouveau_screen_bo_unmap(struct pipe_screen *pscreen, struct nouveau_bo *bo);
62 void
63 nouveau_screen_bo_release(struct pipe_screen *pscreen, struct nouveau_bo *bo);
65 boolean
66 nouveau_screen_bo_get_handle(struct pipe_screen *pscreen,
67 struct nouveau_bo *bo,
68 unsigned stride,
69 struct winsys_handle *whandle);
70 struct nouveau_bo *
71 nouveau_screen_bo_from_handle(struct pipe_screen *pscreen,
72 struct winsys_handle *whandle,
73 unsigned *out_stride);
76 int nouveau_screen_init(struct nouveau_screen *, struct nouveau_device *);
77 void nouveau_screen_fini(struct nouveau_screen *);
81 #ifndef NOUVEAU_NVC0
82 static INLINE unsigned
83 RING_3D(unsigned mthd, unsigned size)
85 return (7 << 13) | (size << 18) | mthd;
88 static INLINE unsigned
89 RING_3D_NI(unsigned mthd, unsigned size)
91 return 0x40000000 | (7 << 13) | (size << 18) | mthd;
93 #endif
95 #endif