WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] Re: [patch] pvfb: Split mouse and keyboard into separate

To: Keir Fraser <Keir.Fraser@xxxxxxxxxxxx>
Subject: Re: [Xen-devel] Re: [patch] pvfb: Split mouse and keyboard into separate devices.
From: "Daniel P. Berrange" <berrange@xxxxxxxxxx>
Date: Sat, 3 Feb 2007 03:51:03 +0000
Cc: Gerd Hoffmann <kraxel@xxxxxxx>, Xen devel list <xen-devel@xxxxxxxxxxxxxxxxxxx>, Markus Armbruster <armbru@xxxxxxxxxx>
Delivery-date: Fri, 02 Feb 2007 19:50:49 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <20070203002825.GH18218@xxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <45C36705.5080600@xxxxxxx> <C1E92F6A.8CB6%Keir.Fraser@xxxxxxxxxxxx> <20070203002825.GH18218@xxxxxxxxxx>
Reply-to: "Daniel P. Berrange" <berrange@xxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.4.1i
On Sat, Feb 03, 2007 at 12:28:25AM +0000, Daniel P. Berrange wrote:
> On Fri, Feb 02, 2007 at 06:11:54PM +0000, Keir Fraser wrote:
> > On 2/2/07 16:29, "Gerd Hoffmann" <kraxel@xxxxxxx> wrote:
> > 
> > >> I guess I'll wait for this before applying the patch then.
> > > 
> > > With Xorg 7.2, this patch, and the device id patch on top you can add
> > > this ...
> > > 
> > > Section "InputDevice"
> > >   Driver        "evdev"
> > >   Identifier    "xenptr"
> > >   Option        "SendCoreEvents" "true"
> > >   Option        "vendor"        "0x5853"
> > >   Option        "product"       "0x0003"
> > > EndSection
> > > 
> > > ... as additional (to the default /dev/input/mice) input device.  The
> > > new input device must also be added to the serverlayout section.
> > > WorksForMe[tm].
> > 
> > The complaint is that it doesn't work out of the box with current Xorg. If
> > that is a showstopper (it certainly is at the very least very undesirable!)
> > then it doesn't matter how simple the required config change is -- if any
> > change is required at all then the patch is untenable.
> > 
> > How hard would it be to contineu to provide the combined device as well as
> > the new split-out pointer device?
> 
> I've just hacked up such a version and it appears to work fine - although
> you need a slightly more complicated Xorg config to get the absolute
> pointer working.
> 
> So what the patch does is this:
> 
>   - One input device supplies both mouse & keyboard events - this is 
>     basically same as current PVFB setup (appears /dev/input/event0)
>   - A second device supplies only mouse events (/dev/input/event1)
> 
> So with a default Xorg config, X works just as before - the server sees
> the relative co-ords via its default 'mouse' driver.

Well, this all really got me wondering why are we trying to jump through
all these hoops to let have keyboard events routed differently from
mouse events. Since a single /dev/input/eventX device can provide both
keyboard and mouse events, and the evdev driver is perfectly capable of 
processing both keyboard and mouse events, why can't a single InputDevice
config do the whole job.

So I tried out:

  Section "ServerLayout"
        Identifier     "Default Layout"
        Screen      0  "Screen0" 0 0
        InputDevice    "XenInput0" "CoreKeyboard"
        InputDevice    "XenInput0" "CorePointer"
  EndSection

  Section "InputDevice"
        Identifier  "XenInput0"
        Driver      "evdev"
        Option      "Device" "/dev/input/event0"
  EndSection

This made X rather unhappy - it fails to start, segv'ing badly. So, I put 
back in the generic keyboard device and set is as the CoreKeyboard:

  Section "InputDevice"
        Identifier  "Keyboard0"
        Driver      "kbd"
        Option      "XkbModel" "pc105"
        Option      "XkbLayout" "us"
  EndSection

X now starts, but the Keyboard0 driver never sees any key events. Then it
occurred to me that perhaps if I set 'SendCoreEvents' in the XenInput0
device, the keyboard events would get merged into the feed from Keyboard0.
Which they did.  So unless I'm missing something, it would seem that all
the patches in this thread are unneccessary. We can simply have a single
input device, and have the flexibility of being able to let X autoconfigure
itself in relative mouse mode, or explicitly add the config to switch it
in absolute mouse mode. 

For the record, my complete config file which makes absolute mouse events
work is:

  Section "ServerLayout"
        Identifier     "Default Layout"
        Screen      0  "Screen0" 0 0
        InputDevice    "Keyboard0" "CoreKeyboard"
        InputDevice    "XenInput0" "CorePointer"
  EndSection

  Section "ServerFlags"
        Option      "AllowMouseOpenFail" "yes"
  EndSection

  Section "InputDevice"
        Identifier  "XenInput0"
        Driver      "evdev"
        Option      "CorePointer"
        Option      "SendCoreEvents"
        Option      "Device" "/dev/input/event0"
        Option      "XkbModel" "pc105"
        Option      "XkbLayout" "us"
  EndSection

  Section "InputDevice"
        Identifier  "Keyboard0"
        Driver      "kbd"
        Option      "XkbModel" "pc105"
        Option      "XkbLayout" "us"
  EndSection

  Section "Device"
        Identifier  "Videocard0"
        Driver      "fbdev"
  EndSection

  Section "Screen"
        Identifier "Screen0"
        Device     "Videocard0"
        DefaultDepth     24
        SubSection "Display"
                Viewport   0 0
                Depth     24
        EndSubSection
  EndSection

NB, the Fedora Core 6  evdev has a bug in it causing slightly jittery
mouse even in absolute mode, but there's trivial fix for it, and I think
the upstream version is already fixed.

Regards,
Dan.
-- 
|=- Red Hat, Engineering, Emerging Technologies, Boston.  +1 978 392 2496 -=|
|=-           Perl modules: http://search.cpan.org/~danberr/              -=|
|=-               Projects: http://freshmeat.net/~danielpb/               -=|
|=-  GnuPG: 7D3B9505   F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505  -=| 

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>