My Xserver (kdrive, Xfbdev) driver loops too quickly
orkie at orkiesrealm.co.uk
Sun Jun 25 16:39:04 PDT 2006
I have finally written a proper driver for Xserver which allows the GP2X controls to be used as a mouse (rather than relying on USB mice, which is a bit silly for a handheld games console). However, Xserver using my driver hogs too much of the CPU for anything useful to run with any speed in the background (e.g. no window manager except twm).
I do have a theory as to why this may be the case. Xserver as far as I can tell, is designed to sit and wait for mouse data (since most mice only send data when there is something to send) from the device file. However, since GPIO (the device file you read GP2X control data from) always has data, it keeps looping too quickly when normally, it would be waiting for data, casuing the server to take over the CPU (it runs at 99% CPU usage when nothing else is doing anything, but can only get down to around 40% even if other programs need the processor time more). I could be completely wrong about the cause of the problem of course.
I have uploaded the source file for the driver (sorry, if this is not how things are done on this mailing list) and it does work to move the mouse (I added the neccessary declaration of GP2XFuncs in kdrive.h and in fbinit.c, GP2XInit is called), but has the problem I described above. http://x11.gp2x.de/downloads/gp2x.c
Does anybody have any ideas about how I can go about getting this working properly?
PS: Sorry if this ends up on here twice, I had a little trouble sending it
More information about the xorg