All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] paravirtual tablet v3
@ 2011-01-14 16:35 Gerd Hoffmann
  2011-01-14 20:48 ` Anthony Liguori
  0 siblings, 1 reply; 6+ messages in thread
From: Gerd Hoffmann @ 2011-01-14 16:35 UTC (permalink / raw)
  To: qemu-devel, spice-devel

[-- Attachment #1: Type: text/plain, Size: 56 bytes --]

   Hi,

Now v3 featuring multitouch ;)

cheers,
   Gerd

[-- Attachment #2: pvtablet.h --]
[-- Type: text/x-chdr, Size: 3820 bytes --]

#ifndef __QEMU_PVTABLET__
#define __QEMU_PVTABLET__ 1

/*
 * qemu patavirtual tablet interface
 */

#include <inttypes.h>

/*
 * our virtio-serial channel name(s)
 */
#define QEMU_PVTABLET_FORMAT "org.qemu.pvtablet.%d"

enum qemu_pvtablet_type {
    QEMU_PVTABLET_MSG_INIT,
    QEMU_PVTABLET_MSG_ACK,
    QEMU_PVTABLET_MSG_POSITION,
    QEMU_PVTABLET_MSG_BTN_DOWN,
    QEMU_PVTABLET_MSG_BTN_UP,
    QEMU_PVTABLET_MSG_SYNC,
};

typedef enum qemu_pvtablet_features {
    /* none yet */
};

typedef enum qemu_pvtablet_buttons {
    QEMU_PVTABLET_BTN_LEFT,
    QEMU_PVTABLET_BTN_RIGHT,
    QEMU_PVTABLET_BTN_MIDDLE,
    QEMU_PVTABLET_BTN_SCROLL_UP,
    QEMU_PVTABLET_BTN_SCROLL_DOWN,
    /*
     * we can handle up to 32 buttons although
     * not every has a individual name ;)
     */
};

#define  QEMU_PVTABLET_BTN_MASK_LEFT        (1<<QEMU_PVTABLET_BTN_LEFT)
#define  QEMU_PVTABLET_BTN_MASK_RIGHT       (1<<QEMU_PVTABLET_BTN_RIGHT)
#define  QEMU_PVTABLET_BTN_MASK_MIDDLE      (1<<QEMU_PVTABLET_BTN_MIDDLE)
#define  QEMU_PVTABLET_BTN_MASK_SCROLL_UP   (1<<QEMU_PVTABLET_BTN_SCROLL_UP)
#define  QEMU_PVTABLET_BTN_MASK_SCROLL_DOWN (1<<QEMU_PVTABLET_BTN_SCROLL_DOWN)

/*
 * QEMU_PVTABLET_MSG_INIT, host -> guest
 * First message.  Sent before any other event.
 */
typedef struct qemu_pvtablet_init {
    uint32_t features;        /* qemu_pvtablet_features */
    uint32_t res_x;           /* x axis resolution */
    uint32_t res_y;           /* y axis resolution */
    uint32_t buttons_mask;    /* mouse buttons available */
    uint32_t max_pressure;    /* 0 == no pressure supported */
    uint32_t max_points;      /* 1 == no multitouch */
    uint8_t  have_point_ids;
} qemu_pvtablet_init;

/*
 * QEMU_PVTABLET_MSG_ACK, guest -> host
 * Sent after pvtablet_init.  Host will not send
 * additional messages until this is received.
 */
typedef struct qemu_pvtablet_ack {
    uint32_t features; /* qemu_pvtable_features */
};

/*
 * QEMU_PVTABLET_MSG_BTN_{DOWN,UP}, host -> guest
 * Send button press+release events.
 */
typedef struct qemu_pvtablet_button {
    uint32_t button;    /* which button was pressed/released */
    uint32_t mask;      /* which buttons are currently pressed */
} qemu_pvtablet_button;

/*
 * QEMU_PVTABLET_MSG_POSITION, host -> guest
 * Send pointer/finger move events.
 *
 * Multitouch devices without point id support send one message per
 * touch point in each message group in unspecified order.
 *
 * Multitouch devices with point id support send messages only for
 * touch points which did change.  IDs are added by just using them
 * for the first time.  IDs are invalidated by using them in a "lift"
 * message (aka pressure == 0).
 */
typedef struct qemu_pvtablet_position {
    uint32_t pos_x;
    uint32_t pos_y;
    uint32_t pressure;
    uint32_t point_id;
} qemu_pvtablet_position;

/*
 * QEMU_PVTABLET_MSG_SYNC, host -> guest
 * Marks the end of a message group which belongs together
 * and carries the time stamp for all those events.
 *
 * The timestamp is specified in nanoseconds.  Timebase is undefined.
 * This is supposed to be used to figure how much time passed between
 * two events, to decide whenever two mouse clicks should be
 * interpreted as double click or not and simliar stuff.
 */
typedef struct qemu_pvtablet_sync {
    uint64_t timestamp;
};


typedef struct qemu_pvtablet_header {
    uint32_t size;            /* whole message size */
    uint32_t type;            /* qemu_pvtablet_type */
} qemu_pvtablet_header;

typedef union qemu_pvtablet_payload {
    qemu_pvtablet_init     init;
    qemu_pvtablet_ack      ack;
    qemu_pvtablet_position position;
    qemu_pvtablet_button   button;
};

typedef struct qemu_pvtablet_message {
    qemu_pvtablet_header  hdr;
    qemu_pvtablet_payload data;
} qemu_pvtablet_message;

#endif /* __QEMU_PVTABLET__ */

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Qemu-devel] paravirtual tablet v3
  2011-01-14 16:35 [Qemu-devel] paravirtual tablet v3 Gerd Hoffmann
@ 2011-01-14 20:48 ` Anthony Liguori
  2011-01-17  8:19   ` Gerd Hoffmann
  0 siblings, 1 reply; 6+ messages in thread
From: Anthony Liguori @ 2011-01-14 20:48 UTC (permalink / raw)
  To: Gerd Hoffmann; +Cc: spice-devel, qemu-devel

On 01/14/2011 10:35 AM, Gerd Hoffmann wrote:
>   Hi,
>
> Now v3 featuring multitouch ;)
>
> cheers,
>   Gerd

I really think multitouch needs to be a feature such that the guest can 
nack it and the host can adjust accordingly.  If it's there from day 1, 
that's fine, but it still should be a feature.

There are a lot of non-multitouch aware guests out there and I don't 
think we want the driver to be the one deciding how to map a multitouch 
device to something that doesn't support mulitouch.

Regards,

Anthony Liguori

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Qemu-devel] paravirtual tablet v3
  2011-01-14 20:48 ` Anthony Liguori
@ 2011-01-17  8:19   ` Gerd Hoffmann
  2011-01-17 15:02     ` Anthony Liguori
  0 siblings, 1 reply; 6+ messages in thread
From: Gerd Hoffmann @ 2011-01-17  8:19 UTC (permalink / raw)
  To: Anthony Liguori; +Cc: spice-devel, qemu-devel

On 01/14/11 21:48, Anthony Liguori wrote:
> On 01/14/2011 10:35 AM, Gerd Hoffmann wrote:
>> Hi,
>>
>> Now v3 featuring multitouch ;)
>>
>> cheers,
>> Gerd
>
> I really think multitouch needs to be a feature such that the guest can
> nack it and the host can adjust accordingly. If it's there from day 1,
> that's fine, but it still should be a feature.
>
> There are a lot of non-multitouch aware guests out there and I don't
> think we want the driver to be the one deciding how to map a multitouch
> device to something that doesn't support mulitouch.

Sure, someone needs to map multitouch to non-multitouch.  I'd leave that 
job to the guest driver tough.  Why do you think doing it in the host is 
better?

cheers,
   Gerd

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Qemu-devel] paravirtual tablet v3
  2011-01-17  8:19   ` Gerd Hoffmann
@ 2011-01-17 15:02     ` Anthony Liguori
  2011-01-18 13:46       ` Gerd Hoffmann
  0 siblings, 1 reply; 6+ messages in thread
From: Anthony Liguori @ 2011-01-17 15:02 UTC (permalink / raw)
  To: Gerd Hoffmann; +Cc: spice-devel, qemu-devel

On 01/17/2011 02:19 AM, Gerd Hoffmann wrote:
> On 01/14/11 21:48, Anthony Liguori wrote:
>> On 01/14/2011 10:35 AM, Gerd Hoffmann wrote:
>>> Hi,
>>>
>>> Now v3 featuring multitouch ;)
>>>
>>> cheers,
>>> Gerd
>>
>> I really think multitouch needs to be a feature such that the guest can
>> nack it and the host can adjust accordingly. If it's there from day 1,
>> that's fine, but it still should be a feature.
>>
>> There are a lot of non-multitouch aware guests out there and I don't
>> think we want the driver to be the one deciding how to map a multitouch
>> device to something that doesn't support mulitouch.
>
> Sure, someone needs to map multitouch to non-multitouch.  I'd leave 
> that job to the guest driver tough.  Why do you think doing it in the 
> host is better?

My assumptions are 1) the host is capable of doing the mapping just as 
easily as the guest 2) the host can do something useful with the 
information that the guest is not multitouch capable.

Regards,

Anthony Liguori

>
> cheers,
>   Gerd
>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Qemu-devel] paravirtual tablet v3
  2011-01-17 15:02     ` Anthony Liguori
@ 2011-01-18 13:46       ` Gerd Hoffmann
  2011-01-18 15:20         ` Anthony Liguori
  0 siblings, 1 reply; 6+ messages in thread
From: Gerd Hoffmann @ 2011-01-18 13:46 UTC (permalink / raw)
  To: Anthony Liguori; +Cc: spice-devel, qemu-devel

   Hi,

>> Sure, someone needs to map multitouch to non-multitouch. I'd leave
>> that job to the guest driver tough. Why do you think doing it in the
>> host is better?
>
> My assumptions are 1) the host is capable of doing the mapping just as
> easily as the guest

Probably.

> 2) the host can do something useful with the
> information that the guest is not multitouch capable.

What do you think of here?

cheers,
   Gerd

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Qemu-devel] paravirtual tablet v3
  2011-01-18 13:46       ` Gerd Hoffmann
@ 2011-01-18 15:20         ` Anthony Liguori
  0 siblings, 0 replies; 6+ messages in thread
From: Anthony Liguori @ 2011-01-18 15:20 UTC (permalink / raw)
  To: Gerd Hoffmann; +Cc: spice-devel, qemu-devel

On 01/18/2011 07:46 AM, Gerd Hoffmann wrote:
>   Hi,
>
>>> Sure, someone needs to map multitouch to non-multitouch. I'd leave
>>> that job to the guest driver tough. Why do you think doing it in the
>>> host is better?
>>
>> My assumptions are 1) the host is capable of doing the mapping just as
>> easily as the guest
>
> Probably.
>
>> 2) the host can do something useful with the
>> information that the guest is not multitouch capable.
>
> What do you think of here?

Imagine a nice looking GUI, you would likely have icons representing the 
mouse status.   You've got at least PS/2 mouse, PS/2 mouse with capture, 
PV mouse in absolute mode, PV mouse in multitouch mode, etc.

VirtualBox has an interface like this FWIW (although not multitouch aware).

Regards,

Anthony Liguori

>
> cheers,
>   Gerd
>
>

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2011-01-18 15:20 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-01-14 16:35 [Qemu-devel] paravirtual tablet v3 Gerd Hoffmann
2011-01-14 20:48 ` Anthony Liguori
2011-01-17  8:19   ` Gerd Hoffmann
2011-01-17 15:02     ` Anthony Liguori
2011-01-18 13:46       ` Gerd Hoffmann
2011-01-18 15:20         ` Anthony Liguori

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.