Add the rt linux 4.1.3-rt3 as base
[kvmfornfv.git] / kernel / drivers / gpu / drm / nouveau / include / nvkm / core / event.h
diff --git a/kernel/drivers/gpu/drm/nouveau/include/nvkm/core/event.h b/kernel/drivers/gpu/drm/nouveau/include/nvkm/core/event.h
new file mode 100644 (file)
index 0000000..b98fe2d
--- /dev/null
@@ -0,0 +1,34 @@
+#ifndef __NVKM_EVENT_H__
+#define __NVKM_EVENT_H__
+#include <core/os.h>
+struct nvkm_notify;
+struct nvkm_object;
+
+struct nvkm_event {
+       const struct nvkm_event_func *func;
+
+       int types_nr;
+       int index_nr;
+
+       spinlock_t refs_lock;
+       spinlock_t list_lock;
+       struct list_head list;
+       int *refs;
+};
+
+struct nvkm_event_func {
+       int  (*ctor)(struct nvkm_object *, void *data, u32 size,
+                    struct nvkm_notify *);
+       void (*send)(void *data, u32 size, struct nvkm_notify *);
+       void (*init)(struct nvkm_event *, int type, int index);
+       void (*fini)(struct nvkm_event *, int type, int index);
+};
+
+int  nvkm_event_init(const struct nvkm_event_func *func, int types_nr,
+                    int index_nr, struct nvkm_event *);
+void nvkm_event_fini(struct nvkm_event *);
+void nvkm_event_get(struct nvkm_event *, u32 types, int index);
+void nvkm_event_put(struct nvkm_event *, u32 types, int index);
+void nvkm_event_send(struct nvkm_event *, u32 types, int index,
+                    void *data, u32 size);
+#endif