1 #ifndef __NVKM_EVENT_H__
2 #define __NVKM_EVENT_H__
4 /* return codes from event handlers */
5 #define NVKM_EVENT_DROP 0
6 #define NVKM_EVENT_KEEP 1
8 /* nouveau_eventh.flags bit #s */
9 #define NVKM_EVENT_ENABLE 0
11 struct nouveau_eventh {
12 struct nouveau_event *event;
13 struct list_head head;
17 int (*func)(void *, u32, int);
21 struct nouveau_event {
23 int (*check)(struct nouveau_event *, u32 type, int index);
24 void (*enable)(struct nouveau_event *, int type, int index);
25 void (*disable)(struct nouveau_event *, int type, int index);
31 struct list_head *list;
36 int nouveau_event_create(int types_nr, int index_nr, struct nouveau_event **);
37 void nouveau_event_destroy(struct nouveau_event **);
38 void nouveau_event_trigger(struct nouveau_event *, u32 types, int index);
40 int nouveau_event_new(struct nouveau_event *, u32 types, int index,
41 int (*func)(void *, u32, int), void *,
42 struct nouveau_eventh **);
43 void nouveau_event_ref(struct nouveau_eventh *, struct nouveau_eventh **);
44 void nouveau_event_get(struct nouveau_eventh *);
45 void nouveau_event_put(struct nouveau_eventh *);