Thread (4 messages) flat view 4 messages, 4 authors, 2012-01-09

Re: [RFC][PATCH] Input: Add infrastrucutre for selecting clockid for event time stamps.

From: Arve Hjønnevåg <arve@android.com>
Date: 2012-01-09 22:49:11

On Mon, Jan 9, 2012 at 10:04 AM, Dmitry Torokhov
[off-list ref] wrote:
On Sat, Jan 07, 2012 at 02:42:32PM +0800, Daniel Kurtz wrote:
quoted
On Sat, Jan 7, 2012 at 11:40 AM, John Stultz [off-list ref] wrote:
quoted
 static void evdev_pass_event(struct evdev_client *client,
-                            struct input_event *event)
+                            struct input_event *event,
+                            ktime_t mono, ktime_t real)
 {
+       struct timespec ts;
+
+       if (client->timestamp_clkid == CLOCK_MONOTONIC)
+               ts = ktime_to_timespec(mono);
+       else
+               ts = ktime_to_timespec(real);
+       event->time.tv_sec = ts.tv_sec;
+       event->time.tv_usec = ts.tv_nsec / NSEC_PER_USEC;
Maybe just:

 event->time = (client->timestamp_clkid == CLOCK_MONOTONIC) ?
                      ktime_to_timeval(mono) : ktime_to_timeval(real);

Either way, lgtm...

Reviewed-by: Daniel Kurtz <redacted>
I'm OK with the patch but do we actually have a buy-in from
Android/Chrome folks for this? If they will actually use it I'll apply
it, otherwise I'll sit on it.
Yes, this seems reasonable to me.

-- 
Arve Hjønnevåg
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help