Commit Graph

30 Commits

Author SHA1 Message Date
Marc-André Lureau
8777864311 Handle GL_DRAW_DONE
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>
2016-02-09 14:01:30 +00:00
Marc-André Lureau
381dc93ec0 Handle GL_DRAW messages
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>
2016-02-09 14:01:25 +00:00
Marc-André Lureau
5881b40ebd Send current GL scanout to new client
Signed-off-by: Marc-André Lureau <marcandre.lureau@gmail.com>
2016-02-09 14:01:20 +00:00
Marc-André Lureau
7a06efde1c Handle GL_SCANOUT messages
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>
2016-02-09 14:01:17 +00:00
Pavel Grunt
0bfad8a37f dcc: make dcc_compress_image_*() private
Reviewed-by: Victor Toso <victortoso@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2016-01-20 16:05:02 +00:00
Pavel Grunt
faa907e3c6 dcc_compress_image: Handle NULL drawable
It will be used in the following commit.
The GLZ compression cannot be used when the drawable is NULL.

Acked-by: Frediano Ziglio <fziglio@redhat.com>
2016-01-20 16:04:55 +00:00
Christophe Fergeau
400a5d13cf Remove compress_buf_new
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>
2016-01-14 16:39:30 +00:00
Frediano Ziglio
1b6af4779a dcc: avoid to report errors triggered by client
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>
2016-01-11 14:45:02 +00:00
Frediano Ziglio
d25d6ca0f2 dcc: write and use a new encoder_data_reset function to clean buffers
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Christophe Fergeau <cfergeau@redhat.com>
2016-01-08 16:25:37 +00:00
Frediano Ziglio
bd8c74d7a4 dcc: free glz buffer after zlib compression
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>
2016-01-08 16:25:25 +00:00
Lukas Venhoda
6c4f11191c dcc: Don't disconnect channel, when compression is not supported
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>
2015-12-17 12:29:52 +01:00
Francois Gouget
cbc4e07682 server: Rename DISPLAY_CLIENT_TIMEOUT and de-duplicate it
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>
2015-12-14 10:53:40 +00:00
Francois Gouget
65b60250d0 server: Rename red_get_monotonic_time() to spice_get_monotonic_time_ns()
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>
2015-12-11 12:43:26 +00:00
Frediano Ziglio
b12187b332 channel: rename red_channel_(client_)waits_* functions
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>
2015-12-10 17:22:59 +00:00
Frediano Ziglio
253d2cef40 stat: use a better design for statistic functions
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>
2015-12-09 17:02:48 +00:00
Marc-André Lureau
d9b17bbebb worker: move more stream functions
Acked-by: Fabiano Fidêncio <fidencio@redhat.com>
2015-11-26 15:19:03 +00:00
Marc-André Lureau
721c03394b server: move LZ_IMAGE_TYPE_* enum to dcc
Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
Acked-by: Pavel Grunt <pgrunt@redhat.com>
2015-11-26 14:59:51 +00:00
Marc-André Lureau
82fa233fa6 server: rename _tmpl files
Signed-off-by: Marc-André Lureau <marcandre.lureau@gmail.com>
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Fabiano Fidêncio <fidencio@redhat.com>
2015-11-26 13:33:36 +00:00
Marc-André Lureau
0ebb539f48 worker: move destroy_surface() familly
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2015-11-25 14:14:50 +00:00
Marc-André Lureau
9c828e8553 worker: move display_channel_new
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2015-11-25 14:14:36 +00:00
Marc-André Lureau
742e3666ab worker: move dcc_release_item
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2015-11-24 09:03:39 +00:00
Marc-André Lureau
5bd0fd9fe4 worker: move dcc_handle_migrate_data
Acked-by: Fabiano Fidêncio <fabiano@fidencio.org>
2015-11-24 09:03:07 +00:00
Marc-André Lureau
6df1558523 worker: move dcc_add_drawable*
Acked-by: Fabiano Fidêncio <fidencio@redhat.com>
2015-11-24 08:56:33 +00:00
Marc-André Lureau
1549f751b8 worker: move dcc_handle_message
Acked-by: Fabiano Fidêncio <fidencio@redhat.com>
2015-11-24 08:55:59 +00:00
Marc-André Lureau
029b4beb73 worker: move dcc_add_surface_area_image
Author:    Marc-André Lureau <marcandre.lureau@gmail.com>
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2015-11-23 13:50:44 +00:00
Pavel Grunt
2c2e26579f dcc: Fix unused display_channel variable
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>
2015-11-20 11:26:12 +00:00
Marc-André Lureau
8ef5be6cd9 worker: move dcc_pixmap_cache_add
Acked-by: Fabiano Fidêncio <fidencio@redhat.com>
2015-11-20 10:20:38 +00:00
Frediano Ziglio
422d67dde4 worker: move compress to dcc_compress_image()
Signed-off-by: Marc-André Lureau <marcandre.lureau@gmail.com>
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2015-11-20 09:49:49 +00:00
Marc-André Lureau
0e224d04fb worker: move dcc_start()
Author:    Marc-André Lureau <marcandre.lureau@gmail.com>
Acked-by: Fabiano Fidêncio <fidencio@redhat.com>
2015-11-19 12:43:33 +00:00
Marc-André Lureau
85920bb2e9 worker: start a DisplayChannelClient unit
Signed-off-by: Marc-André Lureau <marcandre.lureau@gmail.com>
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Fabiano Fidêncio <fidencio@redhat.com>
2015-11-19 12:43:02 +00:00