hid: Reduce default mouse polling interval to 60Hz
authorpopcornmix <popcornmix@gmail.com>
Mon, 14 Jul 2014 21:02:09 +0000 (22:02 +0100)
committerRaspbian kernel package updater <root@raspbian.org>
Sat, 31 Mar 2018 14:54:17 +0000 (15:54 +0100)
Reduces overhead when using X

drivers/hid/usbhid/hid-core.c

index 22a955c5cc7e2ac83362c2bdc1a247b4776c9c08..34c9248680b2282fc23f9252825dc1f37f9309f0 100644 (file)
@@ -49,7 +49,7 @@
  * Module parameters.
  */
 
-static unsigned int hid_mousepoll_interval;
+static unsigned int hid_mousepoll_interval = ~0;
 module_param_named(mousepoll, hid_mousepoll_interval, uint, 0644);
 MODULE_PARM_DESC(mousepoll, "Polling interval of mice");
 
@@ -1099,7 +1099,9 @@ static int usbhid_start(struct hid_device *hid)
                /* Change the polling interval of mice and joysticks. */
                switch (hid->collection->usage) {
                case HID_GD_MOUSE:
-                       if (hid_mousepoll_interval > 0)
+                       if (hid_mousepoll_interval == ~0 && interval < 16)
+                               interval = 16;
+                       else if (hid_mousepoll_interval != ~0 && hid_mousepoll_interval != 0)
                                interval = hid_mousepoll_interval;
                        break;
                case HID_GD_JOYSTICK: