[PATCH xserver] config/udev: add input subsystem filter for udev events
Daniel Kurtz
djkurtz at google.com
Thu May 19 01:22:22 PDT 2011
libudev allows adding an efficient in-kernel filter on udev events.
Since we manually filter for ID_INPUT anyway, it seems reasonable to ask the kernel to send only events for the input subsystem.
This filtering is performed both for initial device enumeration, and for subsequent udev events.
Signed-off-by: Daniel Kurtz <djkurtz at google.com>
---
config/udev.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/config/udev.c b/config/udev.c
index 9ac34ee..189321d 100644
--- a/config/udev.c
+++ b/config/udev.c
@@ -283,6 +283,8 @@ config_udev_init(void)
if (!udev_monitor)
return 0;
+ udev_monitor_filter_add_match_subsystem_devtype(udev_monitor, "input", NULL);
+
if (udev_monitor_enable_receiving(udev_monitor)) {
ErrorF("config/udev: failed to bind the udev monitor\n");
return 0;
@@ -291,6 +293,7 @@ config_udev_init(void)
enumerate = udev_enumerate_new(udev);
if (!enumerate)
return 0;
+ udev_enumerate_add_match_subsystem(enumerate, "input");
udev_enumerate_scan_devices(enumerate);
devices = udev_enumerate_get_list_entry(enumerate);
udev_list_entry_foreach(device, devices) {
--
1.7.3.1
More information about the xorg-devel
mailing list