xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Stefano Stabellini <sstabellini@kernel.org>
To: Owen Smith <owen.smith@citrix.com>
Cc: anthony.perard@citrix.com, xen-devel@lists.xenproject.org,
	sstabellini@kernel.org, qemu-devel@nongnu.org, kraxel@redhat.com
Subject: Re: [PATCH 1/4] xenfb: Add feature-vkbd-standalone
Date: Thu, 8 Jun 2017 15:31:30 -0700 (PDT)	[thread overview]
Message-ID: <alpine.DEB.2.10.1706081524340.26108@sstabellini-ThinkPad-X260> (raw)
In-Reply-To: <1496927734-29174-2-git-send-email-owen.smith@citrix.com>

On Thu, 8 Jun 2017, Owen Smith wrote:
> Advertise "feature-vkbd-standalone" to indicate the backend
> can connect without a vfb device connection.
> When "request-vkbd-standalone" is set to 1, the backend does
> not wait for a QemuConsole to be setup before connecting the 
> vkbd device. This also means that absolute coordinates cannot
> be scaled to the non-existent QemuConsole's sizes, and remain
> unscaled, in the range [0, 0x7FFF].
> 
> Signed-off-by: Owen Smith <owen.smith@citrix.com>
> ---
>  hw/display/xenfb.c | 32 ++++++++++++++++++++++----------
>  1 file changed, 22 insertions(+), 10 deletions(-)
> 
> diff --git a/hw/display/xenfb.c b/hw/display/xenfb.c
> index e76c0d8..2ebc81b 100644
> --- a/hw/display/xenfb.c
> +++ b/hw/display/xenfb.c
> @@ -52,6 +52,7 @@ struct common {
>  struct XenInput {
>      struct common c;
>      int abs_pointer_wanted; /* Whether guest supports absolute pointer */
> +    int vkbd_standalone;    /* Guest supports vkbd without vfb device */
>      int button_state;       /* Last seen pointer button state */
>      int extended;
>      QEMUPutMouseEntry *qmouse;
> @@ -306,18 +307,22 @@ static void xenfb_mouse_event(void *opaque,
>  			      int dx, int dy, int dz, int button_state)
>  {
>      struct XenInput *xenfb = opaque;
> -    DisplaySurface *surface = qemu_console_surface(xenfb->c.con);
> -    int dw = surface_width(surface);
> -    int dh = surface_height(surface);
> -    int i;
> +    int i, x, y;
> +    if (xenfb->c.con != NULL) {
> +        DisplaySurface *surface = qemu_console_surface(xenfb->c.con);
> +        int dw = surface_width(surface);
> +        int dh = surface_height(surface);
> +        x = dx * (dh - 1) / 0x7fff;
> +        y = dy * (dw - 1) / 0x7fff;
> +    } else {
> +        x = dx;
> +        y = dy;
> +    }
>  
>      trace_xenfb_mouse_event(opaque, dx, dy, dz, button_state,
>                              xenfb->abs_pointer_wanted);
>      if (xenfb->abs_pointer_wanted)
> -	xenfb_send_position(xenfb,
> -			    dx * (dw - 1) / 0x7fff,
> -			    dy * (dh - 1) / 0x7fff,
> -			    dz);
> +        xenfb_send_position(xenfb, x, y, dz);
>      else
>  	xenfb_send_motion(xenfb, dx, dy, dz);
>  
> @@ -336,6 +341,7 @@ static void xenfb_mouse_event(void *opaque,
>  static int input_init(struct XenDevice *xendev)
>  {
>      xenstore_write_be_int(xendev, "feature-abs-pointer", 1);
> +    xenstore_write_be_int(xendev, "feature-vkbd-standalone", 1);
>      return 0;
>  }
>  
> @@ -345,8 +351,14 @@ static int input_initialise(struct XenDevice *xendev)
>      int rc;
>  
>      if (!in->c.con) {
> -        xen_pv_printf(xendev, 1, "ds not set (yet)\n");
> -        return -1;
> +        if (xenstore_read_fe_int(xendev, "request-vkbd-standalone",
> +                                 &in->vkbd_standalone) == -1) {
> +            in->vkbd_standalone = 0;
> +        }
> +        if (in->vkbd_standalone == 0) {
> +            xen_pv_printf(xendev, 1, "ds not set (yet)\n");
> +            return -1;
> +        }

In your changes to include/public/io/kbdif.h, make sure to write when
(at what xenstore status stage) the frontend needs to write
request-vkbd-standalone. 

This patch looks good:

Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>



>      }
>  
>      rc = common_bind(&in->c);

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

  reply	other threads:[~2017-06-08 22:31 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-08 13:15 [PATCH 0/4] xenfb: Add vkbd-only option Owen Smith
2017-06-08 13:15 ` [PATCH 1/4] xenfb: Add feature-vkbd-standalone Owen Smith
2017-06-08 22:31   ` Stefano Stabellini [this message]
2017-06-08 13:15 ` [PATCH 2/4] xenfb: Activate mouse handler Owen Smith
2017-06-08 22:33   ` Stefano Stabellini
2017-06-08 13:15 ` [PATCH 3/4] ui/input: Add activate/remove for keyboard handlers Owen Smith
2017-06-08 13:39   ` Gerd Hoffmann
2017-06-13 15:01     ` Owen Smith
2017-06-08 13:15 ` [PATCH 4/4] xenfb: Fix leak by adding/removing keyboard handler Owen Smith
2017-06-08 22:24 ` [PATCH 0/4] xenfb: Add vkbd-only option Stefano Stabellini

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=alpine.DEB.2.10.1706081524340.26108@sstabellini-ThinkPad-X260 \
    --to=sstabellini@kernel.org \
    --cc=anthony.perard@citrix.com \
    --cc=kraxel@redhat.com \
    --cc=owen.smith@citrix.com \
    --cc=qemu-devel@nongnu.org \
    --cc=xen-devel@lists.xenproject.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).