summaryrefslogtreecommitdiffstats
path: root/server
Commit message (Collapse)AuthorAgeFilesLines
...
* mjpeg: add missing SPICE_BITMAP_FMT_RGBAChristophe Fergeau2011-08-021-0/+1
| | | | | I forgot to handle SPICE_BITMAP_FMT_RGBA when mapping from spice image formats to libjpeg-turbo colorspaces.
* mjpeg: fix libjpeg assertionChristophe Fergeau2011-08-011-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After the changes to add libjpeg-turbo support to spice-server mjpeg compression code, it's relatively easy to hit an assertion from libjpeg in spice-server about "too few scanlines transferred" when the mjpeg streaming code triggers. This assertion brings down qemu, which is bad :) This is because when we first initialize the mjpeg encoder, we do: stream_width = SPICE_ALIGN(src_rect->right - src_rect->left, 2); stream_height = SPICE_ALIGN(src_rect->bottom - src_rect->top, 2); stream->mjpeg_encoder = mjpeg_encoder_new(stream_width, stream_height); and then when we iterate over the image scanlines to feed them to libjpeg, we do: const int image_height = src->bottom - src->top; const int image_width = src->right - src->left; for (i = 0; i < image_height; i++) { mjpeg_encoder_encode_scanline(...); } mjpeg_encoder_end_frame(...); When stream_height is odd, the mjpeg_encoder will be created with an height that is 1 more than the number of lines we encode. Then libjpeg asserts when we tell it we're done with the compression while it's still waiting for one more scanline. Looking through git history, this rounding seems to be an artifact from when we were using ffmpeg for the mjpeg encoding. Since spicec and spicy (the latter needs a few fixes) can handle streams with odd height/width, the best way to solve this issue is to stop rounding up the height and width of the streams we create. This even saves some bandwidth :)
* server/red_dispatcher: fix wrong resolution set for tabletAlon Levy2011-07-311-4/+4
| | | | | | | | | | | when changing resolutions due to the new async code paths the surface creation command was kept by reference, and later, when the red_worker signaled completion by calling async_complete the mouse mode was updated using the reference. This caused the wrong values to be read resulting in wrong resolutions set and a non working mouse pointer. Fix this by keeping a copy of the surface creation command instead of a reference. No bz. Found in testing.
* Bump version in server/spice,h to 0.9.1Hans de Goede2011-07-261-1/+1
| | | | | | | | It is a bit early to bump, since a 0.9.1 release is not happening yet, but this allows me to test if the vdagent SpiceCharInterface state callback fixes are present or not in qemu code, and thus disabling the ugly vdagent specific workaround from spice-qemu-char.c when compiling against a new enough spice-server.
* server: Don't call vdagent chardev state callback on client (dis)connectHans de Goede2011-07-251-45/+20
| | | | | See this long mail for the rationale for this: http://lists.freedesktop.org/archives/spice-devel/2011-July/004837.html
* server/smartcard: fix smartcard_channel_send_errorAlon Levy2011-07-221-25/+8
| | | | | | | | It was sending the wrong data, the memory right after the VCSMsgHeader which was actually not where the data was. Fixed by having the header and data (VSCError, 4 bytes of the error code) embedded in the ErrorItem pipe item.
* mjpeg: rename jpeg_mem_destChristophe Fergeau2011-07-221-3/+3
| | | | | jpeg_mem_dest is a public symbol in libjpeg8 so using it with no prefix will cause symbol clashes. Rename it to spice_jpeg_mem_dest.
* mjpeg_encoder: allocate "row" on demandChristophe Fergeau2011-07-221-8/+9
| | | | | | It's not used when we use jpeg-turbo colorspaces, so it's better to allocate it when we know we'll need it rather than always allocating it even if it won't be used.
* mjpeg_encoder: remove unused functionsChristophe Fergeau2011-07-222-50/+0
| | | | | | After the refactoring to optionally use libjpeg-turbo, some of the functions that mjpeg-encoder used to provide are now no longer used. This commit removes them.
* mjpeg_encoder: use libjpeg-turbo extra colorspacesChristophe Fergeau2011-07-221-5/+16
| | | | | | When libjpeg-turbo is available, we can use the BGR and BGRX colorspaces that it provides to avoid extra conversions of the data we want to compress to mjpeg
* red_worker: use new mjpeg_encoder_encode_scanline APIChristophe Fergeau2011-07-221-72/+13
| | | | | | The main point is to move the pixel conversion code into the MjpegEncoder class to be able to make use libjpeg-turbo additional pixel formats without the reds_worker code noticing.
* mjpeg_encoder: add mjpeg_encoder_get_bytes_per_pixelChristophe Fergeau2011-07-222-0/+6
| | | | | Returns the number of bytes per pixel corresponding to the input data format.
* mjpeg_encoder: add mjpeg_encoder_encode_scanlineChristophe Fergeau2011-07-222-0/+107
| | | | | | This API is meant to allow us to move the pixel format conversion into MjpegEncoder. This will allow us to be able to use the additional pixel formats from libjpeg-turbo when available.
* red_worker: simplify red_rgb_to_24bpp prototypeChristophe Fergeau2011-07-221-10/+6
| | | | | | It takes a lot of arguments, "id" is unused, "frame" and "frame_size" can be obtained from the "stream" argument, so can get rid of 3 arguments to make things more readable.
* mjpeg_encoder: rework output buffer allocationChristophe Fergeau2011-07-223-26/+112
| | | | | | | | | | When encoding a frame, red_worker passes an allocated buffer to libjpeg where it should encode the frame. When it fails, a new bigger buffer is allocated and the encoding is restarted from scratch. However, it's possible to use libjpeg to realloc this buffer if it gets too small during the encoding process. Make use of this feature, especially since it will make it easier to encore one line at a time instead of a full frame in subsequent commits.
* red_worker: factor pixel conversion codeChristophe Fergeau2011-07-221-121/+50
| | | | | | When encoding to mjpeg, the on screen data have to be converted to 24bpp RGB since that's the format that libjpeg expects. Factor as much code as possible for the 3 formats we handle.
* fix make distcheckChristophe Fergeau2011-07-221-4/+5
|
* server: make sure we clear vdagent and update mouse mode on agent disconnectHans de Goede2011-07-211-1/+1
| | | | | | | | | | | | The check this patch removes causes us to not set vdagent to NULL, nor update the mouse mode when the guest agent disconnects when no client is attached. Which leads to a non working mouse, and on agent reconnect a "spice_server_char_device_add_interface: vdagent already attached" message instead of a successful re-add of the agent interface . hansg: Note this is commit 443994ba from the 0.8 branch, which I did not forward port back then because it seemed unnecessary on master, but it turns out that the (wrong) check was just hidden in another place on master.
* server/red_worker: send surface images to client on-demand after S3/4 wakeupYonit Halperin2011-07-201-9/+22
| | | | | When surfaces are being reloaded to the worker, we will send them to the client only if and when it needs them.
* server/spice.h: bump QXL_MINOR because of QXLWorker and QXLInterface changesAlon Levy2011-07-201-1/+1
|
* server: add QXLWorker.flush_surfaces_async for S3/S4 supportAlon Levy2011-07-205-4/+46
| | | | | | | | | | | This does the following, all to remove any referenced memory on the pci bars: flush_all_qxl_commands(worker); flush_all_surfaces(worker); red_wait_outgoing_item((RedChannel *)worker->display_channel); red_wait_outgoing_item((RedChannel *)worker->cursor_channel); The added api is specifically async, i.e. it calls async_complete when done.
* server: add QXLInterface::update_area_complete callbackAlon Levy2011-07-202-16/+47
| | | | | when update_area_async is called update_area_complete will be called with the surfaces dirty rectangle list.
* server/red_worker: handle_dev_input: reuse write_ready introduced for asyncAlon Levy2011-07-201-8/+4
|
* server: add async io supportAlon Levy2011-07-208-91/+358
| | | | | | | | | | | | | | | | | | | | | | | | | | | The new _ASYNC io's in qxl_dev listed at the end get six new api functions, and an additional callback function "async_complete". When the async version of a specific io is used, completion is notified by calling async_complete, and no READY message is written or expected by the dispatcher. update_area has been changed to push QXLRects to the worker thread, where the conversion to SpiceRect takes place. A cookie has been added to each async call to QXLWorker, and is passed back via async_complete. Added api: QXLWorker: update_area_async add_memslot_async destroy_surfaces_async destroy_primary_surface_async create_primary_surface_async destroy_surface_wait_async QXLInterface: async_complete
* server: api: add spice_qxl_* calls based on QXLWorker contentsAlon Levy2011-07-203-32/+226
| | | | | | | | | For each callback in QXLWorker, for example QXLWorker::update_area, add a direct call named spice_qxl_update_area. This will (a) remove the pointless indirection and (b) make shared library versioning alot easier as we'll get new linker symbols which we can tag with the version they appeared in the shared library.
* server: spice-server.syms: move sasl symbols to 0.8.2Alon Levy2011-07-201-3/+7
|
* server/red_worker: remove print on handle_dev_destroy_surfacesAlon Levy2011-07-201-1/+1
|
* server/red_worker: *_release_item: less frequent debug messagesAlon Levy2011-07-201-2/+2
|
* server/tests: test_util.h: fix double ASSERT definitionAlon Levy2011-07-201-0/+3
|
* server: add symbol versioning to the spice server shared library.Gerd Hoffmann2011-07-192-0/+67
| | | | | | | | | | This patch adds symbol versions to the spice server library. Each symbol which is exported by libspice-server gets tagged with the (stable) version where it appeared first. This way the linker and rpm are able to figure which version of the spice-server libary is required by a particular qemu binary/package. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* remove unused functionChristophe Fergeau2011-07-191-2/+0
|
* Fix spice-server/qemu channel version checksChristophe Fergeau2011-07-181-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When qemu creates a channel, reds.c contains code to check the minor/major channel versions known to QEMU (ie the ones that were current in spice-server when QEMU was compiled) and to compare these versions against the current ones the currently installed spice-server version. According to kraxel [1], the rules for these interface numbers are: "The purpose of the versions is exactly to avoid the need for a new soname. The rules are basically: (1) You add stuff to the interface, strictly append-only to not break binary compatibility. (2) You bump the minor version of the interface. (3) You check the minor version at runtime to figure whenever the added fields contain valid stuff or not. An example is here (core interface, minor goes from 2 to 3, new channel_event callback): http://cgit.freedesktop.org/spice/spice/commit/?id=97f33fa86aa6edd25111b173dc0d9599ac29f879 " The code currently refuses to create a channel if QEMU minor version is less than the current spice-server version. This does not correspond to the intended behaviour, this patch changes to fail is qemu was compiled with a spice-server that is *newer* than the one currently installed. This case is something we cannot support nicely. [1] http://lists.freedesktop.org/archives/spice-devel/2011-July/004440.html
* server: add missing calls to red_handle_drawable_surfaces_client_syncedYonit Halperin2011-07-121-0/+2
| | | | | | red_handle_drawable_surfaces_client_synced was called only from red_pipe_add_drawable, while it should also be called from red_pipe_add_drawable_after. Otherwise, the client might receive a command with a reference to a surface it doesn't hold and crash.
* server: fix access to a released drawable. RHBZ #713474Yonit Halperin2011-07-121-2/+9
| | | | | | | | | red_pipe_add_drawable can lead to removal of drawables from current tree (since it calls red_handle_drawable_surfaces_client_synced), which can also lead to releasing these drawables. Before the fix, red_current_add_equal, called red_pipe_add_drawable, without assuring afterwards that the drawables it refers to are still alive or still in the current tree.
* server: fix segfault if no migrate_info providedAlon Levy2011-07-061-0/+11
| | | | | | | qemu calls spice_server_migrate_switch even if it didn't do a spice_server_migrate_info first. Fix the resulting error by not pushing a switch host tag to the pipe in this case, and add a check anyway in the marshalling code just in case.
* server: cursor_channel: releasing pipe items resources when the pipe is ↵Yonit Halperin2011-07-051-9/+34
| | | | | | cleared (on disconnect) same as commit 74a9d10af96f4d7c8c1b1d7fca124a8df9180787 for cursor channel
* server: display_channel: releasing pipe items resources when the pipe is ↵Yonit Halperin2011-07-051-24/+75
| | | | | | | | | | | | | | | cleared (on disconnect) fixes "display_channel_release_item: panic: invalid item type" Before changing the red_worker to use the red_channel interface, there was a devoted red_pipe_clear routine for the display channel and cursor channel. However, clearing the pipe in red_channel, uses the release_item callback the worker provided. This callback has handled only resources that need to be released after the pipe item was enqueued from the pipe, and only for pipe items that were set in red_channel_init_send_data. This fix changes the display channel release_item callback to handle all types of pipe items, and also handles differently pushed and non-pushed pipe items.
* server: not reading command rings before RED_WORKER_MESSAGE_START, RHBZ #718713Yonit Halperin2011-07-051-1/+11
| | | | | | | On migration, destroy_surfaces is called from qxl (qxl_hard_reset), before the device was loaded (on destination). handle_dev_destroy_surfaces led to red_process_commands, which read the qxl command ring (which appeared to be not empty), and then when processing the command it accessed unmapped memory.
* server: replace redundant code with red_cursor_resetYonit Halperin2011-07-051-47/+24
| | | | | In addition (1) make handle_dev_destroy_surfaces call red_release_cursor (2) call red_wait_outgoing_item(cursor_channel) only after adding msgs to pipe
* server: removing local cursor, this solves RHBZ #714801Yonit Halperin2011-07-051-114/+14
| | | | | | | | | | | When the worker was stoped, the cursor was copied from guest ram to the host ram, and its corresponding qxl command was released. This is unecessary, since the qxl ram still exists (we keep references to the surfaces in the same manner). It also led to BSOD on guest upon migration: the device tracks cursor set commands and it stores a reference to the last one. Then, it replays it to the destination server when migrating to it. However, the command the qxl replayed has already been released from the pci by the original worker, upon STOP.
* server/tests/basic_event_loop: strange assert failure; fixAlon Levy2011-07-051-1/+1
|
* server/smartcard: register channel only when hardware is availableAlon Levy2011-07-052-6/+9
|
* Revert "server/smartcard: don't register the channel if no hardware emulated"Alon Levy2011-06-291-4/+1
| | | | | | | | This reverts commit 456ff9f8d5d27ac763e89e67a100661084695dc5. That patch just disabled the smartcard channel completely because the check was done *before* the initialization of the qemu smartcard devices, not after.
* red_worker: remove 2 empty functionsChristophe Fergeau2011-06-281-12/+0
| | | | | red_worker was using some share/unshare stream_buf functions whose body is empty. This commit removes them and their use.
* server/smartcard: don't register the channel if no hardware emulatedAlon Levy2011-06-231-1/+4
|
* server/smartcard: handle BaseChannel messagesAlon Levy2011-06-231-0/+6
| | | | | | According to spice.proto the smartcard channel can receive acks and any other message defined in BaseChannel. While the spicec implementation didn't send an ACK spice-gtk does, so handle it.
* s/__visible__/SPICE_GNUC_VISIBLEChristophe Fergeau2011-06-224-59/+59
| | | | | The C specification reserves use of identifiers starting with __ to the compiler so we shouldn't use one such symbol.
* sndworker: check the caps before sending volume messagesMarc-André Lureau2011-06-221-10/+46
|
* sndworker: add AudioVolume/AudioMute messagesMarc-André Lureau2011-06-222-4/+178
| | | | | | | | | | | | | | | | | | | These messages allow the guest to send the audio device volume to the client. It uses an arbitrary scale of 16bits, which works good enough for now. Save VolumeState in {Playback,Record}State, so that we can send the current volume on channel connection. Note about future improvements: - add exact dB support - add client to guest volume change Updated since v2: - bumped record and playback interface minor version to allow conditional compilation Updated since v1: - sync record volume on connection too
* server/smartcard: fix use after freeAlon Levy2011-05-241-1/+1
|