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: PVFB wheel events (z-axis)

To: Pat Campbell <plc@xxxxxxxxxx>
Subject: Re: [Xen-devel] Re: PVFB wheel events (z-axis)
From: Markus Armbruster <armbru@xxxxxxxxxx>
Date: Thu, 28 Feb 2008 10:02:12 +0100
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Thu, 28 Feb 2008 01:29:10 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <87prui1j8n.fsf@xxxxxxxxxxxxxxxxx> (Markus Armbruster's message of "Wed\, 27 Feb 2008 17\:01\:28 +0100")
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: <87tzk19xqf.fsf@xxxxxxxxxxxxxxxxx> <47C0287F.5070901@xxxxxxxxxx> <87bq656tzb.fsf@xxxxxxxxxxxxxxxxx> <47C2FE4D.1030502@xxxxxxxxxx> <87prui1j8n.fsf@xxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux)
Markus Armbruster <armbru@xxxxxxxxxx> writes:

> All right, I think I understand now how this works.
>
> 1. X reports wheel motion as button 4 & 5.
>
> 2. VNC viewer duly transmits that into QEMU.
>
> 3. QEMU converts it to -1/+1 on z-axis (pointer_event() in vnc.c).
>
> 4. Your patch transmits that to the vkbd frontend.
>
>    Bug: struct xenkbd_position claims abs_z is absolute, which is not
>    true.

Patch appended.

>    Question: is that the protocol we want?  More below.
>
> 5. The vkbd frontend stuffs the z-axis motion into the input layer as
>    REL_WHEEL, with the sign reversed.
>
>    Bug: it ignores movement other than -1/+1.  A case can be made for
>    ignoring 0.
>
>    Bug: when it acts on z-axis movement, it ignores x/y movement /
>    position.

Fixed in changeset 439:1edfea26a2a9

> 6. X converts the wheel movement back to button 4 & 5.
[...]


diff -r 43de9d7c3c63 drivers/xen/fbfront/xenkbd.c
--- a/drivers/xen/fbfront/xenkbd.c      Tue Feb 26 17:59:18 2008 +0000
+++ b/drivers/xen/fbfront/xenkbd.c      Thu Feb 28 09:44:59 2008 +0100
@@ -66,7 +66,7 @@ static irqreturn_t input_handler(int rq,
                case XENKBD_TYPE_MOTION:
                        if (event->motion.rel_z)
                                input_report_rel(dev, REL_WHEEL,
-                                                0 - event->motion.rel_z);
+                                                -event->motion.rel_z);
                        input_report_rel(dev, REL_X, event->motion.rel_x);
                        input_report_rel(dev, REL_Y, event->motion.rel_y);
                        break;
@@ -84,9 +84,9 @@ static irqreturn_t input_handler(int rq,
                                       event->key.keycode);
                        break;
                case XENKBD_TYPE_POS:
-                       if (event->pos.abs_z)
+                       if (event->pos.rel_z)
                                input_report_rel(dev, REL_WHEEL,
-                                                0 - event->pos.abs_z);
+                                                -event->pos.rel_z);
                        input_report_abs(dev, ABS_X, event->pos.abs_x);
                        input_report_abs(dev, ABS_Y, event->pos.abs_y);
                        break;
diff -r 43de9d7c3c63 include/xen/interface/io/kbdif.h
--- a/include/xen/interface/io/kbdif.h  Tue Feb 26 17:59:18 2008 +0000
+++ b/include/xen/interface/io/kbdif.h  Thu Feb 28 09:44:59 2008 +0100
@@ -65,7 +65,7 @@ struct xenkbd_position
     uint8_t type;        /* XENKBD_TYPE_POS */
     int32_t abs_x;       /* absolute X position (in FB pixels) */
     int32_t abs_y;       /* absolute Y position (in FB pixels) */
-    int32_t abs_z;       /* absolute Z position (wheel) */
+    int32_t rel_z;       /* relative Z motion (wheel) */
 };
 
 #define XENKBD_IN_EVENT_SIZE 40

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