Re: [PATCH spice-server 1/2] gl: fix client mouse mode

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

 



> 
> Hi
> 
> ----- Original Message -----
> > > 
> > > Hi
> > > 
> > > ----- Original Message -----
> > > > > 
> > > > > Hi
> > > > > 
> > > > > ----- Original Message -----
> > > > > > 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.
> > > > > > Mouse mode is always client when GL surfaces are used.
> > > > > > 
> > > > > > This patch and most of the message are based on a patch from
> > > > > > Marc-André Lureau, just moving responsibility from reds to RedQxl.
> > > > > > 
> > > > > 
> > > > > Which could cause more trouble than my approach when switching
> > > > > from/to
> > > > > 3d/2d.
> > > > > You are mixing what used to be QXL/2D-specific and QXL/GL state.
> > > > > 
> > > > > (NACK from me by principle, I didn't have time to check if it
> > > > > actually
> > > > > breaks
> > > > > 3d/2d switching)
> > > > > 
> > > > 
> > > > Which principle?
> > > > 
> > > 
> > > meaning I don't have a proof of what I argue above, I just want to warn
> > > about
> > > it, and I dislike this approach.
> > > 
> > 
> > I tried to explain in 2/2 and why looking at code responsibility
> > I think is better.
> > The result of the two changes are the same, the mouse get the display
> > size/state of either the scanout or the primary surface.
> > If you looks at the code calling reds_update_client_mouse_allowed is
> > very similar between the two statuses (2d and 3d) and it's done
> > at similar time (when you have something to display).
> 
> It's not, the protocol said that you switch to 2d display whenever a QXL/2D
> drawing command happen.
> 
> 
> But qxl_state->{x_res,y_res,use_hw_cursor,primary_active} is updated when the
> primary is created,
> 
> So if you have a primary created, then switch to 3d by gl-draw, and switch
> back to 2d by QXL draw, you'll have invalid qxl_state->{x_res,y_res,..}
> values that don't match the 2d/primary.
> 
> 

Make sense. You leave the canvas, use 3d then possibly get back to
the original canvas without 3d.

However Qemu 2.7 recreate the primary surface if resolution is
different and Qemu 2.8 have to create the primary surface.

Frediano

>  
> > > > 
> > > > > > Signed-off-by: Frediano Ziglio <fziglio@xxxxxxxxxx>
> > > > > > ---
> > > > > >  server/red-qxl.c | 7 +++++++
> > > > > >  1 file changed, 7 insertions(+)
> > > > > > 
> > > > > > diff --git a/server/red-qxl.c b/server/red-qxl.c
> > > > > > index 53f3338..896bb76 100644
> > > > > > --- a/server/red-qxl.c
> > > > > > +++ b/server/red-qxl.c
> > > > > > @@ -883,6 +883,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);
> > > > > >  }
> > > > > >  
> > > > > >  SPICE_GNUC_VISIBLE
_______________________________________________
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]