From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Anshul Garg <aksgarg1989@gmail.com>
Cc: linux-input@vger.kernel.org,
"anshul.g@samsung.com" <anshul.g@samsung.com>
Subject: Re: [Question : drivers/input ] Fixing Event Filter Mechanism in input subsystem
Date: Mon, 22 Dec 2014 09:26:22 -0800 [thread overview]
Message-ID: <20141222172622.GA18556@dtor-ws> (raw)
In-Reply-To: <CA+HOOsgL_fY=Wc+ciDAuk485d=uTn=YTgVGVDJ5Qk3UsqQ8zVA@mail.gmail.com>
Hi Anshul,
On Mon, Dec 22, 2014 at 10:36:09PM +0530, Anshul Garg wrote:
> In function input_pass_values in input.c file , input core sends all
> events to each handler associated with the input device ,
>
> rcu_read_lock();
>
> handle = rcu_dereference(dev->grab);
> if (handle) {
> count = input_to_handler(handle, vals, count);
> } else {
> list_for_each_entry_rcu(handle, &dev->h_list, d_node)
> if (handle->open)
> count = input_to_handler(handle, vals, count);
> }
>
> after this in input_to_handler function events are filtered and sent
> to the handler.
>
> for (v = vals; v != vals + count; v++) {
> if (handler->filter &&
> handler->filter(handle, v->type, v->code, v->value))
> continue;
> if (end != v)
> *end = *v;
> end++;
> }
>
>
>
> But as per previous event filter mechanism all the events should be
> parsed from all
> handlers after that remaining events should be sent to handlers list.
>
> And in comments also its mentioned as
>
> /*
> * Pass event first through all filters and then, if event has not been
> * filtered out, through all open handles.*/
>
> So current approach to filter events seems to be incorrect.
>
> Please help to clarify my query.
When you "grab" input device your handler gets exclusive access to all
events coming form it. Neither filer handlers nor regular input handlers
receive events from this device until you release it.
So I believe it works as intended.
Thanks.
--
Dmitry
next prev parent reply other threads:[~2014-12-22 17:26 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-12-22 17:06 [Question : drivers/input ] Fixing Event Filter Mechanism in input subsystem Anshul Garg
2014-12-22 17:26 ` Dmitry Torokhov [this message]
2014-12-23 1:22 ` Anshul Garg
2014-12-23 14:34 ` Anshul Garg
2014-12-24 18:25 ` Dmitry Torokhov
2014-12-25 5:41 ` Anshul Garg
2014-12-26 23:46 ` Dmitry Torokhov
2014-12-29 15:04 ` Anshul Garg
-- strict thread matches above, loose matches on Subject: below --
2014-12-22 13:13 Anshul Garg
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=20141222172622.GA18556@dtor-ws \
--to=dmitry.torokhov@gmail.com \
--cc=aksgarg1989@gmail.com \
--cc=anshul.g@samsung.com \
--cc=linux-input@vger.kernel.org \
/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).