Commit Graph

47 Commits

Author SHA1 Message Date
Jonathon Jongsma
039d3150ab Change Drawable->pipes from Ring to GList
This improves the readability of the code and keeps things
encapsulated better.
2016-09-19 07:47:05 -05:00
Jonathon Jongsma
a78a7d2510 RedChannelClient: store pipe items in a GQueue
Instead of using a Ring (and having a ring item link in every pipe
item), store them in a GQueue. This also necesitated changing
RedCharDeviceVDIPort->priv->read_bufs to a GList as well.

Also Optimise client pipe by passing pipe position instead of data.
This avoids having the search the data scanning all the queue changing
the order of these operations from O(n) to O(1).

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
2016-09-19 07:47:05 -05:00
Jonathon Jongsma
7188cefdd2 Rename RCC_TO_DCC() to DISPLAY_CHANNEL_CLIENT()
Prepare for port to GObject

Acked-by: Frediano Ziglio <fziglio@redhat.com
2016-09-08 09:40:15 +01:00
Jonathon Jongsma
d5d59d0858 Add red_channel_client_get_channel()
Don't poke into the structure to get the channel

This prepares for encapsulating RedChannelClient a bit more and
separating it into its own source file.
2016-08-30 16:53:29 -05:00
Frediano Ziglio
cbc86e7a1f move is_low_bandwidth to DisplayChannelClient
The field is only used by DisplayChannelClient, not by CursorChannelClient

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2016-08-09 10:22:46 -05:00
Jonathon Jongsma
a84a433e08 Limit direct access to DisplayChannelClient
Add a few more methods and accessors so that other files don't need to
manipulate the struct members directly. Move the struct definition to a
private header which only the dcc-* files will include.

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2016-08-09 10:22:46 -05:00
Frediano Ziglio
e6ed1840a1 Rename dcc-encoders.[ch] to image-encoders.[ch]
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2016-06-17 15:28:30 +01:00
Francois Gouget
2db59fef3a streaming: Let the video encoder manage the compressed buffer
This way the video encoder is not forced to use malloc()/free().
This also allows more flexibility in how the video encoder manages the
buffer which allows for a zero-copy implementation in both video
encoders.

Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
2016-06-14 17:04:40 +02:00
Frediano Ziglio
108d11f4aa Move others glz fields to dcc-encoders
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2016-06-14 15:07:31 +01:00
Frediano Ziglio
b46984ed30 Move some glz fields to ImageEncoders
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2016-06-14 15:07:28 +01:00
Frediano Ziglio
6e29efadbc Remove unused DCC_TO_WORKER macro
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Christophe Fergeau <cfergeau@redhat.com>
2016-06-10 13:36:00 +01:00
Frediano Ziglio
c2bc754559 Encapsulate zlib information in ImageEncoders structure
This change is less clean the other similar patches as zlib and
glz require more steps.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2016-06-10 09:15:17 +01:00
Frediano Ziglio
6d70d15d64 Encapsulate lz4 information in ImageEncoders structure
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2016-06-09 22:50:02 +01:00
Frediano Ziglio
7b6cb37cc0 Encapsulate jpeg information in ImageEncoders structure
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2016-06-09 22:32:26 +01:00
Frediano Ziglio
a25182f060 Encapsulate lz information in ImageEncoders structure
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2016-06-09 22:11:20 +01:00
Frediano Ziglio
fa0a579a65 Move image_encoders_compress_quic to dcc-encoders.c
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2016-06-09 21:14:43 +01:00
Frediano Ziglio
d7fb16c80e Encapsulate quic information in a new ImageEncoders structure
Start putting all encoding code into dcc-encoders.c.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2016-06-09 21:12:34 +01:00
Frediano Ziglio
f12464b2f1 Call dcc_send_item directly
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2016-05-21 04:11:12 +01:00
Frediano Ziglio
44352ca846 Remove dcc_release_item
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2016-05-17 23:53:27 +01:00
Frediano Ziglio
68c6d52e32 Simplify release of CREATE_SURFACE and DESTROY_SURFACE pipe items
Putting base as first item the default free function is fine.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2016-05-17 23:49:24 +01:00
Frediano Ziglio
fa118d5567 Remove unused refs field
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2016-05-17 23:48:12 +01:00
Francois Gouget
0e10629d70 server: Enable adding alternative MJPEG video encoders
This replaces the original mjpeg_encoder API with a VideoEncoder base
class which can be reimplemented by other encoders.
This also renames the members and enums from mjpeg_* to video_*.

Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
Acked-by: Christophe Fergeau <cfergeau@redhat.com>
2016-05-04 10:51:55 +01:00
Jonathon Jongsma
920e117c24 Rename all RedPipeItem subclasses
Use 'Red' prefix to match internal type naming convention

Acked-by: Frediano Ziglio <fziglio@redhat.com>
2016-04-27 10:22:26 -05:00
Jonathon Jongsma
b9720d80e0 Rename PipeItem to RedPipeItem
Following internal type naming conventions

Acked-by: Frediano Ziglio <fziglio@redhat.com>
2016-04-27 10:22:01 -05:00
Jonathon Jongsma
889a0b880f DrawablePipeItem: use base class for refcounting
Since PipeItem already implements refcounting, there's no need to
re-implement it here.
2016-04-15 09:59:08 -05:00
Jonathon Jongsma
3bd6b215d3 dcc: use PipeItem refcounting for ImageItem
Since the base class now implements refcounting, there's no need to
re-invent it here.
2016-04-15 09:53:19 -05:00
Jonathon Jongsma
3644783e24 CommonChannel -> CommonGraphicsChannel
Rename this struct to make it clear that it's only the base class for
graphics channels (e.g. display and cursor), not all channels.

Also renamed CommonChannelClient to CommonGraphicsChannelClient.

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Pavel Grunt <pgrunt@redhat.com>
2016-02-17 12:58:40 +00:00
Frediano Ziglio
0ebd3b0d04 dcc: move id from CommonChannelClient to DisplayChannelClient
Was not used by CursorChannelClient but only by DisplayChannelClient.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Pavel Grunt <pgrunt@redhat.com>
2016-02-16 13:07:08 +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
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
Francois Gouget
5c9fb9a0f3 server: Add time constants to go with spice_get_monotonic_time_ns()
They clarify the time unit being used, reduce the need for casts and
simplify calculations.

Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
Acked-by: Christophe Fergeau <cfergeau@redhat.com>
2015-12-14 11:24:34 +00: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
Frediano Ziglio
525cd67be7 server: rename files
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-12-03 23:54:32 +00:00
Yonit Halperin
1ea34e6d43 red_worker: make dcc_clear_surface_drawables_from_pipe declaration consistent with definition
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2015-12-02 12:52:10 +00:00
Marc-André Lureau
203b3cdebf worker: move dcc_send & marshallers to dcc-send.c
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2015-11-27 11:41:51 +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
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
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