summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/nouveau/core/include
diff options
context:
space:
mode:
authorBen Skeggs <bskeggs@redhat.com>2013-01-31 00:38:22 +1000
committerBen Skeggs <bskeggs@redhat.com>2013-02-20 16:00:45 +1000
commit51fa0253fbc5cdf26b85f620bf1a1034e2eda868 (patch)
tree36d746a8f1cdc17e78d74ea2288cf862af08e6c6 /drivers/gpu/drm/nouveau/core/include
parent32256c87ead3edec86bed5023a0ff96a6d907931 (diff)
downloadop-kernel-dev-51fa0253fbc5cdf26b85f620bf1a1034e2eda868.zip
op-kernel-dev-51fa0253fbc5cdf26b85f620bf1a1034e2eda868.tar.gz
drm/nouveau/core: basic event interface between core and drm
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/core/include')
-rw-r--r--drivers/gpu/drm/nouveau/core/include/core/event.h36
1 files changed, 36 insertions, 0 deletions
diff --git a/drivers/gpu/drm/nouveau/core/include/core/event.h b/drivers/gpu/drm/nouveau/core/include/core/event.h
new file mode 100644
index 0000000..9e09440
--- /dev/null
+++ b/drivers/gpu/drm/nouveau/core/include/core/event.h
@@ -0,0 +1,36 @@
+#ifndef __NVKM_EVENT_H__
+#define __NVKM_EVENT_H__
+
+/* return codes from event handlers */
+#define NVKM_EVENT_DROP 0
+#define NVKM_EVENT_KEEP 1
+
+struct nouveau_eventh {
+ struct list_head head;
+ int (*func)(struct nouveau_eventh *, int index);
+};
+
+struct nouveau_event {
+ spinlock_t lock;
+
+ void *priv;
+ void (*enable)(struct nouveau_event *, int index);
+ void (*disable)(struct nouveau_event *, int index);
+
+ int index_nr;
+ struct {
+ struct list_head list;
+ int refs;
+ } index[];
+};
+
+int nouveau_event_create(int index_nr, struct nouveau_event **);
+void nouveau_event_destroy(struct nouveau_event **);
+void nouveau_event_trigger(struct nouveau_event *, int index);
+
+void nouveau_event_get(struct nouveau_event *, int index,
+ struct nouveau_eventh *);
+void nouveau_event_put(struct nouveau_event *, int index,
+ struct nouveau_eventh *);
+
+#endif
OpenPOWER on IntegriCloud