Greg Kroah-Hartman | b244131 | 2017-11-01 15:07:57 +0100 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
Ben Skeggs | ebb945a | 2012-07-20 08:17:34 +1000 | [diff] [blame] | 2 | #ifndef __NOUVEAU_CHAN_H__ |
3 | #define __NOUVEAU_CHAN_H__ | ||||
Ben Skeggs | 0ad7286 | 2014-08-10 04:10:22 +1000 | [diff] [blame] | 4 | #include <nvif/object.h> |
Ben Skeggs | d8cc37d | 2016-11-05 13:31:25 +1000 | [diff] [blame] | 5 | #include <nvif/notify.h> |
Ben Skeggs | 0ad7286 | 2014-08-10 04:10:22 +1000 | [diff] [blame] | 6 | struct nvif_device; |
Ben Skeggs | ebb945a | 2012-07-20 08:17:34 +1000 | [diff] [blame] | 7 | |
8 | struct nouveau_channel { | ||||
Ben Skeggs | 0ad7286 | 2014-08-10 04:10:22 +1000 | [diff] [blame] | 9 | struct nvif_device *device; |
Ben Skeggs | ebb945a | 2012-07-20 08:17:34 +1000 | [diff] [blame] | 10 | struct nouveau_drm *drm; |
Ben Skeggs | bfe91af | 2019-02-19 17:21:48 +1000 | [diff] [blame] | 11 | struct nouveau_vmm *vmm; |
Ben Skeggs | ebb945a | 2012-07-20 08:17:34 +1000 | [diff] [blame] | 12 | |
Ben Skeggs | bbf8906 | 2014-08-10 04:10:25 +1000 | [diff] [blame] | 13 | int chid; |
Ben Skeggs | 86b442d | 2018-12-11 14:50:02 +1000 | [diff] [blame] | 14 | u64 inst; |
Ben Skeggs | 9d24907 | 2018-12-11 14:50:02 +1000 | [diff] [blame] | 15 | u32 token; |
Ben Skeggs | bbf8906 | 2014-08-10 04:10:25 +1000 | [diff] [blame] | 16 | |
Ben Skeggs | 0ad7286 | 2014-08-10 04:10:22 +1000 | [diff] [blame] | 17 | struct nvif_object vram; |
18 | struct nvif_object gart; | ||||
19 | struct nvif_object nvsw; | ||||
Ben Skeggs | ebb945a | 2012-07-20 08:17:34 +1000 | [diff] [blame] | 20 | |
21 | struct { | ||||
22 | struct nouveau_bo *buffer; | ||||
Ben Skeggs | 24e8375 | 2017-11-01 03:56:19 +1000 | [diff] [blame] | 23 | struct nouveau_vma *vma; |
Ben Skeggs | 0ad7286 | 2014-08-10 04:10:22 +1000 | [diff] [blame] | 24 | struct nvif_object ctxdma; |
Ben Skeggs | 24e8375 | 2017-11-01 03:56:19 +1000 | [diff] [blame] | 25 | u64 addr; |
Ben Skeggs | ebb945a | 2012-07-20 08:17:34 +1000 | [diff] [blame] | 26 | } push; |
27 | |||||
28 | /* TODO: this will be reworked in the near future */ | ||||
29 | bool accel_done; | ||||
30 | void *fence; | ||||
31 | struct { | ||||
32 | int max; | ||||
33 | int free; | ||||
34 | int cur; | ||||
35 | int put; | ||||
36 | int ib_base; | ||||
37 | int ib_max; | ||||
38 | int ib_free; | ||||
39 | int ib_put; | ||||
40 | } dma; | ||||
41 | u32 user_get_hi; | ||||
42 | u32 user_get; | ||||
43 | u32 user_put; | ||||
44 | |||||
Ben Skeggs | a01ca78 | 2015-08-20 14:54:15 +1000 | [diff] [blame] | 45 | struct nvif_object user; |
Ben Skeggs | d8cc37d | 2016-11-05 13:31:25 +1000 | [diff] [blame] | 46 | |
47 | struct nvif_notify kill; | ||||
48 | atomic_t killed; | ||||
Ben Skeggs | ebb945a | 2012-07-20 08:17:34 +1000 | [diff] [blame] | 49 | }; |
50 | |||||
Ben Skeggs | eb47db4 | 2018-05-08 20:39:46 +1000 | [diff] [blame] | 51 | int nouveau_channels_init(struct nouveau_drm *); |
Ben Skeggs | ebb945a | 2012-07-20 08:17:34 +1000 | [diff] [blame] | 52 | |
Ben Skeggs | 0ad7286 | 2014-08-10 04:10:22 +1000 | [diff] [blame] | 53 | int nouveau_channel_new(struct nouveau_drm *, struct nvif_device *, |
Ben Skeggs | 85532bd | 2018-12-11 14:50:02 +1000 | [diff] [blame] | 54 | u32 arg0, u32 arg1, bool priv, |
55 | struct nouveau_channel **); | ||||
Ben Skeggs | ebb945a | 2012-07-20 08:17:34 +1000 | [diff] [blame] | 56 | void nouveau_channel_del(struct nouveau_channel **); |
57 | int nouveau_channel_idle(struct nouveau_channel *); | ||||
58 | |||||
Pierre Moreau | 703fa26 | 2014-08-18 22:43:24 +0200 | [diff] [blame] | 59 | extern int nouveau_vram_pushbuf; |
60 | |||||
Ben Skeggs | ebb945a | 2012-07-20 08:17:34 +1000 | [diff] [blame] | 61 | #endif |