Skip to content

Commit

Permalink
hid: Reduce default mouse polling interval to 60Hz
Browse files Browse the repository at this point in the history
Reduces overhead when using X
  • Loading branch information
popcornmix committed May 24, 2017
1 parent 3db4135 commit aececb2
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions drivers/hid/usbhid/hid-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");

Expand Down Expand Up @@ -1089,7 +1089,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:
Expand Down

0 comments on commit aececb2

Please sign in to comment.