hid: Reduce default mouse polling interval to 60Hz

Reduces overhead when using X
This commit is contained in:
popcornmix
2014-07-14 22:02:09 +01:00
parent 38f57c8239
commit 678443aa88

View 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");
@@ -1083,8 +1083,12 @@ static int usbhid_start(struct hid_device *hid)
}
/* Change the polling interval of mice. */
if (hid->collection->usage == HID_GD_MOUSE && hid_mousepoll_interval > 0)
interval = hid_mousepoll_interval;
if (hid->collection->usage == HID_GD_MOUSE) {
if (hid_mousepoll_interval == ~0 && interval < 16)
interval = 16;
else if (hid_mousepoll_interval != ~0 && hid_mousepoll_interval != 0)
interval = hid_mousepoll_interval;
}
ret = -ENOMEM;
if (usb_endpoint_dir_in(endpoint)) {