1 #ifndef __NVKM_SW_CHAN_H__
2 #define __NVKM_SW_CHAN_H__
4 #include <core/engctx.h>
5 #include <core/event.h>
8 struct nvkm_engctx base;
9 const struct nvkm_sw_chan_func *func;
10 struct nvkm_fifo_chan *fifo;
11 struct list_head head;
12 struct nvkm_event event;
15 struct nvkm_sw_chan_func {
16 bool (*mthd)(struct nvkm_sw_chan *, int subc, u32 mthd, u32 data);
19 bool nvkm_sw_chan_mthd(struct nvkm_sw_chan *, int subc, u32 mthd, u32 data);
21 #define nvkm_sw_context_create(f,p,e,c,d) \
22 nvkm_sw_chan_ctor((f), (p), (e), (c), sizeof(**d), (void **)d)
23 int nvkm_sw_chan_ctor(const struct nvkm_sw_chan_func *,
24 struct nvkm_object *, struct nvkm_object *,
25 struct nvkm_oclass *, int, void **);
26 void nvkm_sw_chan_dtor(struct nvkm_object *);
27 #define nvkm_sw_context_init(d) \
28 nvkm_engctx_init(&(d)->base)
29 #define nvkm_sw_context_fini(d,s) \
30 nvkm_engctx_fini(&(d)->base, (s))
32 #define _nvkm_sw_context_dtor nvkm_sw_chan_dtor
33 #define _nvkm_sw_context_init _nvkm_engctx_init
34 #define _nvkm_sw_context_fini _nvkm_engctx_fini