xref: /linux/drivers/gpu/drm/nouveau/nouveau_chan.h (revision 68a052239fc4b351e961f698b824f7654a346091)
1 /* SPDX-License-Identifier: MIT */
2 #ifndef __NOUVEAU_CHAN_H__
3 #define __NOUVEAU_CHAN_H__
4 #include <nvif/object.h>
5 #include <nvif/event.h>
6 #include <nvif/chan.h>
7 struct nvif_device;
8 
9 struct nouveau_channel {
10 	struct nvif_chan chan;
11 
12 	struct nouveau_cli *cli;
13 	struct nouveau_vmm *vmm;
14 
15 	struct nvif_mem mem_userd;
16 	struct nvif_object *userd;
17 
18 	int runlist;
19 	int chid;
20 	u64 inst;
21 	u32 token;
22 
23 	struct nvif_object vram;
24 	struct nvif_object gart;
25 	struct nvif_object nvsw;
26 
27 	struct {
28 		struct nouveau_bo *buffer;
29 		struct nouveau_vma *vma;
30 		struct nvif_object ctxdma;
31 		u64 addr;
32 	} push;
33 
34 	void *fence;
35 	struct {
36 		int max;
37 		int free;
38 		int cur;
39 		int put;
40 	} dma;
41 	u32 user_get;
42 	u32 user_put;
43 
44 	struct {
45 		struct nouveau_bo *bo;
46 		struct nouveau_vma *vma;
47 	} sema;
48 
49 	struct nvif_object user;
50 	struct nvif_object blit;
51 
52 	struct nvif_event kill;
53 	atomic_t killed;
54 };
55 
56 int nouveau_channels_init(struct nouveau_drm *);
57 void nouveau_channels_fini(struct nouveau_drm *);
58 
59 int  nouveau_channel_new(struct nouveau_cli *, bool priv, u64 runm,
60 			 u32 vram, u32 gart, struct nouveau_channel **);
61 void nouveau_channel_del(struct nouveau_channel **);
62 int  nouveau_channel_idle(struct nouveau_channel *);
63 void nouveau_channel_kill(struct nouveau_channel *);
64 
65 extern int nouveau_vram_pushbuf;
66 
67 #endif
68