Re: [Spice-devel] [PATCH spice-common] marshaller: track if add_fd() was given -1

2016-01-22 Thread Marc-André Lureau
Hi - Original Message - > > > > In some cases, it might be worth to be able to send a message with a -1 > > fd, has the protocol permits. Change add_fd/get_fd in order to track > > if the caller wanted to send -1. > > > > Signed-off-by: Marc-André Lureau > > --- > > common/marshaller.c

Re: [Spice-devel] [RFC PATCH] worker: remove dependencies from red-worker.h

2016-01-22 Thread Jonathon Jongsma
In general, it sounds like good stuff, but can we wait with this stuff until after we finish merging the refactory branch? I haven't looked in detail, but it seems to me that at least some of this stuff is already handled in the refactory branch (for instance, there is a common-worker-channel.[ch]

[Spice-devel] [RFC PATCH] worker: remove dependencies from red-worker.h

2016-01-22 Thread Frediano Ziglio
This patch try to make sure that CursorChannel and DisplayChannel don't know RedWorker existence. Definition common to CursorChannel and DisplayChannel are moved to a new common-channel.h header. RedWorker pointers are removed from CommonChannel and CommonChannelClient. red_drawable_ref declaration

Re: [Spice-devel] [PATCH spice-common] marshaller: track if add_fd() was given -1

2016-01-22 Thread Frediano Ziglio
> > In some cases, it might be worth to be able to send a message with a -1 > fd, has the protocol permits. Change add_fd/get_fd in order to track > if the caller wanted to send -1. > > Signed-off-by: Marc-André Lureau > --- > common/marshaller.c | 23 +++ > common/marshalle

Re: [Spice-devel] [PATCH v3 2/9] tests: make sure that the default rule builds all tests

2016-01-22 Thread Frediano Ziglio
> > The default rule being "all", it builds noinst_PROGRAMS but not > check_PROGRAMS. Let's build all the tests by default. > > Signed-off-by: Marc-André Lureau Acked-by: Frediano Ziglio Frediano > --- > server/tests/Makefile.am | 18 -- > 1 file changed, 8 insertions(+), 10

[Spice-devel] [PATCH v3 8/9] Handle GL_DRAW messages

2016-01-22 Thread Marc-André Lureau
Create an async, and marshall the GL_DRAW message. Count number of clients, and wait until gl_draw_async_count is 0 to complete the async. The count is going to be updated in the following patch when the client is done with the draw. Signed-off-by: Marc-André Lureau --- server/dcc-send.c

[Spice-devel] [PATCH v3 6/9] Handle GL_SCANOUT messages

2016-01-22 Thread Marc-André Lureau
Go through dispatcher and marshall scanout message. Since the marshaller and the QXL state are manipulated from different threads, add a mutex to protect the current scanout. Signed-off-by: Marc-André Lureau --- server/dcc-send.c| 25 + server/dcc.c |

[Spice-devel] [PATCH v3 9/9] Handle GL_DRAW_DONE

2016-01-22 Thread Marc-André Lureau
When a client is done with drawing and sends SPICE_MSGC_DISPLAY_GL_DRAW_DONE, or when it ends, update the number of async counts. Signed-off-by: Marc-André Lureau --- server/dcc.c | 21 + server/display-channel.c | 8 server/display-channel.h | 1 + 3 f

[Spice-devel] [PATCH v3 2/9] tests: make sure that the default rule builds all tests

2016-01-22 Thread Marc-André Lureau
The default rule being "all", it builds noinst_PROGRAMS but not check_PROGRAMS. Let's build all the tests by default. Signed-off-by: Marc-André Lureau --- server/tests/Makefile.am | 18 -- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/server/tests/Makefile.am b/s

[Spice-devel] [PATCH v3 5/9] Add new spice-gl stubs API

2016-01-22 Thread Marc-André Lureau
- spice_gl_scanout() to take the current scanout - spice_gl_draw_async() to draw the scanout, is like other Spice async functions, it takes a cookie and will return in the QXLInterface.async_complete() Two new fields are also added to QXLState, in order to save the current scanout, and the pe

[Spice-devel] [PATCH v3 7/9] Send current GL scanout to new client

2016-01-22 Thread Marc-André Lureau
Signed-off-by: Marc-André Lureau --- server/dcc.c | 11 +++ 1 file changed, 11 insertions(+) diff --git a/server/dcc.c b/server/dcc.c index eb63ce6..58ae55c 100644 --- a/server/dcc.c +++ b/server/dcc.c @@ -445,6 +445,7 @@ void dcc_start(DisplayChannelClient *dcc) { DisplayChannel *

[Spice-devel] [PATCH v3 1/9] tests: link test-qxl-parsing with libserver

2016-01-22 Thread Marc-André Lureau
Signed-off-by: Marc-André Lureau --- server/tests/Makefile.am | 6 +- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/server/tests/Makefile.am b/server/tests/Makefile.am index fea2181..2161023 100644 --- a/server/tests/Makefile.am +++ b/server/tests/Makefile.am @@ -91,8 +91,4 @@

[Spice-devel] [PATCH v3 4/9] red-channel: return number of created pipe items

2016-01-22 Thread Marc-André Lureau
This is useful in the following patches to count the number of replies to wait for. Signed-off-by: Marc-André Lureau --- server/red-channel.c | 19 +-- server/red-channel.h | 2 +- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/server/red-channel.c b/server/red-

[Spice-devel] [PATCH v3 0/9] Add OpenGL scanout drawing

2016-01-22 Thread Marc-André Lureau
See the related protocol changes for message details. 2 new functions are exported: - spice_gl_scanout() to specify the current scanout. The server will then own the given fd. It will keep the most recent version to set upcoming clients scanout with the up to date version. - spice_gl_draw_asyn

[Spice-devel] [PATCH v3 3/9] red-channel: send marshaller message fd

2016-01-22 Thread Marc-André Lureau
From: Marc-André Lureau Send the fd associated to the last message sent. Signed-off-by: Marc-André Lureau --- server/red-channel.c | 14 ++ spice-common | 2 +- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/server/red-channel.c b/server/red-channel.c index

[Spice-devel] [PATCH spice-common] marshaller: track if add_fd() was given -1

2016-01-22 Thread Marc-André Lureau
In some cases, it might be worth to be able to send a message with a -1 fd, has the protocol permits. Change add_fd/get_fd in order to track if the caller wanted to send -1. Signed-off-by: Marc-André Lureau --- common/marshaller.c | 23 +++ common/marshaller.h | 3 ++- 2 fil

Re: [Spice-devel] [PATCH server v2 10/13] Handle GL_SCANOUT messages

2016-01-22 Thread Marc-André Lureau
Hi On Fri, Jan 22, 2016 at 4:04 PM, Marc-André Lureau wrote: > Yes, that's a valid concern. In practice, nothing terribly wrong happens > since opengl accepts any texture coordinates, and the rendering depends on > various parameters (wrap, clamp etc) > > I think I can address this with a seria

[Spice-devel] Adaptive compression choice? [was: Re: [PATCH spice 1/3] dcc_compress_image: Handle NULL drawable]

2016-01-22 Thread David Jaša
Hi Frediano, On Čt, 2016-01-14 at 12:52 -0500, Frediano Ziglio wrote: > > > > On Thu, 2016-01-14 at 12:07 -0500, Frediano Ziglio wrote: > > > > > > > > On Thu, Jan 14, 2016 at 10:27:02AM -0500, Frediano Ziglio wrote: > > > > > Had a small discussion with Pavel. > > > > > We agree that original

Re: [Spice-devel] [PATCH server v2 11/13] Send current GL scanout to new client

2016-01-22 Thread Marc-André Lureau
Hi On Fri, Jan 22, 2016 at 4:15 PM, Frediano Ziglio wrote: > That's because all display state is mainly in DisplayChannel (like > monitors_config). > This patch make clear that DisplayChannel has to know RedWorker which has to > know > QXL. > You will note that calls to red_worker_get_qxl are r

Re: [Spice-devel] [PATCH 11/15] Store 'renderers' as GArray in RedsState

2016-01-22 Thread Frediano Ziglio
> > From: Jonathon Jongsma > > --- > server/display-channel.c | 13 +++-- > server/display-channel.h | 3 +-- > server/reds-private.h| 2 ++ > server/reds.c| 20 > server/reds.h| 5 ++--- > 5 files changed, 24 insertions(+), 19 deletio

Re: [Spice-devel] [PATCH server v2 11/13] Send current GL scanout to new client

2016-01-22 Thread Frediano Ziglio
> Hi > > - Original Message - > > > > > > Signed-off-by: Marc-André Lureau > > > --- > > > server/dcc.c | 11 +++ > > > 1 file changed, 11 insertions(+) > > > > > > diff --git a/server/dcc.c b/server/dcc.c > > > index 3161375..193d630 100644 > > > --- a/server/dcc.c > > > +++

Re: [Spice-devel] [PATCH server v2 10/13] Handle GL_SCANOUT messages

2016-01-22 Thread Marc-André Lureau
Hi - Original Message - > > > > Hi > > > > - Original Message - > > > > > > > > Go through dispatcher and marshall scanout message. Since the > > > > marshaller > > > > and the QXL state are manipulated from different threads, add a mutex > > > > to > > > > protect the current s

Re: [Spice-devel] [PATCH server v2 10/13] Handle GL_SCANOUT messages

2016-01-22 Thread Frediano Ziglio
> > Hi > > - Original Message - > > > > > > Go through dispatcher and marshall scanout message. Since the marshaller > > > and the QXL state are manipulated from different threads, add a mutex to > > > protect the current scanout. > > > > > > Signed-off-by: Marc-André Lureau > > > ---

Re: [Spice-devel] [PATCH server v2 09/13] Add new spice-gl stubs API

2016-01-22 Thread Frediano Ziglio
> > Hi > > - Original Message - > > > > > > - spice_gl_scanout() to take the current scanout > > > > > > - spice_gl_draw_async() to draw the scanout, is like other Spice async > > > functions, it takes a cookie and will return in the > > > QXLInterface.async_complete() > > > > > >

Re: [Spice-devel] [PATCH server v2 11/13] Send current GL scanout to new client

2016-01-22 Thread Marc-André Lureau
Hi - Original Message - > > > > Signed-off-by: Marc-André Lureau > > --- > > server/dcc.c | 11 +++ > > 1 file changed, 11 insertions(+) > > > > diff --git a/server/dcc.c b/server/dcc.c > > index 3161375..193d630 100644 > > --- a/server/dcc.c > > +++ b/server/dcc.c > > @@ -445

Re: [Spice-devel] [PATCH server v2 10/13] Handle GL_SCANOUT messages

2016-01-22 Thread Marc-André Lureau
Hi - Original Message - > > > > Go through dispatcher and marshall scanout message. Since the marshaller > > and the QXL state are manipulated from different threads, add a mutex to > > protect the current scanout. > > > > Signed-off-by: Marc-André Lureau > > --- > > server/dcc-send.c

Re: [Spice-devel] [PATCH server v2 11/13] Send current GL scanout to new client

2016-01-22 Thread Frediano Ziglio
> > Signed-off-by: Marc-André Lureau > --- > server/dcc.c | 11 +++ > 1 file changed, 11 insertions(+) > > diff --git a/server/dcc.c b/server/dcc.c > index 3161375..193d630 100644 > --- a/server/dcc.c > +++ b/server/dcc.c > @@ -445,6 +445,7 @@ void dcc_start(DisplayChannelClient *dcc) >

Re: [Spice-devel] [PATCH server v2 10/13] Handle GL_SCANOUT messages

2016-01-22 Thread Frediano Ziglio
> > Go through dispatcher and marshall scanout message. Since the marshaller > and the QXL state are manipulated from different threads, add a mutex to > protect the current scanout. > > Signed-off-by: Marc-André Lureau > --- > server/dcc-send.c| 25 + > server/d

Re: [Spice-devel] [PATCH server v2 09/13] Add new spice-gl stubs API

2016-01-22 Thread Marc-André Lureau
Hi - Original Message - > > > > - spice_gl_scanout() to take the current scanout > > > > - spice_gl_draw_async() to draw the scanout, is like other Spice async > > functions, it takes a cookie and will return in the > > QXLInterface.async_complete() > > > > Two new fields are also a

Re: [Spice-devel] [PATCH server v2 09/13] Add new spice-gl stubs API

2016-01-22 Thread Frediano Ziglio
> > - spice_gl_scanout() to take the current scanout > > - spice_gl_draw_async() to draw the scanout, is like other Spice async > functions, it takes a cookie and will return in the > QXLInterface.async_complete() > > Two new fields are also added to QXLState, in order to save the current >

Re: [Spice-devel] [PATCH server v2 08/13] red-channel: return number of created pipe items

2016-01-22 Thread Frediano Ziglio
> > This is useful in the following patches to count the number of replies > to wait for. > I was looking at the entire set of patches. I think the gl_draw_async_count counter is much better be incremented before sending the PIPE_ITEM_TYPE_GL_DRAW. This will avoid entirely this patch. Also look

Re: [Spice-devel] [PATCH server v2 05/13] red-channel: send marshaller message fd

2016-01-22 Thread Marc-André Lureau
Hi - Original Message - > > > > Hi > > > > On Fri, Jan 15, 2016 at 11:44 AM, Frediano Ziglio > > wrote: > > >> > > >> From: Marc-André Lureau > > >> > > >> Send the fd associated to the last message sent. > > >> > > >> Even if the fd is invalid, the sendfd msg is appended to the protoc

Re: [Spice-devel] [PATCH server v2 06/13] channel: document pipes_create_batch() function

2016-01-22 Thread Frediano Ziglio
> > Rename callback to pipe_add, and document the arguments. > > Signed-off-by: Marc-André Lureau > --- > server/red-channel.c | 16 > 1 file changed, 12 insertions(+), 4 deletions(-) > > diff --git a/server/red-channel.c b/server/red-channel.c > index b33c91d..7296820 100644

Re: [Spice-devel] [PATCH server v2 05/13] red-channel: send marshaller message fd

2016-01-22 Thread Frediano Ziglio
> > Hi > > On Fri, Jan 15, 2016 at 11:44 AM, Frediano Ziglio wrote: > >> > >> From: Marc-André Lureau > >> > >> Send the fd associated to the last message sent. > >> > >> Even if the fd is invalid, the sendfd msg is appended to the protocol, > >> for 2 reasons: > >> - trying to send an invalid

Re: [Spice-devel] [PATCH v4 0/5] Event loop improves

2016-01-22 Thread Frediano Ziglio
> > On Wed, Jan 20, 2016 at 10:15:42AM -0500, Frediano Ziglio wrote: > > > diff --git a/server/tests/Makefile.am b/server/tests/Makefile.am > > > index 6f02c99..000b097 100644 > > > --- a/server/tests/Makefile.am > > > +++ b/server/tests/Makefile.am > > > @@ -27,10 +27,15 @@ libtest_a_SOURCES =

Re: [Spice-devel] [PATCH server v2 00/13] Add OpenGL scanout drawing

2016-01-22 Thread Frediano Ziglio
> > Hi > > On Thu, Jan 14, 2016 at 10:01 PM, Marc-André Lureau > wrote: > > See the related protocol changes for message details. > > > > 2 new functions are exported: > > - spice_gl_scanout() to specify the current scanout. The server will > > then own the given fd. It will keep the most rece

Re: [Spice-devel] [PATCH 09/15] Move default_renderer into RedsState

2016-01-22 Thread Frediano Ziglio
> > From: Jonathon Jongsma > > Not global. > --- > server/reds-private.h | 1 + > server/reds.c | 8 > 2 files changed, 5 insertions(+), 4 deletions(-) > > diff --git a/server/reds-private.h b/server/reds-private.h > index 63e856e..75a4f59 100644 > --- a/server/reds-private.h

Re: [Spice-devel] [PATCH 06/15] Remove use of global 'reds' var from spice_server_remove_interface()

2016-01-22 Thread Frediano Ziglio
> > From: Jonathon Jongsma > > Since this is public API, we can't easily change the signature of the > function to take a RedsState argument, so instead we apply a hack and > store the reds argument inside the device state struct when the > interface is added, and retrieve it for use later when

Re: [Spice-devel] [PATCH 07/15] Change init_vd_agent_resources() to take RedsState arg

2016-01-22 Thread Frediano Ziglio
> > From: Jonathon Jongsma > > --- > server/reds.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/server/reds.c b/server/reds.c > index 36354a6..b108cc8 100644 > --- a/server/reds.c > +++ b/server/reds.c > @@ -3327,7 +3327,7 @@ SPICE_GNUC_VISIBLE int > spice_serve

Re: [Spice-devel] [PATCH 05/15] main_channel_init() -> main_channel_new()

2016-01-22 Thread Frediano Ziglio
> > From: Jonathon Jongsma > > Rename to make function name more consistent > --- > server/main-channel.c | 2 +- > server/main-channel.h | 2 +- > server/reds.c | 2 +- > 3 files changed, 3 insertions(+), 3 deletions(-) > > diff --git a/server/main-channel.c b/server/main-channel.c >

Re: [Spice-devel] [PATCH 04/15] inputs_init() -> inputs_channel_new()

2016-01-22 Thread Frediano Ziglio
> > From: Jonathon Jongsma > > Rename function to be more consistent > --- > server/inputs-channel.c | 2 +- > server/inputs-channel.h | 2 +- > server/reds.c | 2 +- > 3 files changed, 3 insertions(+), 3 deletions(-) > > diff --git a/server/inputs-channel.c b/server/inputs-channel.c

Re: [Spice-devel] [PATCH server v2 00/13] Add OpenGL scanout drawing

2016-01-22 Thread Marc-André Lureau
Hi On Thu, Jan 14, 2016 at 10:01 PM, Marc-André Lureau wrote: > See the related protocol changes for message details. > > 2 new functions are exported: > - spice_gl_scanout() to specify the current scanout. The server will > then own the given fd. It will keep the most recent version to set >

Re: [Spice-devel] [PATCH] tests: add explanation for test_qxl_pasring_SOURCES

2016-01-22 Thread Marc-André Lureau
Hi On Tue, Jan 19, 2016 at 11:41 AM, Frediano Ziglio wrote: > Instead of using libserver.a to include necessary functions we include > single files to check for dependencies. > > Signed-off-by: Frediano Ziglio > --- > server/tests/Makefile.am | 2 ++ > 1 file changed, 2 insertions(+) > > diff -

Re: [Spice-devel] [PATCH] typo: use #ifdef instead of #if

2016-01-22 Thread Fabiano Fidêncio
On Fri, Jan 22, 2016 at 11:27 AM, Pavel Grunt wrote: > On Fri, 2016-01-22 at 10:59 +0100, Fabiano Fidêncio wrote: >> This typo was introduced by commit 5166f891e and unfortunately was >> not >> caught during the review. > > I did not consider it wrong, we have '#if USE_SMARTCARD' on one place > an

Re: [Spice-devel] [PATCH] typo: use #ifdef instead of #if

2016-01-22 Thread Pavel Grunt
On Fri, 2016-01-22 at 10:59 +0100, Fabiano Fidêncio wrote: > This typo was introduced by commit 5166f891e and unfortunately was > not > caught during the review. I did not consider it wrong, we have '#if USE_SMARTCARD' on one place and "USE_*" is always defined with 1 as the value. I don't have a

[Spice-devel] [PATCH] typo: use #ifdef instead of #if

2016-01-22 Thread Fabiano Fidêncio
This typo was introduced by commit 5166f891e and unfortunately was not caught during the review. --- src/usb-device-manager.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/usb-device-manager.c b/src/usb-device-manager.c index 647edd0..6e12602 100644 --- a/src/usb-device-m

Re: [Spice-devel] [PATCH v3] usb-device-{manager, widget}: Add counter of free channels

2016-01-22 Thread Fabiano Fidêncio
On Fri, Jan 22, 2016 at 7:52 AM, Pavel Grunt wrote: > Hi, > > On Thu, 2016-01-21 at 22:35 +0100, Fabiano Fidêncio wrote: >> As the message showed when the last usbredir channel is taken can be >> a >> bit confusing, let's add a counter of free channels to the widget's >> label. >> In order to add

Re: [Spice-devel] [PATCH] Remove GSLice usage

2016-01-22 Thread Fabiano Fidêncio
On Mon, Jan 18, 2016 at 11:23 AM, Fabiano Fidêncio wrote: > On Mon, Jan 18, 2016 at 11:10 AM, Christophe Fergeau > wrote: >> On Mon, Jan 18, 2016 at 04:15:36AM -0500, Marc-André Lureau wrote: >>> Hi >>> >>> - Original Message - >>> > It's being slowly deprecated im glib >> >> s/im/in/ >>