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

[Xen-devel] [PATCH] linux-2.6.18: xen-kbdfront - advertise either absolu

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH] linux-2.6.18: xen-kbdfront - advertise either absolute or relative coordinates
From: Olaf Hering <olaf@xxxxxxxxx>
Date: Wed, 18 May 2011 10:40:03 +0200
Delivery-date: Wed, 18 May 2011 01:42:03 -0700
Dkim-signature: v=1; a=rsa-sha1; c=relaxed/relaxed; t=1305708031; l=3186; s=domk; d=aepfle.de; h=To:From:Date:Subject:Content-Transfer-Encoding:MIME-Version: Content-Type:X-RZG-CLASS-ID:X-RZG-AUTH; bh=qgt6M/JSqXqr8lpIpqrmufQQ5Yc=; b=OjrMyx8dNfUZRaQoEhIuuGNlSjqixc21W1t3NcvAP87lnwVSdllsi8EeiROH7/v1BPn CY6lb/ffDba5u9PEPO+UdqVPVGIqvtJj7yFfYzBM4i8JoBbwM0ZnW0EZ8d5hkj5LvqdgE tPoFWz5c2smhPEA/vWsgVNYSwB0nXK9jai4=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
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/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mercurial-patchbomb/1.7.5
# HG changeset patch
# User Olaf Hering <olaf@xxxxxxxxx>
# Date 1305707817 -7200
# Node ID cde21d04a199dec594fc83e35d71e40beb3a7daf
# Parent  aa2a7493b2027936d4b6224a324f8a7ae65a8e95
linux-2.6.18: xen-kbdfront - advertise either absolute or relative coordinates

Mainline commit 8c3c283e6bf463ab498d6e7823aff6c4762314b6
Mainline commit c36b58e8a9112017c2bcc322cc98e71241814303

    A virtualized display device is usually viewed with the vncviewer
    application, either by 'xm vnc domU' or with vncviewer localhost:port.
    vncviewer and the RFB protocol provides absolute coordinates to the
    virtual display. These coordinates are either passed through to a PV
    guest or converted to relative coordinates for a HVM guest.

    A PV guest receives these coordinates and passes them to the kernels
    evdev driver. There it can be picked up by applications such as the
    xorg-input drivers. Using absolute coordinates avoids issues such as
    guest mouse pointer not tracking host mouse pointer due to wrong mouse
    acceleration settings in the guests X display.

    Advertise either absolute or relative coordinates to the input system
    and the evdev driver, depending on what dom0 provides. The xorg-input
    driver prefers relative coordinates even if a devices provides both.

    Signed-off-by: Olaf Hering <olaf@xxxxxxxxx>
    Signed-off-by: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
    Signed-off-by: Dmitry Torokhov <dtor@xxxxxxx>

diff -r aa2a7493b202 -r cde21d04a199 drivers/xen/fbfront/xenkbd.c
--- a/drivers/xen/fbfront/xenkbd.c      Mon May 16 13:26:45 2011 +0100
+++ b/drivers/xen/fbfront/xenkbd.c      Wed May 18 10:36:57 2011 +0200
@@ -104,7 +104,7 @@ static irqreturn_t input_handler(int rq,
 int __devinit xenkbd_probe(struct xenbus_device *dev,
                           const struct xenbus_device_id *id)
 {
-       int ret, i;
+       int ret, i, abs;
        struct xenkbd_info *info;
        struct input_dev *kbd, *ptr;
 
@@ -123,6 +123,11 @@ int __devinit xenkbd_probe(struct xenbus
        info->page->in_cons = info->page->in_prod = 0;
        info->page->out_cons = info->page->out_prod = 0;
 
+       if (xenbus_scanf(XBT_NIL, dev->otherend, "feature-abs-pointer", "%d", 
&abs) < 0)
+               abs = 0;
+       if (abs)
+               xenbus_printf(XBT_NIL, dev->nodename, "request-abs-pointer", 
"1");
+
        /* keyboard */
        kbd = input_allocate_device();
        if (!kbd)
@@ -155,12 +160,20 @@ int __devinit xenkbd_probe(struct xenbus
        ptr->id.bustype = BUS_PCI;
        ptr->id.vendor = 0x5853;
        ptr->id.product = 0xfffe;
-       ptr->evbit[0] = BIT(EV_KEY) | BIT(EV_REL) | BIT(EV_ABS);
+
+       if (abs) {
+               __set_bit(EV_ABS, ptr->evbit);
+               input_set_abs_params(ptr, ABS_X, 0, XENFB_WIDTH, 0, 0);
+               input_set_abs_params(ptr, ABS_Y, 0, XENFB_HEIGHT, 0, 0);
+       } else {
+               __set_bit(REL_X, ptr->relbit);
+               __set_bit(REL_Y, ptr->relbit);
+       }
+       __set_bit(REL_WHEEL, ptr->relbit);
+
+       __set_bit(EV_KEY, ptr->evbit);
        for (i = BTN_LEFT; i <= BTN_TASK; i++)
-               set_bit(i, ptr->keybit);
-       ptr->relbit[0] = BIT(REL_X) | BIT(REL_Y) | BIT(REL_WHEEL);
-       input_set_abs_params(ptr, ABS_X, 0, XENFB_WIDTH, 0, 0);
-       input_set_abs_params(ptr, ABS_Y, 0, XENFB_HEIGHT, 0, 0);
+               __set_bit(i, ptr->keybit);
 
        ret = input_register_device(ptr);
        if (ret) {

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH] linux-2.6.18: xen-kbdfront - advertise either absolute or relative coordinates, Olaf Hering <=