1 /* SPDX-License-Identifier: GPL-2.0 */ 2 #ifndef __NOUVEAU_CHAN_H__ 3 #define __NOUVEAU_CHAN_H__ 4 #include <nvif/object.h> 5 #include <nvif/notify.h> 6 struct nvif_device; 7 8 struct nouveau_channel { 9 struct nvif_device *device; 10 struct nouveau_drm *drm; 11 12 int chid; 13 14 struct nvif_object vram; 15 struct nvif_object gart; 16 struct nvif_object nvsw; 17 18 struct { 19 struct nouveau_bo *buffer; 20 struct nouveau_vma *vma; 21 struct nvif_object ctxdma; 22 u64 addr; 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 42 struct nvif_object user; 43 44 struct nvif_notify kill; 45 atomic_t killed; 46 }; 47 48 int nouveau_channels_init(struct nouveau_drm *); 49 50 int nouveau_channel_new(struct nouveau_drm *, struct nvif_device *, 51 u32 arg0, u32 arg1, struct nouveau_channel **); 52 void nouveau_channel_del(struct nouveau_channel **); 53 int nouveau_channel_idle(struct nouveau_channel *); 54 55 extern int nouveau_vram_pushbuf; 56 57 #endif 58