1 /* SPDX-License-Identifier: MIT */ 2 #ifndef __NVKM_CHAN_H__ 3 #define __NVKM_CHAN_H__ 4 #define nvkm_chan(p) container_of((p), struct nvkm_chan, object) /*FIXME: remove later */ 5 #include <engine/fifo.h> 6 7 extern const struct nvkm_event_func nvkm_chan_event; 8 9 struct nvkm_chan_func { 10 void *(*dtor)(struct nvkm_fifo_chan *); 11 void (*init)(struct nvkm_fifo_chan *); 12 void (*fini)(struct nvkm_fifo_chan *); 13 int (*engine_ctor)(struct nvkm_fifo_chan *, struct nvkm_engine *, 14 struct nvkm_object *); 15 void (*engine_dtor)(struct nvkm_fifo_chan *, struct nvkm_engine *); 16 int (*engine_init)(struct nvkm_fifo_chan *, struct nvkm_engine *); 17 int (*engine_fini)(struct nvkm_fifo_chan *, struct nvkm_engine *, 18 bool suspend); 19 int (*object_ctor)(struct nvkm_fifo_chan *, struct nvkm_object *); 20 void (*object_dtor)(struct nvkm_fifo_chan *, int); 21 u32 (*submit_token)(struct nvkm_fifo_chan *); 22 }; 23 24 int nvkm_fifo_chan_ctor(const struct nvkm_fifo_chan_func *, struct nvkm_fifo *, 25 u32 size, u32 align, bool zero, u64 vm, u64 push, 26 u32 engm, int bar, u32 base, u32 user, 27 const struct nvkm_oclass *, struct nvkm_fifo_chan *); 28 void nvkm_chan_del(struct nvkm_chan **); 29 30 int nvkm_fifo_chan_child_new(const struct nvkm_oclass *, void *, u32, struct nvkm_object **); 31 #endif 32