From: Jason Hu <redacted>
Add ACPI binding to the goldfish events driver.
Signed-off-by: Jason Hu <redacted>
Signed-off-by: Jin Qian <redacted>
Signed-off-by: Alan <redacted>
---
drivers/input/keyboard/goldfish_events.c | 8 ++++++++
1 file changed, 8 insertions(+)
From: Lingfeng Yang <redacted>
If we send SYN_REPORT on every single multi-touch event, it breaks the
multi-touch.
The multi-touch becomes jerky and you have to click 2-3 times to do things
while randomly activating notification bars when not clicking.
If we suppress these SYN_REPORTS, multi-touch will work fine and the events
will have a protocol that looks nice.
We need to register Goldfish Events as a multi-touch device by issuing
input_mt_init_slots, otherwise input_handle_abs_event in drivers/input/input.c
will silently drop all ABS_MT_SLOT events, causing touches of more than one
finger to fail.
Signed-off-by: Lingfeng Yang <redacted>
Signed-off-by: Jin Qian <redacted>
Signed-off-by: Alan Cox <redacted>
---
drivers/input/keyboard/goldfish_events.c | 30 +++++++++++++++++++++++++++++-
1 file changed, 29 insertions(+), 1 deletion(-)
On Fri, Feb 26, 2016 at 06:50:21PM +0000, Alan wrote:
quoted hunk
From: Lingfeng Yang <redacted>
If we send SYN_REPORT on every single multi-touch event, it breaks the
multi-touch.
The multi-touch becomes jerky and you have to click 2-3 times to do things
while randomly activating notification bars when not clicking.
If we suppress these SYN_REPORTS, multi-touch will work fine and the events
will have a protocol that looks nice.
We need to register Goldfish Events as a multi-touch device by issuing
input_mt_init_slots, otherwise input_handle_abs_event in drivers/input/input.c
will silently drop all ABS_MT_SLOT events, causing touches of more than one
finger to fail.
Signed-off-by: Lingfeng Yang <redacted>
Signed-off-by: Jin Qian <redacted>
Signed-off-by: Alan Cox <redacted>
---
drivers/input/keyboard/goldfish_events.c | 30 +++++++++++++++++++++++++++++-
1 file changed, 29 insertions(+), 1 deletion(-)
That would be error in that keyboard driver and should be fixed.
+ * Note that sending an extra SYN_REPORT is not
+ * necessary nor correct protocol with other
+ * devices such as touchscreens, which will send
+ * their own SYN_REPORT's when sufficient event
+ * information has been collected (e.g., for
+ * touchscreens, when pressure and X/Y coordinates
+ * have been received). Hence, we will only send
+ * this extra SYN_REPORT if type == EV_KEY.
+ */
+ if (type == EV_KEY)
+ input_sync(edev->input);
I'd rather we always rely on the host to send the SYN event.
quoted hunk
+
return IRQ_HANDLED;
}
@@ -154,6 +173,15 @@ static int events_probe(struct platform_device *pdev) input_dev->name = edev->name; input_dev->id.bustype = BUS_HOST;+ /*+ * Set the Goldfish Device to be multi-touch.+ * If we do not issue input_mt_init_slots,+ * the kernel will filter out needed ABS_MT_SLOT+ * events when we touch the screen in more than one place,+ * preventing multi-touch with more than one finger from working.+ * See drivers/input/input.c:input_handle_abs_event.+ */+ input_mt_init_slots(input_dev, GOLDFISH_MAX_FINGERS, 0);
Can we use data retrieved by events_import_abs_params() to set up
correct number of slots? Also we need error handling. And possibly
retrieve correct properties to set pass to input_mt_init_slots()...
On Fri, Feb 26, 2016 at 06:49:56PM +0000, Alan wrote:
quoted hunk
From: Jason Hu <redacted>
Add ACPI binding to the goldfish events driver.
Signed-off-by: Jason Hu <redacted>
Signed-off-by: Jin Qian <redacted>
Signed-off-by: Alan <redacted>
---
drivers/input/keyboard/goldfish_events.c | 8 ++++++++
1 file changed, 8 insertions(+)
input_event(edev->input, type, code, value);
- input_sync(edev->input);
+ /*
+ * Send an extra (EV_SYN, SYN_REPORT, 0x0) event
+ * if a key was pressed. Some keyboard device
+ * drivers may only send the EV_KEY event and
+ * not EV_SYN.
That would be error in that keyboard driver and should be fixed.
Agreed but it's still the case that current and long standing Goldfish
behaviour requires the above.
quoted
+ * Note that sending an extra SYN_REPORT is not
+ * necessary nor correct protocol with other
+ * devices such as touchscreens, which will send
+ * their own SYN_REPORT's when sufficient event
+ * information has been collected (e.g., for
+ * touchscreens, when pressure and X/Y coordinates
+ * have been received). Hence, we will only send
+ * this extra SYN_REPORT if type == EV_KEY.
+ */
+ if (type == EV_KEY)
+ input_sync(edev->input);
I'd rather we always rely on the host to send the SYN event.
That would certainly make sense for the future.
quoted
+
return IRQ_HANDLED;
}
@@ -154,6 +173,15 @@ static int events_probe(struct platform_device
*pdev)
input_dev->name = edev->name;
input_dev->id.bustype = BUS_HOST;
+ /*
+ * Set the Goldfish Device to be multi-touch.
+ * If we do not issue input_mt_init_slots,
+ * the kernel will filter out needed ABS_MT_SLOT
+ * events when we touch the screen in more than one place,
+ * preventing multi-touch with more than one finger from
working.
+ * See drivers/input/input.c:input_handle_abs_event.
+ */
+ input_mt_init_slots(input_dev, GOLDFISH_MAX_FINGERS, 0);
Can we use data retrieved by events_import_abs_params() to set up
correct number of slots? Also we need error handling. And possibly
retrieve correct properties to set pass to input_mt_init_slots()...
Again - I agree that makes sense for future versions of Goldfish
Alan