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

From
John Stultz <hidden>
Date
2012-01-06 00:19:52
Reply to
Chase Douglas, 2012-01-05
On Thu, 2012-01-05 at 15:54 -0800, Chase Douglas wrote:
On 01/05/2012 03:28 PM, Dmitry Torokhov wrote:
quoted
Hi John,

On Thu, Jan 05, 2012 at 03:01:05PM -0800, John Stultz wrote:
quoted
 
+	case EVIOCMONTIME:
+		if (copy_from_user(&i, p, sizeof(unsigned int)))
+			return -EFAULT;
+		client->use_monotonic = i;
+		return 0;
Maybe we should let users pass not boolean but CLOCK_* value (and reject
ones that we do not support) ? This way if someone wants to use some
other clock type in the future we won't need new ioctl.
Could we also find a way to specify device time? Apple's Magic Mouse and
Magic Trackpad spit out events with their own timestamps. Maybe there
would be other devices that would support high accuracy timestamps too?
The dynamic posix clocks stuff already supports this sort of thing for
PTP, but its driver by driver, and its not all that clear that you can
read the device timestamp any old time you want (I suspect they're all
tied to device events). So it won't quite work for a clock_gettime()
style usage.

I don't really know what the best way to do this would be. We could
overload a negative clockid value, since you're not going to be wanting
thread cputime for device timestamps. But that's not super elegant
either.

But just having a specified clock id via the ioctl makes something like
what you're proposing possible.  Just a matter of how to cleanly specify
device timestamps against all the other possible ids.

thanks
-john


Thread (8 messages) 8 messages, 3 authors, last reply 2012-01-06
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help