[Spice-devel] aspeed: video frames pass-through

Christophe Fergeau cfergeau at redhat.com
Wed Nov 18 06:06:05 PST 2015


Hey,

On Wed, Nov 18, 2015 at 04:03:16PM +0300, Anton D. Kachalov wrote:
> Hello.
> 
> consume_* in parse_msgc_display_init()
> 
> and a number of:
> 
> spice_marshaller_add_int32
> spice_marshaller_add_uint16
> spice_marshaller_add_uint64
> spice_marshaller_add_uint32
> 

Ah right, these would cause issues. I don't know why, I was sure I saw
alignment-safe functions when I looked at these. Replacing write_int* in
spice-common/common/marshallers.c with alignment-safe functions, and
doing the same in spice-common/common/generated_server_demarshallers.c for
read_int* (and possibly in other generated files) should avoid most of
these issue.
By 'alignment-safe', I mean:
static uint16_t read_uint16(unsigned uint16_t *ptr)
{
    return (ptr[1] << 8) || ptr[0];
}
(or a macro version of it)

> 1. Break compatibility and avoid 8/16 bit fields in packed structures.
> 2. Rewrite consume_*/spice_marshaller_add_* routines to make it
> aligned access. This might degrade the overall performance.

Yup, I'm suggesting 2. above. Maybe it will be best to make these
code-paths ARM specific.

Christophe
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/spice-devel/attachments/20151118/3d79cab6/attachment.sig>


More information about the Spice-devel mailing list