Commit Graph

2122 Commits

Author SHA1 Message Date
Marc-André Lureau
c9bb089869 worker: use more DCC_TO_WORKER
Acked-by: Fabiano Fidêncio <fidencio@redhat.com>
2015-11-06 10:03:12 +00:00
Marc-André Lureau
ed70743f7c worker: move some compress stats to display
Acked-by: Fabiano Fidêncio <fidencio@redhat.com>
2015-11-06 09:35:16 +00:00
Marc-André Lureau
e839dc23b3 worker: rename WORKER_FOREACH_DCC_SAFE macro to FOREACH_DCC
Acked-by: Fabiano Fidêncio <fidencio@redhat.com>
2015-11-06 09:28:49 +00:00
Marc-André Lureau
de1ab756b0 worker: remove unused WORKER_TO_DCC macro
Acked-by: Fabiano Fidêncio <fidencio@redhat.com>
2015-11-06 09:23:02 +00:00
Marc-André Lureau
13888ae6a2 worker: rename red_pipe_add_drawable* to dcc_add_drawable*
Acked-by: Fabiano Fidêncio <fidencio@redhat.com>
2015-11-06 09:22:51 +00:00
Marc-André Lureau
f1c7bca4d4 worker: move delta computation
Move delta computation from red_add_drawable to red_current_add_with_shadow.

Acked-by: Fabiano Fidêncio <fidencio@redhat.com>
2015-11-06 09:16:02 +00:00
Marc-André Lureau
e603e96837 worker: move MonitorsConfig to display channel
Acked-by: Fabiano Fidêncio <fidencio@redhat.com>
2015-11-05 12:40:55 +00:00
Marc-André Lureau
81cf3997db worker: minor simplification
Acked-by: Fabiano Fidêncio <fidencio@redhat.com>
2015-11-05 11:13:25 +00:00
Frediano Ziglio
63b8ea5afb worker: don't process drawable if it can't be allocated
Acked-by: Fabiano Fidêncio <fidencio@redhat.com>
2015-11-05 11:12:55 +00:00
Marc-André Lureau
d29ebe4590 worker: move DisplayChannel struct
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2015-11-05 11:12:29 +00:00
Jonathon Jongsma
ac53e6a3c3 style: prefer early return to large if blocks
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2015-11-04 18:25:50 +00:00
Jonathon Jongsma
b26c4a7898 Remove unnecessary typedef from pixmap-cache.h
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2015-11-04 13:04:17 +00:00
Marc-André Lureau
5f1bdb2166 worker: Move some dpi code to display channel
This commit moves some DrawablePipeItem declarations to
display-channel.h, though the function implementations remain in
red_worker.c until they can be disentangled some more.

Acked-by: Frediano Ziglio <fziglio@redhat.com>
2015-11-04 13:03:53 +00:00
Fabiano Fidêncio
3cc2513d33 cursor: fix wrong logic when initializing the channel
It's a regression introduced by commit e601e920bd. The logic error was
introduced when trying to achieve the following code[0]. but rewritten
to prefer an early return, which was wrogly negated.

[0]:
if (cursor_is_connected(worker)
    && !COMMON_CHANNEL(worker->cursor_channel)->during_target_migrate) {
        red_channel_pipes_add_type(RED_CHANNEL(worker->cursor_channel),
                                   PIPE_ITEM_TYPE_CURSOR_INIT);
}

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2015-11-04 11:20:48 +00:00
Jonathon Jongsma
cf3ca136e6 Palette cache: Use correct marshal function
In order to invalidate a single palette cache item, we were using
spice_marshall_msg_cursor_inval_one(), which is the marshal function
used to send an invalidation message for the Cursor channel's cache.
This didn't cause any problems because SPICE_MSG_CURSOR_INVAL_ONE and
SPICE_MSG_DISPLAY_INVAL_PALETTE have the same message ID and parameters,
but it's better to use the correct marshalling function.

Acked-by: Frediano Ziglio <fziglio@redhat.com>
2015-11-04 11:09:35 +00:00
Marc-André Lureau
d8f89125fb Various changes in RedWorker and CursorChannel related to error and warning messages.
Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2015-11-04 10:27:09 +00:00
Marc-André Lureau
fae3f7a062 Move monitors_config to display
Acked-by: Fabiano Fidêncio <fidencio@redhat.com>
2015-11-04 10:00:08 +00:00
Marc-André Lureau
791d5a2d46 s/process_drawable/process_draw
Acked-by: Fabiano Fidêncio <fidencio@redhat.com>
2015-11-04 09:46:38 +00:00
Marc-André Lureau
b323afa6e8 server: move renderer members to DisplayChannel
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2015-11-03 17:18:33 +00:00
Frediano Ziglio
996ce40d7f worker: remove only assigned set_client_capabilities_pending field
This field is only assigned and never readed so can be removed.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Fabiano Fidêncio <fidencio@redhat.com>
2015-11-03 16:36:51 +00:00
Marc-André Lureau
23e17c2fc9 server: move bitmap related to spice-bitmap-utils
Also remove some unused function parameters from
bitmap_get_graduality_level()

Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2015-11-03 16:32:26 +00:00
Marc-André Lureau
1a787f0e99 worker: remove unused worker parameter
Acked-by: Pavel Grunt <pgrunt@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2015-11-03 14:02:35 +00:00
Marc-André Lureau
d9a0629bc1 Store QXLInstance in CursorItem
Doing so allows us to remove the extra QXLInstance parameter from
cursor_item_unref() and makes the code a bit cleaner.

Also add cursor_item_ref().

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Acked-by: Fabiano Fidêncio <fidencio@redhat.com>
2015-11-03 09:53:46 +00:00
Marc-André Lureau
e601e920bd server: make more of cursor private
Acked-by: Fabiano Fidêncio <fidencio@redhat.com>
2015-11-03 09:07:18 +00:00
Marc-André Lureau
c9e3b058e4 server: make cursor channel private
Acked-by: Fabiano Fidêncio <fidencio@redhat.com>
2015-11-03 09:06:55 +00:00
Marc-André Lureau
fb84cc956f Move pipe item enumerations out of red_worker.h
Move the cursor-specific pipe item types to cursor-channel.h, and the
display-specific types to red_worker.c. Only leave the common
definitions in red_worker.h. This prepares for splitting the display
channel into a separate file.

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Acked-by: Fabiano Fidêncio <fidencio@redhat.com>
2015-11-02 16:02:23 +00:00
Marc-André Lureau
7198a06433 server: move display_channel_client_create() to dcc_new()
Move function from server/red_worker.c to new server/display-channel.c.

Acked-by: Fabiano Fidêncio <fidencio@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2015-11-02 14:00:54 +00:00
Marc-André Lureau
372eb0072a tree: move that to a separate unit
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2015-11-02 12:12:14 +00:00
Marc-André Lureau
9e42647101 worker: s/repoll/poll_tries
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2015-11-02 09:46:41 +00:00
Marc-André Lureau
0eedafaf0c Various minor style changes to worker and cursor channel
Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2015-10-30 17:55:59 +00:00
Marc-André Lureau
5c7e248445 worker: remove assertion on alloc_drawable
There is no guarantee in the code that this can't be hit, so we should
cope with it (the condition can be reached easily by running the server
without waiting for blocked clients or pipe size)

The following commit will attempt to address this.

Acked-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Christophe Fergeau <cfergeau@redhat.com>
2015-10-30 17:18:31 +00:00
Marc-André Lureau
2eb732bd4d __new_channel -> red_worker_new_channel()
Rename and lightly refactor the function that creates new common
channels for RedWorker (essentially Cursor and Display channels).

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2015-10-30 17:15:18 +00:00
Marc-André Lureau
2d934ed82e Make cursor_channel_disconnect a CursorChannel method
The first argument should be CursorChannel* rather than RedChannel*
since it's essentially a CursorChannel method.

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2015-10-30 16:56:13 +00:00
Francois Gouget
f2c8609985 server: Hide the MJPEG encoder internals from red_worker.c
Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
2015-10-30 15:35:47 +01:00
Francois Gouget
3708bf9cf0 server: Move the MJPEG encoder functions to mjpeg_encoder.c
Note that this requires some adjustments to the encode_frame()
parameters to avoid red_worker-specific types.

Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
2015-10-30 15:35:47 +01:00
Francois Gouget
fd451860df server: Move mjpeg_encoder_new() to the end of mjpeg_encoder.c
This also allows getting rid of a couple of forward definitions.

Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
2015-10-30 15:35:47 +01:00
Francois Gouget
c93d9fc1a2 server: Remove an unnecessary cast in encode_frame()
Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
2015-10-30 11:17:29 +00:00
Marc-André Lureau
7b39f818b8 Remove a couple single-use static functions
red_cursor_marshall_inval(), red_migrate_cursor() and
on_new_cursor_channel() were short functions that were each only called
from a single location, so there's no need for them to be separate
functions.

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2015-10-30 08:48:00 +00:00
Marc-André Lureau
30c9ff7a8f CursorChannel* arg in cursor_channel_client_new()
Instead of passing a CommonChannel* argument, use CursorChannel* since
this function is only valid for CursorChannels.

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2015-10-30 08:47:56 +00:00
Marc-André Lureau
591f39e7cc common_channel_client_create -> common_channel_new_client
Rename and re-order the initial arguments to make this function look and
act more like a method of the CommonChannel class.

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2015-10-30 08:47:53 +00:00
Marc-André Lureau
8f5a5582c0 Change red_marshall_verb() to accept a VerbItem
Instead of passing a verb enumeration value, pass the verb pipe item

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2015-10-30 08:47:50 +00:00
Marc-André Lureau
26005ddb04 Remove unused parameter from cursor_channel_new()
cursor_channel_new() is only called from one location, and always passes
FALSE as the value for the 'migrate' paramater. In addition, this
parameter is not used within the function. Remove it.

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2015-10-30 08:47:45 +00:00
Frediano Ziglio
46d9c51f73 server: remove undefined declaration
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
2015-10-29 20:06:07 +00:00
Marc-André Lureau
39b7e55ec7 Replace now() with get_mononotonic_time()
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2015-10-29 18:22:19 +00:00
Marc-André Lureau
93414b23fa utils: add red_get_monotonic_time() 2015-10-29 17:59:02 +00:00
Frediano Ziglio
1b2c3e4067 worker: avoid to use constant directly for capabilities size
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2015-10-29 17:46:27 +00:00
Marc-André Lureau
3c1ab4a5fa Move red_bitmap_utils.h->tmpl.c
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2015-10-29 11:27:09 +00:00
Marc-André Lureau
070e0fcd63 worker: move some cursor code to cursor-channel.c
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-10-29 09:58:25 +00:00
Marc-André Lureau
266d344b7f worker: rename some cursor functions
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-10-29 09:44:29 +00:00
Marc-André Lureau
5872d0a09c worker: change CursorItem memory allocation
Do not use static allocate space but handle dynamically

Signed-off-by: Marc-André Lureau <marcandre.lureau@gmail.com>
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
2015-10-29 09:35:28 +00:00