dm: virtio-input: ignore all MSC events from FE

EV_MSC is configured as INPUT_PASS_TO_ALL in input driver. There is
a loop in the use case of virtio-input. They should not be forwarded
back to BE since they have already been sent to native driver before
sending to FE.

Tracked-On: #2006
Signed-off-by: Jian Jun Chen <jian.jun.chen@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
This commit is contained in:
Jian Jun Chen 2018-12-07 15:57:32 +08:00 committed by wenlingz
parent 19fb5fa03c
commit 2ef06450dc

View File

@ -214,23 +214,19 @@ virtio_input_ignore_event(struct virtio_input_event *event)
if (!event) if (!event)
return true; return true;
/* kernel commit 29cc309d8bf19a36c5196bf626662319af6e3c0b /*
* (HID: hid-multitouch: forward MSC_TIMESTAMP) * EV_MSC is configured as INPUT_PASS_TO_ALL. In the use case of
* since kernel 4.15 * virtio-input, there is a loop as follows:
* (EV_MSC, MSC_TIMESTAMP) is added to each frame just before * - A mt frame with (EV_MSC,*,*) is passed to FE.
* the SYN event. EV_MSC is configured as INPUT_PASS_TO_ALL. * - FE will call virtinput_status to pass (EV_MSC,*,*) back to BE.
* In the use case of virtio-input, there is a loop as follows: * - BE writes this event to evdev. Because (EV_MSC,*,*)
* - A mt frame with (EV_MSC, MSC_TIMESTAMP) is passed to FE.
* - FE will call virtinput_status to pass (EV_MSC, MSC_TIMESTAMP)
* back to BE.
* - BE writes this event to evdev. Because (EV_MSC, MSC_TIMESTAMP)
* is configured as INPUT_PASS_TO_ALL, it will be written into * is configured as INPUT_PASS_TO_ALL, it will be written into
* the event buffer of evdev then be read out by BE without * the event buffer of evdev then be read out by BE without
* SYN followed. * SYN followed.
* - Each mt frame will introduce one (EV_MSC, MSC_TIMESTAMP). * - Each mt frame will introduce one (EV_MSC,*,*).
* Later the frame becomes larger and larger... * Later the frame becomes larger and larger...
*/ */
if ((event->type == EV_MSC) && (event->code == MSC_TIMESTAMP)) if (event->type == EV_MSC)
return true; return true;
return false; return false;
} }