I found that the userspace drivers are wasting a lot of CPU (~3%) while waiting, even when the touchscreen is completely idle. The only way userspace becomes knowledgeable of changes is by polling get_device_ready and get_doorbell every millisecond, and that is wasting power. Decreasing the polling frequency isn't a solution because that would only introduce latency.
There are many better alternatives to polling:
- Have
get_device_ready and get_doorbell block until new data is ready
- Support actual nonblocking IO such as
select, poll, and epoll
- Have those be blocking character devices
Additionally, I'm not sure how efficient copying the buffers to userspace is. Performance might be improved if we allow userspace to mmap the 16 buffers instead of reading from them
I found that the userspace drivers are wasting a lot of CPU (~3%) while waiting, even when the touchscreen is completely idle. The only way userspace becomes knowledgeable of changes is by polling
get_device_readyandget_doorbellevery millisecond, and that is wasting power. Decreasing the polling frequency isn't a solution because that would only introduce latency.There are many better alternatives to polling:
get_device_readyandget_doorbellblock until new data is readyselect,poll, andepollAdditionally, I'm not sure how efficient copying the buffers to userspace is. Performance might be improved if we allow userspace to
mmapthe 16 buffers instead of reading from them