OSDN Git Service

edebd9c30c0c4b29f1a7d019f982ad5b7e43a413
[uclinux-h8/linux.git] / drivers / gpu / drm / nouveau / nvkm / engine / sw / chan.h
1 #ifndef __NVKM_SW_CHAN_H__
2 #define __NVKM_SW_CHAN_H__
3 #include "priv.h"
4 #include <core/engctx.h>
5 #include <core/event.h>
6
7 struct nvkm_sw_chan {
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;
13 };
14
15 struct nvkm_sw_chan_func {
16         bool (*mthd)(struct nvkm_sw_chan *, int subc, u32 mthd, u32 data);
17 };
18
19 bool nvkm_sw_chan_mthd(struct nvkm_sw_chan *, int subc, u32 mthd, u32 data);
20
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))
31
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
35 #endif