Re: [PATCH spice] gl: fix client mouse mode

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi

----- Original Message -----
> 
> 
> 
> 
> 
> 
> Am Mon, 30 Jan 2017 16:50:05 +0400 schrieb marcandre.lureau:
> 
> > From: Marc-André Lureau <marcandre.lureau@xxxxxxxxxx>
> > 
> > Since 2.8, QEMU now longer creates QXL primary surfaces when using GL.
> > This change broke client-side mouse mode, because Spice server relies on
> > primary surface conditions.
> > 
> > When GL is enabled, use GL scanout informations, similar to what
> > red_qxl_get_allow_client_mouse() is doing. The main difference is that
> > the GL surface doesn't have mouse_mode attached (what for?).
> > 
> > NB: this code looks like it handles only first QXL instance only, and
> > uses the whole scanout/surface size for the input table size, perhaps
> > monitor-configs would be a better choice.
> > 
> > Signed-off-by: Marc-André Lureau <marcandre.lureau@xxxxxxxxxx>
> > ---
> > server/red-qxl.c | 2 ++
> > server/reds.c | 8 +++++++-
> > 2 files changed, 9 insertions(+), 1 deletion(-)
> > 
> > diff --git a/server/red-qxl.c b/server/red-qxl.c index
> > b6b3770b..ba7b641a 100644 --- a/server/red-qxl.c +++ b/server/red-qxl.c
> > @@ -897,6 +897,8 @@ void spice_qxl_gl_scanout(QXLInstance *qxl,
> > /* FIXME: find a way to coallesce all pending SCANOUTs */
> > dispatcher_send_message(qxl_state->dispatcher,
> > RED_WORKER_MESSAGE_GL_SCANOUT, &payload);
> > +
> > + reds_update_client_mouse_allowed(qxl_state->reds);
> > }
> > 
> > SPICE_GNUC_VISIBLE
> > diff --git a/server/reds.c b/server/reds.c index 40c94851..a89c5e90
> > 100644 --- a/server/reds.c +++ b/server/reds.c @@ -4256,10 +4256,16 @@
> > void reds_update_client_mouse_allowed(RedsState *reds)
> > if (num_active_workers > 0) {
> > GListIter it;
> > QXLInstance *qxl;
> > + SpiceMsgDisplayGlScanoutUnix *gl;
> > 
> > allow_now = TRUE; FOREACH_QXL_INSTANCE(reds, it, qxl) {
> > - if (red_qxl_get_primary_active(qxl)) {
> > + if ((gl = red_qxl_get_gl_scanout(qxl))) {
> > + x_res = gl->width;
> > + y_res = gl->height;
> > + red_qxl_put_gl_scanout(qxl, gl);
> > + break;
> > + } else if (red_qxl_get_primary_active(qxl)) {
> > allow_now = red_qxl_get_allow_client_mouse(qxl, &x_res,
> > &y_res);
> > break;
> > }
> 
> Hi,
> 
> I have tried virgl with qemu 2.8, spice 13.3 and a fedora rawhide guest but
> the mouse pointer (usbtablet) didn't move, I was just able to get the
> context menu on the desktop using the right mouse button. Now I applied this
> patch and it works for me, thank you!
> Does this patch solve the problem too?
> 
> 
> diff --git a/server/red-qxl.c b/server/red-qxl.c
> index b6b3770..1b83c50 100644
> --- a/server/red-qxl.c
> +++ b/server/red-qxl.c
> @@ -897,6 +897,13 @@ void spice_qxl_gl_scanout(QXLInstance *qxl,
> /* FIXME: find a way to coallesce all pending SCANOUTs */
> dispatcher_send_message(qxl_state->dispatcher,
> RED_WORKER_MESSAGE_GL_SCANOUT, &payload);
> +
> + qxl_state->x_res = width;
> + qxl_state->y_res = height;
> + qxl_state->use_hardware_cursor = TRUE;
> + qxl_state->primary_active = TRUE;
> +
> + reds_update_client_mouse_allowed(qxl_state->reds);
> }
> 

It could work, but it is likely going to break the switch from/to primary canvas and GL scanout that exists prior to qemu 2.8, in interesting (or not) ways.

Imho we shouldn't mix the gl scanout state and primary canvas state.

> SPICE_GNUC_VISIBLE
> 
> 
> Frediano
> 
> 
> _______________________________________________
> Spice-devel mailing list
> Spice-devel@xxxxxxxxxxxxxxxxxxxxx
> https://lists.freedesktop.org/mailman/listinfo/spice-devel
> 
_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]