xref: /linux/drivers/gpu/drm/nouveau/nouveau_chan.h (revision ab93e0dd72c37d378dd936f031ffb83ff2bd87ce)
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 	/* TODO: this will be reworked in the near future */
35 	bool accel_done;
36 	void *fence;
37 	struct {
38 		int max;
39 		int free;
40 		int cur;
41 		int put;
42 	} dma;
43 	u32 user_get;
44 	u32 user_put;
45 
46 	struct {
47 		struct nouveau_bo *bo;
48 		struct nouveau_vma *vma;
49 	} sema;
50 
51 	struct nvif_object user;
52 	struct nvif_object blit;
53 
54 	struct nvif_event kill;
55 	atomic_t killed;
56 };
57 
58 int nouveau_channels_init(struct nouveau_drm *);
59 void nouveau_channels_fini(struct nouveau_drm *);
60 
61 int  nouveau_channel_new(struct nouveau_cli *, bool priv, u64 runm,
62 			 u32 vram, u32 gart, struct nouveau_channel **);
63 void nouveau_channel_del(struct nouveau_channel **);
64 int  nouveau_channel_idle(struct nouveau_channel *);
65 void nouveau_channel_kill(struct nouveau_channel *);
66 
67 extern int nouveau_vram_pushbuf;
68 
69 #endif
70