[PATCH] linux: Don't lose console events on non-evdev drivers (#29969)

Adam Jackson ajax at nwnk.net
Wed Sep 8 08:54:08 PDT 2010


On Mon, 2010-09-06 at 11:52 +1000, Peter Hutterer wrote:
> From: Thomas Hellstrom <thellstrom at vmware.com>
> 
> The drain_console() function will race with new keyboard events being added
> by the hardware causing the server to lose keyboard events if the console fd
> is used for input.
> 
> Only use the drain_console() when AllowEmptyInput is off which is the best
> indicator we have for whether the keyboard driver will be used. This patch
> will only fix the bug when hotplugging is disabled.
> What we really need is a way to figure out either whether we're _not_ using
> the keyboard driver (not predictable) or a way for the keyboard driver to
> disable drain_console().
> 
> X.Org Bug 29969 <http://bugs.freedesktop.org/show_bug.cgi?id=29969>
> 
> Signed-off-by: Thomas Hellstrom <thellstrom at vmware.com>
> Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>

Ideally, what we should do is get a way to tell the kernel to put the
console fd in a half-closed state so it doesn't bother queueing input
events to it - which is the whole reason for needing drain_console() in
the first place.  As it is we're burning an extra syscall on every
keystroke for evdev.  But even then you'd still need a way of having the
keyboard driver claim the console fd, so we can know when not to
half-close it.

Reviewed-by: Adam Jackson <ajax at redhat.com>

- ajax
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
URL: <http://lists.x.org/archives/xorg-devel/attachments/20100908/363c3076/attachment.pgp>


More information about the xorg-devel mailing list