Commit Graph

411 Commits

Author SHA1 Message Date
Frediano Ziglio
d1dca6450c macros: Use GCC built-ins to swap bytes
GCC introduced __builtin_bswapXX intrinsics in a quite old
version.
As version 2 and 3 are no more used nowadays instead of manually
craft these functions using assembly language use the new built-ins.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Christophe Fergeau <cfergeau@redhat.com>
2018-03-09 15:41:04 +00:00
Frediano Ziglio
4250216baf Allow to specify a surface will be streamed
This flag will allow the client to perform some optimisations
on output and buffering processing.
Old clients will ignore this additional flag.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Victor Toso <victortoso@redhat.com>
2017-12-01 15:53:44 +00:00
Jonathon Jongsma
6371ecbcb1 Change STREAM_MSG_CAPABILITIES_MAX_BYTES
Clarify that this value specifies the size in bytes, not the number of
capabilities.

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2017-11-09 11:43:00 -06:00
Jonathon Jongsma
e2176efb0e Add definition of STREAM_MSG_CAPABILITIES_MAX
This message is specified to have a size limit of 1024, so provide this
as a #define

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Acked-by: Christophe de Dinechin <dinechin@redhat.com>
2017-11-01 17:06:00 +01:00
Frediano Ziglio
c05cc91972 Add support for mouse movement
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Christophe de Dinechin <cdupontd@redhat.com>
2017-09-15 18:47:04 +01:00
Frediano Ziglio
a419692ea9 Add support for setting cursor shape from guest
This allows to better support client mouse using streaming device

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Christophe de Dinechin <cdupontd@redhat.com>
2017-09-15 18:47:04 +01:00
Frediano Ziglio
909da449e3 Add error reports from server to guest
Acked-by: Christophe de Dinechin <cdupontd@redhat.com>
2017-09-15 18:47:04 +01:00
Frediano Ziglio
02b12e66de Add a message to control guest streaming
Allows server to tell codec and start/stop the streaming

Acked-by: Christophe de Dinechin <cdupontd@redhat.com>
2017-09-15 18:47:04 +01:00
Frediano Ziglio
a1d8ccabbf Add protocol to send streams to server
This protocol allows a guest to send a video stream to the server.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Christophe de Dinechin <cdupontd@redhat.com>
2017-09-15 18:47:04 +01:00
Michael Shigorin
6795f4edfd macros.h: s/endianess/endianness/g
A three-time typo, obviously :)

Acked-by: Frediano Ziglio <fziglio@redhat.com>
2017-09-15 18:47:01 +01:00
Michael Shigorin
ed8f30d421 macros.h: added e2k detection
Elbrus 2000 is a little-endian architecture.

Acked-by: Frediano Ziglio <fziglio@redhat.com>
2017-09-15 18:46:57 +01:00
Marc-André Lureau
40544912ab build-sys: post-release bump 0.12.14 2017-07-03 13:20:29 +02:00
Marc-André Lureau
8dda82b49d NEWS: prepare for 0.12.13 release
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Acked-by: Victor Toso <victortoso@redhat.com>
2017-07-03 13:14:29 +02:00
Jakub Janků
86c53ee5bf agent: Add new file-xfer statuses
Introduce new error statuses to report more info to clients:
VD_AGENT_FILE_XFER_STATUS_SESSION_LOCKED,
VD_AGENT_FILE_XFER_STATUS_VDAGENT_NOT_CONNECTED,
VD_AGENT_FILE_XFER_STATUS_DISABLED

These are only sent to clients that feature
VD_AGENT_CAP_FILE_XFER_DETAILED_ERRORS capability.
Acked-by: Pavel Grunt <pgrunt@redhat.com>
2017-06-20 12:09:25 +02:00
Jakub Janků
8b025c4ed0 agent: Add support for reporting on free space
Agent can send VDAgentFileXferStatusMessage with result
VD_AGENT_FILE_XFER_STATUS_NOT_ENOUGH_SPACE to indicate lack of free
space. This enables more detailed error reporting, so the user knows
why the file transfer has failed.

Add VD_AGENT_CAP_FILE_XFER_DETAILED_ERRORS to ensure detailed errors
are not sent to clients that do not support it. This can be used
with more file xfer errors in the future.

Acked-by: Pavel Grunt <pgrunt@redhat.com>
2017-05-31 23:06:50 +02:00
Frediano Ziglio
068266069c Change enums.h license to MIT
This allows the header to be used in no GPL programs.
Others headers are already MIT licensed so this change do
not require additional changes to already existing
programs.

The file can be generated with

  ./spice_codegen.py -e spice.proto --license MIT enums.h

from spice-common.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Pavel Grunt <pgrunt@redhat.com>
2017-05-08 09:50:59 +01:00
Pavel Grunt
3f27d410b4 agent: Add capability for disabled file transfer
Server can set it to indicate that it discards file transfer messages.

Related:
https://bugzilla.redhat.com/show_bug.cgi?id=1373725

Acked-by: Victor Toso <victortoso@redhat.com>
2017-03-10 10:43:21 +01:00
Pavel Grunt
b9bfbd2f7b agent: Add macro for clearing capability
Related:
https://bugzilla.redhat.com/show_bug.cgi?id=1373725

Acked-by: Frediano Ziglio <fziglio@redhat.com>
2017-03-03 13:00:36 +00:00
Frediano Ziglio
5410de6407 protocol: Add support for VP9 video codec
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Victor Toso <victortoso@redhat.com>
2017-01-31 08:54:46 +00:00
Victor Toso
9da109a661 protocol: add preferred video codec message
Client might want to choose a preferred video codec for streaming for
different reasons which having hardware decoder support being the most
interest one.

This message allows the client to send a list of video codecs in a
order of preference.

Signed-off-by: Victor Toso <victortoso@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2017-01-06 12:24:27 +00:00
Francois Gouget
b1cdb2756f macros: Add MSVC support to SPICE_GNUC_DEPRECATED
Based on the G_DEPRECATED GLib macro.
For projects that don't use GLib.

Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
2016-11-23 08:51:09 +01:00
Francois Gouget
0d7aa7579e macros: Use GLib's G_DEPRECATED macro if available
This gains us automatic support for whichever compilers GLib supports in
this macro when used in projects that use GLib.

Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
2016-11-23 08:51:09 +01:00
Frediano Ziglio
97ae0b1bb4 vd_agent: Add some comments to clipboard messages
Document what the messages are meant to do.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2016-11-11 11:52:19 +00:00
Victor Toso
82fca738a2 build-sys: post-release bump
Signed-off-by: Victor Toso <victortoso@redhat.com>
Acked-by: Pavel Grunt <pgrunt@redhat.com>
2016-11-01 14:58:57 +01:00
Victor Toso
895afe1394 enums: Move auto generated SpiceDataCompressionType
This header is auto generated from spice_codegen.py tool in
spice-common repository and thus, it changes what was included
manually.

Move SpiceDataCompressionType struct to comply with spice_codegen.py.
This header was generated with:

 ./spice_codegen.py -e spice.proto ../spice-protocol/spice/enums.h

Signed-off-by: Victor Toso <victortoso@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2016-10-24 14:42:47 +01:00
Francois Gouget
2eeb092204 protocol: Group the VDAgent clipboard message definitions
Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2016-10-17 16:37:57 +01:00
Christophe Fergeau
91825a909b Update NEWS for 0.10.12 release 2016-07-07 15:20:13 +02:00
snir sheriber
73614b831a LZ4 compression is now available at the Spicevmc channel
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2016-06-13 23:03:13 +01:00
Marc-André Lureau
de68d1c074 build-sys: post-release bump
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2016-03-11 16:08:55 +01:00
Marc-André Lureau
1adb66c638 NEWS: update for 0.12.11 release
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2016-03-10 17:04:11 +01:00
Marc-André Lureau
2a6e51c7ee Remove codegen
Codegen generates code specific to spice-common submodule. It's not
meant as a generic protocol header or specification. See discussion and
commits about spice-common codegen re-import.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2016-03-10 16:57:08 +01:00
Francois Gouget
7937915d67 protocol: Add support for the VP8 and h264 video codecs
Clients that support multiple codecs must advertise the
SPICE_DISPLAY_CAP_MULTI_CODEC capability and one
SPICE_DISPLAY_CAP_CODEC_XXX per supported codec.

Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
Acked-by: Christophe Fergeau <cfergeau@redhat.com>
2016-03-03 17:04:44 +00:00
Frediano Ziglio
0721716bb8 macros: do not use more type safe CONTAINEROF version if not requested
This prevents incompatibility if users (like old spice-server/spice-gtk)
are not expected to have this additional restriction.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Christophe Fergeau <cfergeau@redhat.com>
2016-03-02 12:05:55 +00:00
Marc-André Lureau
4707655962 codegen: simplify FdType
This patch is a left-over from the fd passing commit 267391c8fd as
suggested by Frediano Ziglio during review.

Signed-off-by: Marc-André Lureau <marcandre.lureau@gmail.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2016-01-19 14:43:23 +00:00
Marc-Andre Lureau
3fc2221e96 protocol: add unix GL scanout messages
Add 2 new messages to the display channel to stream pre-rendered GL
images of the display. This is only possible when the client supports
SPICE_DISPLAY_CAP_GL_SCANOUT capability.

The first message, SPICE_MSG_DISPLAY_GL_SCANOUT_UNIX, sends a gl image
file handle via socket ancillary data, and can be imported in a GL
context with the help of eglCreateImageKHR() (as with the 2d canvas, the
SPICE_MSG_DISPLAY_MONITORS_CONFIG will give the monitors
coordinates (x/y/w/h) within the image). There can be only one scanount
per display channel.

A SPICE_MSG_DISPLAY_GL_DRAW message is sent with the coordinate of the
region within the scanount to (re)draw on the client display. For each
draw, once the client is done with the rendering, it must acknowldge it
by sending a SPICE_MSGC_DISPLAY_GL_DRAW_DONE message, in order to
release the context (it is expected to improve this in the future with a
cross-process GL fence).

The relation with the existing display channel messages is that all
other messages are unchanged: the last drawing command received must be
displayed. However the scanout display is all or nothing. Consequently,
if a 2d canvas draw is received, the display must be switched to the
drawn canvas. In other words, if the last message received is a GL draw
the display should switch to the GL display, if it's a 2d draw message
the display should be switched to the client 2d canvas.

(there will probably be a stipped-down "gl-only" channel in the future,
or support for other streaming methods, but this protocol change should
be enough for basic virgl or other gpu-accelerated support)

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2016-01-14 11:52:41 +00:00
Marc-Andre Lureau
267391c8fd protocol: learn to describe fd passing in messages
Add a new type, "unix_fd", used to describe file descriptor sharing via
socket ancillary data (these messages are local only).

The marshaller/demarshaller can't serialize this in memory (consume_fd
implementation is empty), so it is the responsability of the marshaller
user to handle sending and receiving the handles, which are appended at
the end of the message with an extra stream byte (because some Unix
requires sending at least a byte with ancillary data).

Even if there is no fd to send (or if the fd is invalid etc), the
receiver side expects an extra byte anyway.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2016-01-14 11:46:16 +00:00
Christophe Fergeau
6b86c1a510 Use gcc builtin rather than asm for memory barriers
This should make things more portable.

On my machine, __sync_synchronize() uses mfence rather than lock; addl;
Looking at the kernel memory barriers, this should be fine:
http://lxr.free-electrons.com/source/arch/x86/um/asm/barrier.h

The kernel favours using mfence, but falls back to lock; addl; when it's
not available (32 bit non-SSE machines).

https://bugs.freedesktop.org/show_bug.cgi?id=86997
2016-01-08 15:31:38 +01:00
Frediano Ziglio
cffb8baee1 macros: make SPICE_CONTAINEROF more typesafe
Check the pointer given is the same type as member pointer.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2015-12-04 11:15:12 +00:00
Christophe Fergeau
95b5617874 build-sys: Use $datadir for .proto files/codegen scripts
They are not arch-specific, so installing them in $libdir is not needed.
2015-10-02 12:51:51 +02:00
Jonathon Jongsma
017ddbe7a7 post-release version bump 2015-09-25 13:17:20 -05:00
Jonathon Jongsma
c9b3648f48 Update NEWS for 0.12.10 release 2015-09-22 15:30:54 -05:00
Frediano Ziglio
b397eca557 macros: fix compatibility with non-clang compilers
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
2015-08-20 11:16:31 +01:00
Victor Toso
39be7a8fce macros: fix alignment issue reported by clang
char_device.c:131:52: warning: cast from 'uint8_t *'
(aka 'unsigned char *') to 'SpiceCharDeviceMsgToClientItem *'
(aka 'struct SpiceCharDeviceMsgToClientItem *')
increases required alignment from 1 to 8 [-Wcast-align]

 SpiceCharDeviceMsgToClientItem *msg_item = SPICE_CONTAINEROF(item,
                                            ^~~~~~~~~~~~~~~~~~~~~~~

../spice-common/spice-protocol/spice/macros.h:142:6: note: expanded
from macro 'SPICE_CONTAINEROF'

 ((struct_type *)((uint8_t *)(ptr) - SPICE_OFFSETOF(struct_type, member)))
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2015-08-20 11:05:19 +01:00
Victor Toso
fa19ebb83f macros: verify if __alloc_size__ works with clang
So we can avoid using using an attribute not supported for the compiler.

warning:
../spice-common/common/mem.h:91:80: warning: unknown attribute
'__alloc_size__' ignored [-Wunknown-attributes]

void *spice_malloc0_n(size_t n_blocks, size_t n_block_bytes)
SPICE_GNUC_MALLOC SPICE_GNUC_ALLOC_SIZE2(1,2);

../spice-common/spice-protocol/spice/macros.h:52:52: note: expanded
from macro 'SPICE_GNUC_ALLOC_SIZE2'

 #define SPICE_GNUC_ALLOC_SIZE2(x,y) __attribute__((__alloc_size__(x,y)))
                                                    ^
2015-08-20 11:00:35 +01:00
Frediano Ziglio
2cd036e9d4 Fix endianess compatibility with old GCC versions
GCC 4.4.7 does not define __BYTE_ORDER__ macros so use architecture
macro to attempt to detect endianess.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Reported-by: Swapna Krishnan <skrishna@redhat.com>
Tested-by: Swapna Krishnan <skrishna@redhat.com>
Acked-by: Uri Lublin <uril@redhat.com>
2015-08-19 15:42:10 +01:00
Christophe Fergeau
726c6520ae Use 0xffu everywhere in new SPICE_MAGIC_CONST macro
This should have been squashed in the commit introducing the macro, but
I forgot to commit this before pushing it.
2015-08-12 14:17:16 +02:00
Frediano Ziglio
295d05e733 Define and use new SPICE_MAGIC_CONST macro
This macro allow to define magic constants without using weird
memory tweacks.
This remove some possible warning from some compiler and
make code more optimized as compiler is able to compute the
constant.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
2015-08-12 14:15:27 +02:00
Frediano Ziglio
3ab16f2dad Detects processor endianess using preprocessor
This allow to define macros based on endianess in public headers

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
2015-08-12 14:15:27 +02:00
Christophe Fergeau
03a28f5856 build-sys: Make installed spice_codegen.py is executable
Files listed as _DATA in Makefile.am are installed without the
executable bit set, files listed as _SCRIPT do get the executable bit
set. As spice_codegen.py is meant to be run by spice-protocol users,
make sure this bit is set.
2015-08-10 18:00:45 +02:00
Christophe Fergeau
52ae5ed2c8 build-sys: Make sure aclocal picks up macros in the m4/ dir
Older aclocal version needs to have ACLOCAL_FLAGS defined in Makefile.am
in order to be able to pick up macros stored in m4/ in the source
directory.
2015-08-07 12:55:07 +02:00