mirror of
https://github.com/torvalds/linux.git
synced 2026-06-07 22:14:04 +02:00
UPSTREAM: Input: reset device timestamp on sync
We need to reset input device's timestamp on input_sync(), otherwise drivers not using input_set_timestamp() will end up with a stale timestamp after their clients consume first input event. Bug: 150896413 Fixes:3b51c44bd6("Input: allow drivers specify timestamp for input events") Reported-by: John Stultz <john.stultz@linaro.org> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> (cherry picked from commit4370b231d1) Signed-off-by: Hridya Valsaraju <hridya@google.com> Change-Id: I35b76cbed146a4ee8e021388eb7a68282daf9003
This commit is contained in:
parent
e6ae32babb
commit
8c219ccb7b
|
|
@ -400,6 +400,13 @@ static void input_handle_event(struct input_dev *dev,
|
|||
if (dev->num_vals >= 2)
|
||||
input_pass_values(dev, dev->vals, dev->num_vals);
|
||||
dev->num_vals = 0;
|
||||
/*
|
||||
* Reset the timestamp on flush so we won't end up
|
||||
* with a stale one. Note we only need to reset the
|
||||
* monolithic one as we use its presence when deciding
|
||||
* whether to generate a synthetic timestamp.
|
||||
*/
|
||||
dev->timestamp[INPUT_CLK_MONO] = ktime_set(0, 0);
|
||||
} else if (dev->num_vals >= dev->max_vals - 2) {
|
||||
dev->vals[dev->num_vals++] = input_value_sync;
|
||||
input_pass_values(dev, dev->vals, dev->num_vals);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user