linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [Question : drivers/input ] Fixing Event Filter Mechanism in input subsystem
@ 2014-12-22 17:06 Anshul Garg
  2014-12-22 17:26 ` Dmitry Torokhov
  0 siblings, 1 reply; 9+ messages in thread
From: Anshul Garg @ 2014-12-22 17:06 UTC (permalink / raw)
  To: Dmitry Torokhov, linux-input, dtor; +Cc: anshul.g@samsung.com

Dear Mr. Dmitry and Linux Community,

I am Anshul Garg working on Linux Kernel from last 2 years .

I have one query regarding event filter mechanism in input subsystem.
Can you please help in answering my query as below:

==============================
=======================
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.


I have prepared one patch with new event filter mechanism which will
first filter all events from attached handlers then pass the remaining
events after being filtered
through all handlers unlike current implementation.

Once My query is resolved , I will send the patch.


Thanks
Anshul Garg
+91-9899777351

^ permalink raw reply	[flat|nested] 9+ messages in thread
* [Question : drivers/input ] Fixing Event Filter Mechanism in input subsystem
@ 2014-12-22 13:13 Anshul Garg
  0 siblings, 0 replies; 9+ messages in thread
From: Anshul Garg @ 2014-12-22 13:13 UTC (permalink / raw)
  To: Dmitry Torokhov; +Cc: anshul.g@samsung.com, linux-input

Dear Mr. Dmitry and Linux Community,

I am Anshul Garg working on Linux Kernel from last 2 years .

I have one query regarding event filter mechanism in input subsystem.
Can you please help in answering my query as below:

=====================================================
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.


I have prepared one patch with new event filter mechanism which will
first filter all events from attached handlers then pass the remaining
events after being filtered
through all handlers unlike current implementation.

Once My query is resolved , I will send the patch.


Thanks
Anshul Garg
+91-9899777351

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2014-12-29 15:04 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-22 17:06 [Question : drivers/input ] Fixing Event Filter Mechanism in input subsystem Anshul Garg
2014-12-22 17:26 ` Dmitry Torokhov
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

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).