hid: Reduce default mouse polling interval to 60Hz
authorpopcornmix <popcornmix@gmail.com>
Mon, 14 Jul 2014 21:02:09 +0000 (22:02 +0100)
committerDom Cobley <popcornmix@gmail.com>
Mon, 21 Mar 2022 16:03:51 +0000 (16:03 +0000)
Reduces overhead when using X

drivers/hid/usbhid/hid-core.c

index 2dcaf31..8a9d821 100644 (file)
@@ -45,7 +45,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");
 
@@ -1112,7 +1112,9 @@ static int usbhid_start(struct hid_device *hid)
                 */
                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: