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 <marcandre.lureau@gmail.com>
[reduce critical message to a warning; do not reset gl_draw_ongoing
- Frediano Ziglio]
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
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 <marcandre.lureau@gmail.com>
[removed unused sent field; move gl_draw_async_count to DisplayChannel
- Frediano Ziglio]
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
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 <marcandre.lureau@gmail.com>
This commit reworks a bit the management of RedCompressBuf so that
compress_buf_new/compress_buf_free become unneeded.
Since d25d6ca0 and the introduction of encoder_data_reset,
compress_buf_free is already unused outside of dcc-encoders.c and could
be static. This in turn makes compress_buf_new a bit odd as the matching
destructor is never used in dcc.c.
This commit introduces an encoder_data_init() method which is hiding
the initialization of the EncoderData structure from the dcc.c code,
allowing to get rid of compress_buf_new() calls from dcc.c code.
It also uses this as an opportunity to stop using GSlice for
RedCompressBuf.
Acked-by: Frediano Ziglio <fziglio@redhat.com>
Client can always send report even if a stream is not available.
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Christophe Fergeau <cfergeau@redhat.com>
For zlib+glz compression image if first compressed with glz then the
resulting buffer is compressed again with zlib then the buffer from
zlib is returned to the caller.
However the temporary glz buffer was not freed resulting in a memory
leak.
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Christophe Fergeau <cfergeau@redhat.com>
Don't disconnect the display channel, when unsupported compression is
requested from the client. Not changing the compression is enough.
https://bugs.freedesktop.org/show_bug.cgi?id=92821
Acked-by: Victor Toso <victortoso@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
Given that it is used for both cursor and display, COMMON_CLIENT_TIMEOUT
seems more appropriate. Also define it only in red-worker.h.
Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
This is a generic function not tied to the red_xxx functionality and the
new name clarifies that it returns the time in nanoseconds (unlike
g_get_monotonic_time()).
Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
Make clear that these funcion are just checking a condition.
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
make sure code compile with statistics enabled or disabled.
Dummy (empty) structures and functions are used instead of preprocessor.
Also fix a problem as stat_compress_init did not initialize clock
field.
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
Avoid problem when compiling with lz4 and without COMPRESS_STAT
dcc.c: In function 'dcc_compress_image_lz4':
dcc.c:657:21: error: unused variable 'display_channel' [-Werror=unused-variable]
DisplayChannel *display_channel = DCC_TO_DC(dcc);
Acked-by: Frediano Ziglio <fziglio@redhat.com>