[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHk-=widz0eGFuV=bPdXenOEipZg-OTjhfownHUM7gwiZ=4tHw@mail.gmail.com>
Date: Mon, 26 Nov 2018 18:30:04 -0800
From: Linus Torvalds <torvalds@...ux-foundation.org>
To: Peter Hutterer <peter.hutterer@...-t.net>
Cc: linux-input@...r.kernel.org,
Dmitry Torokhov <dmitry.torokhov@...il.com>,
Jiri Kosina <jikos@...nel.org>,
Harry Cutts <hcutts@...omium.org>,
Nestor Lopez Casado <nlopezcasad@...itech.com>,
Linux List Kernel Mailing <linux-kernel@...r.kernel.org>,
Benjamin Tissoires <benjamin.tissoires@...hat.com>
Subject: Re: [PATCH 4/8] HID: input: use the Resolution Multiplier for
high-resolution scrolling
On Thu, Nov 22, 2018 at 3:28 PM Peter Hutterer <peter.hutterer@...-t.net> wrote:
>
> The device sends hi-res values of 4, so it should end up as REL_WHEEL_HI_RES
> 30. We are getting 28 instead which doesn't add up to a nice 120.
I think you're just doing the math in the wrong order.
Why don't you just do
update = val * 120 / multiplier
which gives you the expected "30".
It seems you have done the "120 / multiplier" too early, and you force
that value into "wheel_factor". Don't. Do all the calculations
(including all the accumulated ones) in the original values, and only
do the "multiply by 120 and divide by multiplier" at the very end.
Hmm?
Linus
Powered by blists - more mailing lists