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; |
11 | |||||
Ben Skeggs | bbf8906 | 2014-08-10 04:10:25 +1000 | [diff] [blame] | 12 | int chid; |
Ben Skeggs | 86b442d | 2018-12-11 14:50:02 +1000 | [diff] [blame^] | 13 | u64 inst; |
Ben Skeggs | bbf8906 | 2014-08-10 04:10:25 +1000 | [diff] [blame] | 14 | |
Ben Skeggs | 0ad7286 | 2014-08-10 04:10:22 +1000 | [diff] [blame] | 15 | struct nvif_object vram; |
16 | struct nvif_object gart; | ||||
17 | struct nvif_object nvsw; | ||||
Ben Skeggs | ebb945a | 2012-07-20 08:17:34 +1000 | [diff] [blame] | 18 | |
19 | struct { | ||||
20 | struct nouveau_bo *buffer; | ||||
Ben Skeggs | 24e8375 | 2017-11-01 03:56:19 +1000 | [diff] [blame] | 21 | struct nouveau_vma *vma; |
Ben Skeggs | 0ad7286 | 2014-08-10 04:10:22 +1000 | [diff] [blame] | 22 | struct nvif_object ctxdma; |
Ben Skeggs | 24e8375 | 2017-11-01 03:56:19 +1000 | [diff] [blame] | 23 | u64 addr; |
Ben Skeggs | ebb945a | 2012-07-20 08:17:34 +1000 | [diff] [blame] | 24 | } push; |
25 | |||||
26 | /* TODO: this will be reworked in the near future */ | ||||
27 | bool accel_done; | ||||
28 | void *fence; | ||||
29 | struct { | ||||
30 | int max; | ||||
31 | int free; | ||||
32 | int cur; | ||||
33 | int put; | ||||
34 | int ib_base; | ||||
35 | int ib_max; | ||||
36 | int ib_free; | ||||
37 | int ib_put; | ||||
38 | } dma; | ||||
39 | u32 user_get_hi; | ||||
40 | u32 user_get; | ||||
41 | u32 user_put; | ||||
42 | |||||
Ben Skeggs | a01ca78 | 2015-08-20 14:54:15 +1000 | [diff] [blame] | 43 | struct nvif_object user; |
Ben Skeggs | d8cc37d | 2016-11-05 13:31:25 +1000 | [diff] [blame] | 44 | |
45 | struct nvif_notify kill; | ||||
46 | atomic_t killed; | ||||
Ben Skeggs | ebb945a | 2012-07-20 08:17:34 +1000 | [diff] [blame] | 47 | }; |
48 | |||||
Ben Skeggs | eb47db4 | 2018-05-08 20:39:46 +1000 | [diff] [blame] | 49 | int nouveau_channels_init(struct nouveau_drm *); |
Ben Skeggs | ebb945a | 2012-07-20 08:17:34 +1000 | [diff] [blame] | 50 | |
Ben Skeggs | 0ad7286 | 2014-08-10 04:10:22 +1000 | [diff] [blame] | 51 | int nouveau_channel_new(struct nouveau_drm *, struct nvif_device *, |
Ben Skeggs | fcf3f91 | 2015-09-04 14:40:32 +1000 | [diff] [blame] | 52 | u32 arg0, u32 arg1, struct nouveau_channel **); |
Ben Skeggs | ebb945a | 2012-07-20 08:17:34 +1000 | [diff] [blame] | 53 | void nouveau_channel_del(struct nouveau_channel **); |
54 | int nouveau_channel_idle(struct nouveau_channel *); | ||||
55 | |||||
Pierre Moreau | 703fa26 | 2014-08-18 22:43:24 +0200 | [diff] [blame] | 56 | extern int nouveau_vram_pushbuf; |
57 | |||||
Ben Skeggs | ebb945a | 2012-07-20 08:17:34 +1000 | [diff] [blame] | 58 | #endif |