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