[PATCH] evdev: fix input lag when processing input from output repaint

Tiago Vignatti tiago.vignatti at linux.intel.com
Tue Mar 20 08:10:03 PDT 2012

On 03/20/2012 06:54 AM, Ander Conselvan de Oliveira wrote:
> When the compositor is in a repaint cycle, input is processed only once
> per frame. However, a call to evdev_input_device_data() would handle at
> most 8 events at time. When there was more than 8 events pending for a
> given frame, input lag would occur. This was most visible with multi
> touch input.
> This patch changes the evdev_input_device_data() so that it will handle
> all the events available in the fd. In order to do that, the fd is put
> in non-blocking mode, so that it is possible to loop on read and stop
> on EAGAIN instead of blocking.

great! This solves my problem:

     Reviewed-by: Tiago Vignatti <tiago.vignatti at intel.com>

as I said to you on the IRC, I'm a bit skeptical with an input device 
saturating Weston with DoS alike events. But I don't care now; I see 
your fix as an improvement.

Another thing, for another patch, is to eventually increase the size of 
struct input_event ev[8]. For multi-touch at least, very often the 
devices emit a lengthy burst, bigger than 8.


More information about the wayland-devel mailing list