From: Henrik Rydberg <rydberg@bitmath.org>
To: Roderick Colenbrander <roderick@gaikai.com>, linux-input@vger.kernel.org
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>,
Benjamin Tissoires <benjamin.tissoires@redhat.com>,
Tim Bird <tim.bird@am.sony.com>,
Roderick Colenbrander <roderick.colenbrander@sony.com>
Subject: Re: [PATCH] Input: mt: only perform pointer emulation on drivers desiring this functionality
Date: Fri, 28 Oct 2016 00:46:54 +0200 [thread overview]
Message-ID: <a1875ed3-56c1-18e7-6cd2-49486c9d1d08@bitmath.org> (raw)
In-Reply-To: <1477603873-9143-1-git-send-email-roderick@gaikai.com>
Hi Roderick,
> Pointer emulation is undesired on drivers, which didn't request this
> capability like the hid-sony driver for the Dualshock 4. This gamepad already
> reports ABS_X / ABS_Y for gamepad stick purposes. Pointer emulation would
> inject touchpad values into these sticks, which is undesired.
>
> This patch checks the flags INPUT_MT_POINTER / INPUT_MT_DIRECT from within
> input_mt_sync_frame to only allow pointer emulation when the feature was
> requested by the driver as the flags were set in input_mt_init_slots.
So why call input_mt_sync_frame() in the first place?
The existing drivers that use ABS_X / ABS_Y independently do not call that
function. It seems your recent hid-sony patches adds it, which leads to broken
behavior.
> ---
> drivers/input/input-mt.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/input/input-mt.c b/drivers/input/input-mt.c
> index a1bbec9..30c8128 100644
> --- a/drivers/input/input-mt.c
> +++ b/drivers/input/input-mt.c
> @@ -305,7 +305,8 @@ void input_mt_sync_frame(struct input_dev *dev)
> if ((mt->flags & INPUT_MT_POINTER) && !(mt->flags & INPUT_MT_SEMI_MT))
> use_count = true;
>
> - input_mt_report_pointer_emulation(dev, use_count);
> + if (mt->flags & (INPUT_MT_POINTER | INPUT_MT_DIRECT))
> + input_mt_report_pointer_emulation(dev, use_count);
>
> mt->frame++;
> }
>
That said, I am not against this patch at all, I think it is good, but the
commit message should address the effect on the large number of existing drivers
that use this functionality. Is any of them affected by this patch? As you
probably know, we do not like to break userspace.
>From what I can see, only hid-multitouch (Benjamin?) and hid-sony use
input_mt_init_slots() in such a way that MT_POINTER or MT_DIRECT cannot be
directly inferred. So if Benjamin sees no issues with this, I am ok with the change.
Thanks,
Henrik
next prev parent reply other threads:[~2016-10-27 23:03 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-27 21:31 [PATCH] Input: mt: only perform pointer emulation on drivers desiring this functionality Roderick Colenbrander
2016-10-27 21:36 ` Bird, Timothy
2016-10-27 22:46 ` Henrik Rydberg [this message]
2016-10-27 23:27 ` Roderick Colenbrander
2016-10-27 23:19 ` Dmitry Torokhov
2016-10-27 23:46 ` Roderick Colenbrander
2016-10-27 23:54 ` Dmitry Torokhov
2016-10-28 0:10 ` Roderick Colenbrander
-- strict thread matches above, loose matches on Subject: below --
2016-10-30 15:04 Frank Praznik
2016-10-30 18:45 ` Colenbrander, Roelof
2016-11-03 10:43 ` Benjamin Tissoires
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=a1875ed3-56c1-18e7-6cd2-49486c9d1d08@bitmath.org \
--to=rydberg@bitmath.org \
--cc=benjamin.tissoires@redhat.com \
--cc=dmitry.torokhov@gmail.com \
--cc=linux-input@vger.kernel.org \
--cc=roderick.colenbrander@sony.com \
--cc=roderick@gaikai.com \
--cc=tim.bird@am.sony.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).