[PATCH 3/4] evdev: short-circuit evdev with drm to update cursors in-kernel.

Tiago Vignatti vignatti at c3sl.ufpr.br
Mon Jan 5 13:00:12 PST 2009


Signed-off-by: Tiago Vignatti <vignatti at c3sl.ufpr.br>
---
 drivers/input/evdev.c      |   11 +++++++++++
 include/linux/drm_cursor.h |    3 +++
 2 files changed, 14 insertions(+), 0 deletions(-)
 create mode 100644 include/linux/drm_cursor.h

diff --git a/drivers/input/evdev.c b/drivers/input/evdev.c
index 3524bef..2b7742e 100644
--- a/drivers/input/evdev.c
+++ b/drivers/input/evdev.c
@@ -21,6 +21,11 @@
 #include <linux/device.h>
 #include <linux/compat.h>
 
+#define DRM_CURSOR
+#ifdef DRM_CURSOR
+#include <linux/drm_cursor.h>
+#endif
+
 struct evdev {
 	int exist;
 	int open;
@@ -77,6 +82,12 @@ static void evdev_event(struct input_handle *handle,
 	event.code = code;
 	event.value = value;
 
+#ifdef DRM_CURSOR
+    /* TODO: we can do this shortcut better using a callback scheme thus
+     * drm won't be a dependency for the evdev module */
+    drm_collect_input_event(evdev->name, &event);
+#endif
+
 	rcu_read_lock();
 
 	client = rcu_dereference(evdev->grab);
diff --git a/include/linux/drm_cursor.h b/include/linux/drm_cursor.h
new file mode 100644
index 0000000..aa983d9
--- /dev/null
+++ b/include/linux/drm_cursor.h
@@ -0,0 +1,3 @@
+#include <linux/input.h>
+
+void drm_collect_input_event(const char *name, struct input_event *ev);
-- 
1.5.6.3


-- 
Tiago Vignatti
C3SL - Centro de Computação Científica e Software Livre
www.c3sl.ufpr.br



More information about the xorg mailing list