From: Peter Hutterer <peter.hutterer@who-t.net>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: linux-input@vger.kernel.org,
Dmitry Torokhov <dmitry.torokhov@gmail.com>,
Jiri Kosina <jikos@kernel.org>, Harry Cutts <hcutts@chromium.org>,
Nestor Lopez Casado <nlopezcasad@logitech.com>,
Linux List Kernel Mailing <linux-kernel@vger.kernel.org>,
Benjamin Tissoires <benjamin.tissoires@redhat.com>
Subject: Re: [PATCH 4/8] HID: input: use the Resolution Multiplier for high-resolution scrolling
Date: Wed, 28 Nov 2018 09:51:11 +1000 [thread overview]
Message-ID: <20181127235111.GA7820@jelly> (raw)
In-Reply-To: <CAHk-=widz0eGFuV=bPdXenOEipZg-OTjhfownHUM7gwiZ=4tHw@mail.gmail.com>
On Mon, Nov 26, 2018 at 06:30:04PM -0800, Linus Torvalds wrote:
> On Thu, Nov 22, 2018 at 3:28 PM Peter Hutterer <peter.hutterer@who-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.
that's such a simple solution that it almost explains why I didn't think of
it... Thanks!
Cheers,
Peter
next prev parent reply other threads:[~2018-11-27 23:51 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-22 6:34 [PATCH 0/8] HID: MS and Logitech high-resolution scroll wheel support Peter Hutterer
2018-11-22 6:34 ` [PATCH 1/8] Input: add `REL_WHEEL_HI_RES` and `REL_HWHEEL_HI_RES` Peter Hutterer
2018-11-22 6:34 ` [PATCH 2/8] HID: core: store the collections as a basic tree Peter Hutterer
2018-11-22 6:34 ` [PATCH 3/8] HID: core: process the Resolution Multiplier Peter Hutterer
2018-11-22 6:34 ` [PATCH 4/8] HID: input: use the Resolution Multiplier for high-resolution scrolling Peter Hutterer
2018-11-22 23:28 ` Peter Hutterer
2018-11-27 2:17 ` Harry Cutts
2018-11-27 2:30 ` Linus Torvalds
2018-11-27 23:51 ` Peter Hutterer [this message]
2018-11-28 3:40 ` [PATCH v2 " Peter Hutterer
2018-11-22 6:34 ` [PATCH 5/8] HID: logitech-hidpp: fix typo, hiddpp to hidpp Peter Hutterer
2018-11-22 6:34 ` [PATCH 6/8] HID: logitech: Use LDJ_DEVICE macro for existing Logitech mice Peter Hutterer
2018-11-22 6:34 ` [PATCH 7/8] HID: logitech: Add function to enable HID++ 1.0 "scrolling acceleration" Peter Hutterer
2018-11-22 6:34 ` [PATCH 8/8] HID: logitech: Enable high-resolution scrolling on Logitech mice Peter Hutterer
2018-11-22 17:05 ` Linus Torvalds
2018-11-28 3:38 ` [PATCH v2 " Peter Hutterer
2018-11-28 23:03 ` [PATCH " Harry Cutts
2018-11-28 23:22 ` [PATCH 0/8] HID: MS and Logitech high-resolution scroll wheel support Harry Cutts
2018-11-29 4:27 ` Peter Hutterer
2018-11-29 10:25 ` Benjamin Tissoires
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20181127235111.GA7820@jelly \
--to=peter.hutterer@who-t.net \
--cc=benjamin.tissoires@redhat.com \
--cc=dmitry.torokhov@gmail.com \
--cc=hcutts@chromium.org \
--cc=jikos@kernel.org \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nlopezcasad@logitech.com \
--cc=torvalds@linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.