linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Is delayed work's precision good enough for input-poller?
@ 2020-11-12 15:30 Nicolas Saenz Julienne
  2020-11-13  1:46 ` Dmitry Torokhov
  0 siblings, 1 reply; 2+ messages in thread
From: Nicolas Saenz Julienne @ 2020-11-12 15:30 UTC (permalink / raw)
  To: Dmitry Torokhov; +Cc: linux-input

[-- Attachment #1: Type: text/plain, Size: 1020 bytes --]

Hi everyone,
I just found about an issue in the downstream Raspberry Pi[1] kernel that I
wonder if it'd be worth fixing generally. The official RPi DSI display
touchscreen uses the polled input interface. The ts chip works at around 60Hz,
and that's the period the driver is configured to use (17ms). This doesn't play
too good on systems with low HZ (100/250). Users complain that in practice they
experience, at worst, half the event rate. This is due to the rounding error
when converting milliseconds to jiffies, general system delays, and what not.

We could somewhat fix this in the driver (raspberrypi-ts.c) by playing with the
poll rate. But it seems pretty hacky and would ultimately stress the CPU
unnecessarily. I wonder to what extent it makes sense to move the
implementation to using hrtimers whenever the poll period is in the same order
of magnitude as HZ's delta.

Any ideas/comments?

Regards,
Nicolas

[1] https://github.com/raspberrypi/linux/issues/3777#issuecomment-698346991


[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Is delayed work's precision good enough for input-poller?
  2020-11-12 15:30 Is delayed work's precision good enough for input-poller? Nicolas Saenz Julienne
@ 2020-11-13  1:46 ` Dmitry Torokhov
  0 siblings, 0 replies; 2+ messages in thread
From: Dmitry Torokhov @ 2020-11-13  1:46 UTC (permalink / raw)
  To: Nicolas Saenz Julienne; +Cc: linux-input

Hi Nicolas,

On Thu, Nov 12, 2020 at 04:30:49PM +0100, Nicolas Saenz Julienne wrote:
> Hi everyone,
> I just found about an issue in the downstream Raspberry Pi[1] kernel that I
> wonder if it'd be worth fixing generally. The official RPi DSI display
> touchscreen uses the polled input interface. The ts chip works at around 60Hz,
> and that's the period the driver is configured to use (17ms). This doesn't play
> too good on systems with low HZ (100/250). Users complain that in practice they
> experience, at worst, half the event rate. This is due to the rounding error
> when converting milliseconds to jiffies, general system delays, and what not.
> 
> We could somewhat fix this in the driver (raspberrypi-ts.c) by playing with the
> poll rate. But it seems pretty hacky and would ultimately stress the CPU
> unnecessarily. I wonder to what extent it makes sense to move the
> implementation to using hrtimers whenever the poll period is in the same order
> of magnitude as HZ's delta.
> 
> Any ideas/comments?

The polling function in the poller is supposed to be able to sleep, so
you will still have to schedule work which will introduce additional
delay.

If that works for you then I'd be OK with switching to hrtimers for
small poll intervals.

Thanks.

-- 
Dmitry

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-11-13  1:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-11-12 15:30 Is delayed work's precision good enough for input-poller? Nicolas Saenz Julienne
2020-11-13  1:46 ` Dmitry Torokhov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).