All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eamon Walsh <ewalsh@tycho.nsa.gov>
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: Olaf Hering <olaf@aepfle.de>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: [PATCH] fbfront: advertise either absolute or relative coordinates
Date: Thu, 10 Mar 2011 14:58:17 -0500	[thread overview]
Message-ID: <4D792D59.9040801@tycho.nsa.gov> (raw)
In-Reply-To: <alpine.DEB.2.00.1103101912200.2968@kaball-desktop>

We have had an issue here where the "request-abs-pointer" key is appearing in XenStore _after_ the backend has gone to the Connected state.  Qemu xenfb.c checks for this key in the "connect()" callback, causing it to miss the key and default to relative coordinates.

xen be: vkbd-0: frontend update: page-ref
xen be: vkbd-0: frontend not ready (yet)
xen be: vkbd-0: frontend update: page-gref
xen be: vkbd-0: frontend not ready (yet)
xen be: vkbd-0: frontend update: event-channel
xen be: vkbd-0: frontend not ready (yet)
xen be: vkbd-0: frontend state: Initialising -> Initialised
xen be: vkbd-0: frontend update: state
xen be: vkbd-0: bind evtchn port 53
xen be: vkbd-0: ring ref 13, remote-port 11, local-port 53
xen be: vkbd-0: backend state: InitWait -> Connected               <----
xen be: vkbd-0: backend update: state
xen be: vkbd-0: frontend update: request-abs-pointer               <----
xen be: vkbd-0: frontend state: Initialised -> Connected
xen be: vkbd-0: frontend update: state


This could be a problem specific to our display server, and it only happens sometimes. But we have been carrying the patch below in our xenfb.c.  It makes sense to respond to a direct watch on the key itself instead of looking for it at a state change.  This may be suitable for upstream to Qemu.

I also note that the check in Qemu was previously made even before the connected state.  It was changed in July, see:
http://web.archiveorange.com/archive/v/1XS1v5z9uIQLGujGBDhT


diff --git a/src/xenfb.c b/src/xenfb.c
index a822057..5aade4c 100644
--- a/src/xenfb.c
+++ b/src/xenfb.c
@@ -181,10 +181,6 @@ static int input_connect(struct XenDevice *xendev)
     struct XenInput *in = container_of(xendev, struct XenInput, c.xendev);
     int rc;
 
-    if (xenstore_read_fe_int(xendev, "request-abs-pointer",
-                             &in->abs_pointer_wanted) == -1)
-	in->abs_pointer_wanted = 0;
-
     rc = common_bind(&in->c);
     if (rc != 0)
 	return rc;
@@ -199,6 +195,17 @@ static void input_disconnect(struct XenDevice *xendev)
     xen_linpicker_input_disconnect(in);
 }
 
+static void input_frontend_changed(struct XenDevice *xendev, const char *node)
+{
+    struct XenInput *in = container_of(xendev, struct XenInput, c.xendev);
+
+    if (strcmp(node, "request-abs-pointer") == 0) {
+	if (xenstore_read_fe_int(xendev, "request-abs-pointer",
+				 &in->abs_pointer_wanted) < 0)
+	    in->abs_pointer_wanted = 0;
+    }
+}
+
 static void input_event(struct XenDevice *xendev)
 {
     struct XenInput *xenfb = container_of(xendev, struct XenInput, c.xendev);
@@ -754,6 +761,7 @@ struct XenDevOps xen_kbdmouse_ops = {
     .connect    = input_connect,
     .disconnect = input_disconnect,
     .event      = input_event,
+    .frontend_changed = input_frontend_changed,
 };
 
 struct XenDevOps xen_framebuffer_ops = {

  reply	other threads:[~2011-03-10 19:58 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-10 17:58 [PATCH] fbfront: advertise either absolute or relative coordinates Olaf Hering
2011-03-10 18:09 ` Stefano Stabellini
2011-03-10 18:14   ` Olaf Hering
2011-03-10 19:15     ` Stefano Stabellini
2011-03-10 19:58       ` Eamon Walsh [this message]
2011-03-11 11:58         ` Stefano Stabellini
2011-03-11 12:44           ` John Haxby
2011-03-11 12:54             ` Stefano Stabellini
2011-03-11 12:43         ` John Haxby

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4D792D59.9040801@tycho.nsa.gov \
    --to=ewalsh@tycho.nsa.gov \
    --cc=olaf@aepfle.de \
    --cc=stefano.stabellini@eu.citrix.com \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.