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, 19 Feb 2024 11:32:48 +0000 (11:32 +0000)
Reduces overhead when using X

drivers/hid/usbhid/hid-core.c

index 257dd73e37bf5756d18e05ad46c9476c2baa1554..d98053530124ab1d2364ae016fcf1765a8c196d7 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: