[Spice-devel] [PATCH v4 0/2] protocol: add gl scanout support

Frediano Ziglio fziglio at redhat.com
Thu Jan 14 05:08:03 PST 2016


> 
> Hey,
> 
> On Thu, Jan 14, 2016 at 07:00:45AM -0500, Frediano Ziglio wrote:
> > 
> > I don't get what you are proposing.
> > There are actually 2 .proto file. Version 1 and version 2. Should we add
> > a version 3? How to add just another .proto for a single message.
> > Seems that there is no infrastructure to do what you are proposing.
> > But may be I'm wrong or I didn't get it.
> 
> I don't really have a very good suggestion to make. My concern is that
> until now, protocol additions meant that we were committing to support
> this more or less forever.
> In this case, this protocol addition is local-only, and has only been
> tested by few people, which does not make me very comfortable with
> setting it in stone right now. So I'm asking if we should mark this as
> experimental somehow (but I don't have great suggestions about the
> 'how').
> 
> Christophe
> 

I tried to play with @ifdef for new messages... no luck, it does not
work at all.
What I would suggest is using an experimental range.
Message type is 16 bit so let's suppose is 50000-65535.
When we want to add an experimental message we start with 50000.
All experimental packages (spice-server/spice-gtk/whatever) will use
these numbers. Numbers should not be reused so we could put a comment
in the protocol with last numbers used in spice-server.git/master.
If we need to change the ABI we bump the number.
Production tool should not use experimental messages (is up to
the above layer to not compile such code).

So just in this case the additional messages should be

server:
...
    /* These are experimental messages! Do not use in production */
    message {
        unix_fd drm_dma_buf_fd;
        uint32 width;
        uint32 height;
        uint32 stride;
        /* specifies the format of drm_dma_buf_fd defined in drm_fourcc.h */
        uint32 drm_fourcc_format;
        gl_scanout_flags flags;
    } gl_scanout_unix = 50000;

    message {
        uint32 x;
        uint32 y;
        uint32 w;
        uint32 h;
    } gl_draw;
...
client:
...
    /* These are experimental messages! Do not use in production */
    message {
    } gl_draw_done = 50000;


If we decide to extend gl_scanout_unix message we change server part to

server:
...
    /* These are experimental messages! Do not use in production */
    message {
        uint32 x;
        uint32 y;
        uint32 w;
        uint32 h;
    } gl_draw = 50001;

    message {
        unix_fd drm_dma_buf_fd;
        uint32 width;
        uint32 height;
        uint32 stride;
        /* specifies the format of drm_dma_buf_fd defined in drm_fourcc.h */
        uint32 drm_fourcc_format;
        gl_scanout_flags flags;
        PUT EXTENSION HERE
    } gl_scanout_unix;


Frediano


More information about the Spice-devel mailing list