]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commitdiff
hid: Reduce default mouse polling interval to 60Hz
authorpopcornmix <popcornmix@gmail.com>
Mon, 14 Jul 2014 21:02:09 +0000 (22:02 +0100)
committerThadeu Lima de Souza Cascardo <cascardo@canonical.com>
Fri, 9 Mar 2018 15:20:58 +0000 (12:20 -0300)
Reduces overhead when using X

drivers/hid/usbhid/hid-core.c

index 3f11b02f9857648ba27138f39823a4017fb93d2f..09a81a447dd64887f6dbd8ec8dc402644c43b1a8 100644 (file)
@@ -48,7 +48,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");
 
@@ -1098,7 +1098,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: