summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* NEWS: update for 0.12.11 releaseMarc-André Lureau2016-03-101-0/+7
| | | | Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
* Remove codegenMarc-André Lureau2016-03-1015-6078/+2
| | | | | | | | 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>
* protocol: Add support for the VP8 and h264 video codecsFrancois Gouget2016-03-033-0/+8
| | | | | | | | | 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>
* macros: do not use more type safe CONTAINEROF version if not requestedFrediano Ziglio2016-03-021-1/+6
| | | | | | | | 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>
* codegen: simplify FdTypeMarc-André Lureau2016-01-191-4/+4
| | | | | | | | 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>
* protocol: add unix GL scanout messagesMarc-Andre Lureau2016-01-143-0/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* protocol: learn to describe fd passing in messagesMarc-Andre Lureau2016-01-143-1/+15
| | | | | | | | | | | | | | | | | 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>
* Use gcc builtin rather than asm for memory barriersChristophe Fergeau2016-01-081-6/+1
| | | | | | | | | | | | | 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
* macros: make SPICE_CONTAINEROF more typesafeFrediano Ziglio2015-12-041-0/+6
| | | | | | | 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>
* build-sys: Use $datadir for .proto files/codegen scriptsChristophe Fergeau2015-10-023-4/+4
| | | | They are not arch-specific, so installing them in $libdir is not needed.
* post-release version bumpJonathon Jongsma2015-09-251-1/+1
|
* Update NEWS for 0.12.10 releaseJonathon Jongsma2015-09-221-0/+7
|
* macros: fix compatibility with non-clang compilersFrediano Ziglio2015-08-201-0/+4
| | | | Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
* macros: fix alignment issue reported by clangVictor Toso2015-08-201-1/+1
| | | | | | | | | | | | | | | | 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))) ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* macros: verify if __alloc_size__ works with clangVictor Toso2015-08-201-1/+2
| | | | | | | | | | | | | | | | | 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))) ^
* Fix endianess compatibility with old GCC versionsFrediano Ziglio2015-08-191-1/+2
| | | | | | | | | | 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>
* Use 0xffu everywhere in new SPICE_MAGIC_CONST macroChristophe Fergeau2015-08-121-2/+2
| | | | | This should have been squashed in the commit introducing the macro, but I forgot to commit this before pushing it.
* Define and use new SPICE_MAGIC_CONST macroFrediano Ziglio2015-08-127-7/+21
| | | | | | | | | | 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>
* Detects processor endianess using preprocessorFrediano Ziglio2015-08-121-0/+55
| | | | | | This allow to define macros based on endianess in public headers Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
* build-sys: Make installed spice_codegen.py is executableChristophe Fergeau2015-08-101-1/+4
| | | | | | | 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.
* build-sys: Make sure aclocal picks up macros in the m4/ dirChristophe Fergeau2015-08-071-0/+1
| | | | | | 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.
* build-sys: Add m4 file for AX_PYTHON_MODULEChristophe Fergeau2015-08-071-0/+49
| | | | | This fixes a build failure on older distros (EL6) which do not have this macro readily available.
* proto: Use proper type for preferred_compression fieldChristophe Fergeau2015-08-071-1/+1
| | | | | No need to use an uint8 typed member, we can directly use the appropriate enum8 type here, which makes everything more explicit.
* proto: Rename image_compress to image_compressionChristophe Fergeau2015-08-071-1/+1
| | | | | | | Re-using the SPICE_IMAGE_COMPRESS_ prefix in newer spice-protocol releases is going to cause issues as there will be clashing enum members in older spice-server releases. Using SPICE_IMAGE_COMPRESSION_ as a prefix sidesteps these backward compability issues.
* build-sys: Install code generation data/scriptsChristophe Fergeau2015-08-072-9/+10
| | | | | | | spice-common generate code from these python scripts and the installed SPICE .proto. This commit installs them during make install, and adds a codegendir variable to the pkgconfig file so that spice-common can locate the scripts.
* build-sys: Add --enable-code-generatorChristophe Fergeau2015-08-073-1/+41
| | | | | | | | | This flag is only used for git builds, and can usually safely be disabled. When it's enabled, configure.ac will check that python-six and pyparsing are available, and will use these together with the codegen python scripts in order to automatically regenerate enums.h when the .proto files change.
* build-sys: Make sure new files are dist'edChristophe Fergeau2015-08-072-1/+11
| | | | | | The just added .proto files and python code generation code need to be added to EXTRA_DIST in order to be distributed in tarballs, and we need to recurse in the new python_modules directory.
* Merge protocol code generation bits from spice-commonChristophe Fergeau2015-08-0710-0/+5983
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The history for spice*.proto, spice_codegen.py and python_modules/ was extracted from spice-common using git filter-branch: git filter-branch \ --prune-empty \ --index-filter ' git ls-tree -z -r --name-only --full-tree $GIT_COMMIT \ | grep -z -v "^python_modules/" \ | grep -z -v "^spice.proto" \ | grep -z -v "^spice1.proto" \ | grep -z -v "^spice_codegen.py" \ | xargs -0 -r git rm -f --cached -r ' \ -- \ --all git filter-branch --force \ --prune-empty \ --index-filter ' git rm -f spice-protocol --cached --ignore-unmatch ' \ -- \ --all
| * codegen: ptypes.py: keep attribute names in setsUri Lublin2015-08-041-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch changes the type of 'valid_attributes' and 'attributes_with_arguments'. Both of them are list of different strings and are kept in sets. This was the intention of the original code, but this patch use a specific set([ strings ]) format, instead of { strings }. This fixes the build for me on RHEL-6 (python-2.6.6). Build error is: File "/home/ulublin/git/spice/spice-common/python_modules/ptypes.py", line 67 'end', ^ SyntaxError: invalid syntax
| * codegen: Allow to specify C type for index variableFrediano Ziglio2015-07-231-1/+3
| | | | | | | | | | | | | | | | This is to prepare to generate the wireshark dissector which uses glib types instead of the newer C ones (for compatibility with some compilers). Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
| * codegen: Check we don't pop too many indexesFrediano Ziglio2015-07-231-0/+1
| |
| * codegen: Remove old ptr32 attributeFrediano Ziglio2015-07-231-4/+0
| | | | | | | | | | | | This attribute is not used in code. Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
| * codegen: Do some checks on attributesFrediano Ziglio2015-07-231-0/+72
| | | | | | | | | | | | | | | | | | Verify that the attribute is known. This could help for instance to avoid some future typo mistakes. We also now have a list of attributes that we can comment for documentation purpose. Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
| * codegen: Reuse code to fix attribute from prototype fileFrediano Ziglio2015-07-231-16/+16
| | | | | | | | Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
| * codegen: Remove duplicate variable initializationFrediano Ziglio2015-07-231-1/+0
| | | | | | | | Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
| * codegen: Optimize code indentation and avoid a loopFrediano Ziglio2015-07-231-2/+1
| | | | | | | | Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
| * codegen: Fix typo in variable nameFrediano Ziglio2015-07-231-1/+1
| | | | | | | | Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
| * codegen: Simplify if/else blocksFrediano Ziglio2015-07-231-18/+11
| | | | | | | | | | | | Blocks were mainly the same, this reduces the amount of code. Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
| * codegen: Import six module before first useFrediano Ziglio2015-07-231-1/+2
| | | | | | | | | | | | | | The module is used in the initial try/except so make sure it is already imported. Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
| * codegen: Fix enums.h generation with python3Christophe Fergeau2015-07-231-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Trying to generate enums.h with python3 results in Traceback (most recent call last): File "./spice_codegen.py", line 217, in <module> write_enums(writer, options.generate_dissector) File "./spice_codegen.py", line 99, in write_enums write_channel_enums(writer, c, False, False) File "./spice_codegen.py", line 17, in write_channel_enums if len(messages) == 0: TypeError: object of type 'filter' has no len() filter() returns an enumerator object in python3 while it used to return a list in python2. Using list(filter()) instead fixes that error. I've checked that the generated enums.h is identical with python2 and python3.
| * proto: Remove space before tabChristophe Fergeau2015-07-202-3/+3
| | | | | | | | | | | | There are 3 lines in spice.proto/spice1.proto which start with spaces and then contain a tab. This commit removes the spaces and only keep the tab.
| * Proto: Add preferred compression message and constants.Javier Celaya2015-06-221-0/+15
| | | | | | | | | | | | | | | | | | When accessing a virtual desktop from different devices, some may have different image compression requirements, e.g. slow devices may prefer the faster LZ4 over GLZ. This message instructs the server to switch the image compression algorithm. This patch also promotes the SPICE_IMAGE_COMPRESS_* constants so that they are available from both the server and the client.
| * codegen: Use six.PY3 rather than six.PY2Christophe Fergeau2015-04-142-6/+6
| | | | | | | | | | | | Older versions of python-six (at least 1.3.0) defined six.PY3 but not six.PY2. six.PY2 is only used twice in straightforward tests so it's easy to use six.PY3 instead.
| * Make spice_codegen.py work on both Python 2 and 3Alexander Wauck2015-04-016-69/+78
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a new version of my previous patch that does not include six.py. It's still kind of big, but at least it's all spice-common changes now. There are also a few other fixes that Christophe brought to my attention. Note that six now needs to be installed on the system (python-six on Fedora and Debian, six on PyPI). This *should* be enough to make spice_codegen.py work on both Python 2 and Python 3. The major changes are as follows: * cStringIO.StringIO -> io.StringIO * str vs. unicode updates (io.StringIO doesn't like str) * integer division * foo.has_key(bar) -> bar in foo * import internal_thing -> from . import internal_thing * removed from __future__ import with_statement (might break Python 2.5?) * changed some lambdas to list comprehensions (done by 2to3) * cast some_dict.keys() to list where needed (e.g. for sorting) * use normal type names with isinstance instead of types.WhateverType Signed-off-by: Alexander Wauck <awauck@codeweavers.com>
| * Add LZ4 image compression support.Javier Celaya2014-12-021-0/+3
| | | | | | | | | | | | | | - Add a new LZ4 image type to spice.proto. - Add canvas_get_lz4() to common_canvas_base, to get a pixmap from an lz4 image. - Add an enable-lz4 switch to the configure script, disabled by default.
| * python: Fix -Wsign-compareFabiano Fidêncio2014-09-181-3/+3
| | | | | | | | | | | | | | The return of the get_array_size() is used as a limit in a loop, being compared with an unsigned index (indexes are always unsigned). To avoid the -Wsign-compare warning, let's cast the return of the get_array_size() to unsigned and make GCC happier.
| * python: Fix -Wunused-parameterFabiano Fidêncio2014-09-182-7/+7
| | | | | | | | | | | | | | | | Although the most part of the parameters marked as unused are actually being used for a few functions, a bunch of warnings can be seen when the code is compiled with "-Wall -Wextra". As adding the unused attribute means that the variable/parameter is meant to be *possibly* unused, we're safe adding it in the generated code, even for used variables/parameters.
| * demarshal: prefix variable name with parent namesMarc-André Lureau2014-05-151-17/+30
| | | | | | | | | | | | Avoid naming clash if parent structures have the same name https://bugzilla.redhat.com/show_bug.cgi?id=1021995
| * marshaller: Use #include <> for headers in $srcdir/commonChristophe Fergeau2014-04-162-3/+3
| | | | | | | | | | | | | | Since the (de)marshallers are now generated in $builddir and not in $srcdir, when these generated files include a file located in $srcdir/common, the compiler will find them thanks to a -I directive, so it makes more sense to use <> rather than "" when including them.
| * Use #include "common/..." in (de)marshallersChristophe Fergeau2014-04-162-3/+3
| | | | | | | | | | | | | | | | Now that they are created in $builddir, their includes will need to refer to files in $srcdir, which can be different. It's cleaner to add -I $(top_srcdir)/spice-common/ to modules using spice-common rather than having -I $(top_srcdir)/spice-common/common which would could create header collisions.