chan.h revision 1.2
1/* $NetBSD: chan.h,v 1.2 2018/08/27 04:58:31 riastradh Exp $ */ 2 3#ifndef __NVKM_FIFO_CHAN_H__ 4#define __NVKM_FIFO_CHAN_H__ 5#define nvkm_fifo_chan(p) container_of((p), struct nvkm_fifo_chan, object) 6#include "priv.h" 7 8struct nvkm_fifo_chan_func { 9 void *(*dtor)(struct nvkm_fifo_chan *); 10 void (*init)(struct nvkm_fifo_chan *); 11 void (*fini)(struct nvkm_fifo_chan *); 12 int (*ntfy)(struct nvkm_fifo_chan *, u32 type, struct nvkm_event **); 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}; 22 23int nvkm_fifo_chan_ctor(const struct nvkm_fifo_chan_func *, struct nvkm_fifo *, 24 u32 size, u32 align, bool zero, u64 vm, u64 push, 25 u64 engines, int bar, u32 base, u32 user, 26 const struct nvkm_oclass *, struct nvkm_fifo_chan *); 27 28struct nvkm_fifo_chan_oclass { 29 int (*ctor)(struct nvkm_fifo *, const struct nvkm_oclass *, 30 void *data, u32 size, struct nvkm_object **); 31 struct nvkm_sclass base; 32}; 33 34int g84_fifo_chan_ntfy(struct nvkm_fifo_chan *, u32, struct nvkm_event **); 35#endif 36