Android evdev change upstreaming
Android made a change to the evdev code, changing the event timestamps to use CLOCK_MONOTONIC instead of CLOCK_REALTIME. Technically this breaks Linux's ABI, so such a patch can't go upstream. This tracks work related to resolving this issue in a way that can go upstream, and then helping Android migrate over to the new approach.
The patch in question can be seen here:
http://
Blueprint information
- Status:
- Complete
- Approver:
- None
- Priority:
- Medium
- Drafter:
- John Stultz
- Direction:
- Needs approval
- Assignee:
- John Stultz
- Definition:
- Approved
- Series goal:
- Accepted for kernel-merge-window
- Implementation:
- Implemented
- Milestone target:
- 12.11
- Started by
- John Stultz
- Completed by
- John Stultz
Related branches
Related bugs
Sprints
Whiteboard
Meta:
Roadmap id: CARD-208
Headline: Android evdev upstreamed
Acceptance:
* Patch accepted to mainline
* Android userland uses ioctl
[jakub-pavelek 2012-11-16] Since this is already merged upstream, it would be good to mention either the commit or the version of released kernel that has it. If the only remaining task is to check Android userland, then we can target that to 12.11 or 12.12 (November or December), ok?
[jstultz 2012-11-27] As of Android 4.2 userland, this is being used.
See frameworks/
// Tell the kernel that we want to use the monotonic clock for reporting timestamps
// associated with input events. This is important because the input system
// uses the timestamps extensively and assumes they were recorded using the monotonic
// clock.
//
// In older kernel, before Linux 3.4, there was no way to tell the kernel which
// clock to use to input event timestamps. The standard kernel behavior was to
// record a real time timestamp, which isn't what we want. Android kernels therefore
// contained a patch to the evdev_event() function in drivers/
// replace the call to do_gettimeofday() with ktime_get_ts() to cause the monotonic
// clock to be used instead of the real time clock.
//
// As of Linux 3.4, there is a new EVIOCSCLOCKID ioctl to set the desired clock.
// Therefore, we no longer require the Android-specific kernel patch described above
// as long as we make sure to set select the monotonic clock. We do that here.
Work Items
Work items for 11.12:
[jstultz] Send patch to input list for discussion (Dec 20): DONE
[jstultz] Generate first draft patch to select timestamp clock via ioctl (http://
Work items for 12.01:
[jstultz] Send second draft ioctl selection patch to list for discussion (Jan 5): DONE
[jstultz] Got feedback on second draft, revised and sent out again (Jan 6): DONE
[jstultz] Got positive feedback on 3rd draft, added minor suggested tweaks and submitted for inclusion (Jan 9): DONE
Work items for 12.03:
[jstultz] Merge ioctl patch into mainline (March 27): DONE
Work items for 12.11:
[jstultz] Validate next userland drop of Android uses ioctl - See frameworks/
Dependency tree
* Blueprints in grey have been implemented.