1 1.2 riastrad /* $NetBSD: nouveau_chan.h,v 1.3 2021/12/18 23:45:32 riastradh Exp $ */ 2 1.2 riastrad 3 1.3 riastrad /* SPDX-License-Identifier: MIT */ 4 1.1 riastrad #ifndef __NOUVEAU_CHAN_H__ 5 1.1 riastrad #define __NOUVEAU_CHAN_H__ 6 1.2 riastrad #include <nvif/object.h> 7 1.3 riastrad #include <nvif/notify.h> 8 1.2 riastrad struct nvif_device; 9 1.1 riastrad 10 1.1 riastrad struct nouveau_channel { 11 1.2 riastrad struct nvif_device *device; 12 1.1 riastrad struct nouveau_drm *drm; 13 1.3 riastrad struct nouveau_vmm *vmm; 14 1.1 riastrad 15 1.2 riastrad int chid; 16 1.3 riastrad u64 inst; 17 1.3 riastrad u32 token; 18 1.2 riastrad 19 1.2 riastrad struct nvif_object vram; 20 1.2 riastrad struct nvif_object gart; 21 1.2 riastrad struct nvif_object nvsw; 22 1.1 riastrad 23 1.1 riastrad struct { 24 1.1 riastrad struct nouveau_bo *buffer; 25 1.3 riastrad struct nouveau_vma *vma; 26 1.2 riastrad struct nvif_object ctxdma; 27 1.3 riastrad u64 addr; 28 1.1 riastrad } push; 29 1.1 riastrad 30 1.1 riastrad /* TODO: this will be reworked in the near future */ 31 1.1 riastrad bool accel_done; 32 1.1 riastrad void *fence; 33 1.1 riastrad struct { 34 1.1 riastrad int max; 35 1.1 riastrad int free; 36 1.1 riastrad int cur; 37 1.1 riastrad int put; 38 1.1 riastrad int ib_base; 39 1.1 riastrad int ib_max; 40 1.1 riastrad int ib_free; 41 1.1 riastrad int ib_put; 42 1.1 riastrad } dma; 43 1.1 riastrad u32 user_get_hi; 44 1.1 riastrad u32 user_get; 45 1.1 riastrad u32 user_put; 46 1.1 riastrad 47 1.2 riastrad struct nvif_object user; 48 1.3 riastrad 49 1.3 riastrad struct nvif_notify kill; 50 1.3 riastrad atomic_t killed; 51 1.1 riastrad }; 52 1.1 riastrad 53 1.3 riastrad int nouveau_channels_init(struct nouveau_drm *); 54 1.1 riastrad 55 1.2 riastrad int nouveau_channel_new(struct nouveau_drm *, struct nvif_device *, 56 1.3 riastrad u32 arg0, u32 arg1, bool priv, 57 1.3 riastrad struct nouveau_channel **); 58 1.1 riastrad void nouveau_channel_del(struct nouveau_channel **); 59 1.1 riastrad int nouveau_channel_idle(struct nouveau_channel *); 60 1.1 riastrad 61 1.2 riastrad extern int nouveau_vram_pushbuf; 62 1.2 riastrad 63 1.1 riastrad #endif 64