Hello all,

Thanks to the folks at RPath [0], we were able to understood and patch
a bug that was making Splashy impossible to use from initramfs on
Linux [1] (while using init and not upstart to start all user-space
applications).

The problem happens when the TTY from which Splashy is started gets
modified while the application is running (again, refer to RPath's
detailed ticket). The modification of this special file causes the
keyboard event function on directfb [2], to go into an infinite loop,
taking more and more CPU power as the boot process goes along.

Apparently the solution to this problem is to simply release some CPU
cycles on the keyboardEventThread. This is done by simple applying the
following patch:

--- directfb-0.9.25.1.orig/inputdrivers/keyboard/keyboard.c
+++ directfb-0.9.25.1/inputdrivers/keyboard/keyboard.c
@@ -279,6 +279,8 @@

              keyboard_set_lights( data, evt.locks );
         }
+          if (readlen <= 0)
+                usleep(2000);
    }

    if (readlen <= 0 && errno != EINTR)

(Note that this is the same fix for directfb 1.1.x)

However, this patch just fixes the CPU hogging issue and does not
actually correct the problem. In other words, at this point directfb
is not able to handle keyboard events at all. A more complete solution
would be to allow directfb to be assigned a specific TTY during
initiation (say when directfb is init or from some some configuration
option). Allowing directfb to simply do VT_OPENQRY ioctl calls to get
the next unused tty does not work when the system's init process has
not yet taken over the "initiation" of the system (and especially when
udev has not started to create the special devices on /dev).

We thought that since this patch is so small and simple, this could be
easily included in a next bug release for directfb so that we can
release Splashy with initramfs on by default for all distributions
(especially Debian/Ubuntu). A more general solution would involve
doing other changes to the code and this might take longer to get it
right.

Thank you all for your time,

-- 
----)(-----
Luis Mondesi
Maestro Debiano

----- START ENCRYPTED BLOCK (Triple-ROT13) ------
Gur Hohagh [Yvahk] qvfgevohgvba oevatf gur fcvevg bs Hohagh gb gur
fbsgjner jbeyq.
----- END ENCRYPTED BLOCK (Triple-ROT13) ------


[0] https://issues.rpath.com/browse/RPL-1593
[1] http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=383060
[2] inputdrivers/keyboard/keyboard.c: keyboardEventThread(
DirectThread *thread, void *driver_data )

_______________________________________________
directfb-dev mailing list
[email protected]
http://mail.directfb.org/cgi-bin/mailman/listinfo/directfb-dev

Reply via email to