Re: [Spice-devel] [spice v10 10/27] server: Make the RedDrawable refcount thread-safe

2016-03-23 Thread Christophe Fergeau
On Wed, Mar 23, 2016 at 07:09:14AM -0400, Frediano Ziglio wrote: > > For what it's worth, the only thing which is needed is the GMainContext, > > not the full-fledged RedWorker. It seems going from RedWorker to > > QXLInstance is easy, but I did not see an obvious way of getting a > > RedWorker fro

Re: [Spice-devel] [spice v10 10/27] server: Make the RedDrawable refcount thread-safe

2016-03-23 Thread Christophe Fergeau
On Mon, Mar 21, 2016 at 07:43:20PM +0100, Francois Gouget wrote: > A completely different approach to solving this would be to handle it > all in the GStreamer encoder code: > - Only ref the RedDrawable once but wrap it in a struct with its own >refcount. It's that struct which will track th

Re: [Spice-devel] [spice v10 10/27] server: Make the RedDrawable refcount thread-safe

2016-03-23 Thread Frediano Ziglio
> > Hey, > > On Wed, Mar 23, 2016 at 05:32:22AM -0400, Frediano Ziglio wrote: > > > - But while QXLState does have a reds field, it's defined in red-qxl.c > > >so it's not accessible from red-worker.c and I have not found a > > >function that would return this information. > > > > You c

Re: [Spice-devel] [spice v10 10/27] server: Make the RedDrawable refcount thread-safe

2016-03-23 Thread Christophe Fergeau
On Mon, Mar 21, 2016 at 07:43:20PM +0100, Francois Gouget wrote: > On Thu, 3 Mar 2016, Christophe Fergeau wrote: > [...] > > Making the refcounting thread safe is one thing, but then the code > > freeing the drawable needs to be thread-safe too. red_put_drawable might > > be fine (only looked brief

Re: [Spice-devel] [spice v10 10/27] server: Make the RedDrawable refcount thread-safe

2016-03-23 Thread Christophe Fergeau
Hey, On Wed, Mar 23, 2016 at 05:32:22AM -0400, Frediano Ziglio wrote: > > - But while QXLState does have a reds field, it's defined in red-qxl.c > >so it's not accessible from red-worker.c and I have not found a > >function that would return this information. > > You could use red_qxl_ge

Re: [Spice-devel] [spice v10 10/27] server: Make the RedDrawable refcount thread-safe

2016-03-23 Thread Frediano Ziglio
> > On Thu, 3 Mar 2016, Christophe Fergeau wrote: > [...] > > Making the refcounting thread safe is one thing, but then the code > > freeing the drawable needs to be thread-safe too. red_put_drawable might > > be fine (only looked briefly), but release_resource which is a vfunc > > provided by QEM

Re: [Spice-devel] [spice v10 10/27] server: Make the RedDrawable refcount thread-safe

2016-03-21 Thread Francois Gouget
On Thu, 3 Mar 2016, Christophe Fergeau wrote: [...] > Making the refcounting thread safe is one thing, but then the code > freeing the drawable needs to be thread-safe too. red_put_drawable might > be fine (only looked briefly), but release_resource which is a vfunc > provided by QEMU seems much le

Re: [Spice-devel] [spice v10 10/27] server: Make the RedDrawable refcount thread-safe

2016-03-04 Thread Frediano Ziglio
> On Thu, Mar 03, 2016 at 12:22:39PM -0500, Frediano Ziglio wrote: > > > > No, Qemu must provide a thread safe release_resource. > > Two reasons: > > - release_resource is called from RedWorker which is a different > > thread than Qemu or other users (it's just created inside spice-server); > >

Re: [Spice-devel] [spice v10 10/27] server: Make the RedDrawable refcount thread-safe

2016-03-04 Thread Christophe Fergeau
On Thu, Mar 03, 2016 at 12:22:39PM -0500, Frediano Ziglio wrote: > > No, Qemu must provide a thread safe release_resource. > Two reasons: > - release_resource is called from RedWorker which is a different > thread than Qemu or other users (it's just created inside spice-server); > - I looked at

Re: [Spice-devel] [spice v10 10/27] server: Make the RedDrawable refcount thread-safe

2016-03-03 Thread Frediano Ziglio
> > On Tue, Mar 01, 2016 at 04:53:10PM +0100, Francois Gouget wrote: > > Signed-off-by: Francois Gouget > > --- > > > > In theory this could be needed by the next patch. > > > > server/red-parse-qxl.h | 4 ++-- > > server/red-worker.c| 7 ++- > > 2 files changed, 8 insertions(+), 3 del

Re: [Spice-devel] [spice v10 10/27] server: Make the RedDrawable refcount thread-safe

2016-03-03 Thread Christophe Fergeau
On Tue, Mar 01, 2016 at 04:53:10PM +0100, Francois Gouget wrote: > Signed-off-by: Francois Gouget > --- > > In theory this could be needed by the next patch. > > server/red-parse-qxl.h | 4 ++-- > server/red-worker.c| 7 ++- > 2 files changed, 8 insertions(+), 3 deletions(-) > > diff -

Re: [Spice-devel] [spice v10 10/27] server: Make the RedDrawable refcount thread-safe

2016-03-03 Thread Frediano Ziglio
> > On Wed, 2 Mar 2016, Frediano Ziglio wrote: > > > > > > > Signed-off-by: Francois Gouget > > > --- > > > > > > In theory this could be needed by the next patch. > > > > > > > Are you saying that now compression is done in another thread? > > Nothing has changed with regards to threading.

Re: [Spice-devel] [spice v10 10/27] server: Make the RedDrawable refcount thread-safe

2016-03-02 Thread Francois Gouget
On Wed, 2 Mar 2016, Frediano Ziglio wrote: > > > > Signed-off-by: Francois Gouget > > --- > > > > In theory this could be needed by the next patch. > > > > Are you saying that now compression is done in another thread? Nothing has changed with regards to threading. My understanding is that

Re: [Spice-devel] [spice v10 10/27] server: Make the RedDrawable refcount thread-safe

2016-03-02 Thread Frediano Ziglio
> > Signed-off-by: Francois Gouget > --- > > In theory this could be needed by the next patch. > Are you saying that now compression is done in another thread? > server/red-parse-qxl.h | 4 ++-- > server/red-worker.c| 7 ++- > 2 files changed, 8 insertions(+), 3 deletions(-) > > dif

[Spice-devel] [spice v10 10/27] server: Make the RedDrawable refcount thread-safe

2016-03-01 Thread Francois Gouget
Signed-off-by: Francois Gouget --- In theory this could be needed by the next patch. server/red-parse-qxl.h | 4 ++-- server/red-worker.c| 7 ++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/server/red-parse-qxl.h b/server/red-parse-qxl.h index 9c30572..220a096 100644