Commit | Line | Data |
---|---|---|
51fa0253 BS |
1 | #ifndef __NVKM_EVENT_H__ |
2 | #define __NVKM_EVENT_H__ | |
3 | ||
4 | /* return codes from event handlers */ | |
5 | #define NVKM_EVENT_DROP 0 | |
6 | #define NVKM_EVENT_KEEP 1 | |
7 | ||
8 | struct nouveau_eventh { | |
9 | struct list_head head; | |
10 | int (*func)(struct nouveau_eventh *, int index); | |
11 | }; | |
12 | ||
13 | struct nouveau_event { | |
14 | spinlock_t lock; | |
15 | ||
16 | void *priv; | |
17 | void (*enable)(struct nouveau_event *, int index); | |
18 | void (*disable)(struct nouveau_event *, int index); | |
19 | ||
20 | int index_nr; | |
21 | struct { | |
22 | struct list_head list; | |
23 | int refs; | |
24 | } index[]; | |
25 | }; | |
26 | ||
27 | int nouveau_event_create(int index_nr, struct nouveau_event **); | |
28 | void nouveau_event_destroy(struct nouveau_event **); | |
29 | void nouveau_event_trigger(struct nouveau_event *, int index); | |
30 | ||
31 | void nouveau_event_get(struct nouveau_event *, int index, | |
32 | struct nouveau_eventh *); | |
33 | void nouveau_event_put(struct nouveau_event *, int index, | |
34 | struct nouveau_eventh *); | |
35 | ||
36 | #endif |