nvc0: implement compute support for nve4
[mesa.git] / src / gallium / drivers / nouveau / nouveau_screen.h
1 #ifndef __NOUVEAU_SCREEN_H__
2 #define __NOUVEAU_SCREEN_H__
3
4 #include "pipe/p_screen.h"
5 #include "util/u_memory.h"
6
7 typedef uint32_t u32;
8 typedef uint16_t u16;
9
10 extern int nouveau_mesa_debug;
11
12 struct nouveau_bo;
13
14 struct nouveau_screen {
15 struct pipe_screen base;
16 struct nouveau_device *device;
17 struct nouveau_object *channel;
18 struct nouveau_client *client;
19 struct nouveau_pushbuf *pushbuf;
20
21 unsigned vidmem_bindings; /* PIPE_BIND_* where VRAM placement is desired */
22 unsigned sysmem_bindings; /* PIPE_BIND_* where GART placement is desired */
23 unsigned lowmem_bindings; /* PIPE_BIND_* that require an address < 4 GiB */
24 /*
25 * For bindings with (vidmem & sysmem) bits set, PIPE_USAGE_* decides
26 * placement.
27 */
28
29 uint16_t class_3d;
30
31 struct {
32 struct nouveau_fence *head;
33 struct nouveau_fence *tail;
34 struct nouveau_fence *current;
35 u32 sequence;
36 u32 sequence_ack;
37 void (*emit)(struct pipe_screen *, u32 *sequence);
38 u32 (*update)(struct pipe_screen *);
39 } fence;
40
41 struct nouveau_mman *mm_VRAM;
42 struct nouveau_mman *mm_GART;
43
44 int64_t cpu_gpu_time_delta;
45
46 boolean hint_buf_keep_sysmem_copy;
47 };
48
49 static INLINE struct nouveau_screen *
50 nouveau_screen(struct pipe_screen *pscreen)
51 {
52 return (struct nouveau_screen *)pscreen;
53 }
54
55 boolean
56 nouveau_screen_bo_get_handle(struct pipe_screen *pscreen,
57 struct nouveau_bo *bo,
58 unsigned stride,
59 struct winsys_handle *whandle);
60 struct nouveau_bo *
61 nouveau_screen_bo_from_handle(struct pipe_screen *pscreen,
62 struct winsys_handle *whandle,
63 unsigned *out_stride);
64
65
66 int nouveau_screen_init(struct nouveau_screen *, struct nouveau_device *);
67 void nouveau_screen_fini(struct nouveau_screen *);
68
69 void nouveau_screen_init_vdec(struct nouveau_screen *);
70
71 #endif