[Spice-devel] [PATCH] spice-protocl: add SPICE_MSG_DISPLAY_SURFACE_CREATE/DESTROY

Alexander Larsson alexl at redhat.com
Fri Feb 19 05:19:29 PST 2010


On Thu, 2010-02-18 at 01:16 +0200, Izik Eidus wrote:
> From 7a182d48ee603177d522edec9b189f2f6e3ee5a6 Mon Sep 17 00:00:00 2001
> From: Izik Eidus <ieidus at redhat.com>
> Date: Thu, 18 Feb 2010 01:13:56 +0200
> Subject: [PATCH] spice-protocl: add
> SPICE_MSG_DISPLAY_SURFACE_CREATE/DESTROY
> 
> Protocol commands to create/destroy surface on the client.
> 
> I removed SPICE_MSG_DISPLAY_MODE as it now not needed
> 
> Signed-off-by: Izik Eidus <ieidus at redhat.com>
> ---
>  spice/protocol.h |   26 ++++++++++++++++++++++++--
>  1 files changed, 24 insertions(+), 2 deletions(-)
> 
> diff --git a/spice/protocol.h b/spice/protocol.h
> index 5f01a12..e0dbd32 100644
> --- a/spice/protocol.h
> +++ b/spice/protocol.h
> @@ -339,8 +339,7 @@ typedef struct SPICE_ATTR_PACKED
> SpiceMsgcMainMouseModeRequest {
>  } SpiceMsgcMainMouseModeRequest;
>  
>  enum {
> -    SPICE_MSG_DISPLAY_MODE = SPICE_MSG_FIRST_AVAIL,
> -    SPICE_MSG_DISPLAY_MARK,
> +    SPICE_MSG_DISPLAY_MARK = SPICE_MSG_FIRST_AVAIL,
>      SPICE_MSG_DISPLAY_RESET,
>      SPICE_MSG_DISPLAY_COPY_BITS,

Is this really necessary? It shifts the value of all the other messages,
which makes backwards compat unnecessarily complex. Can't we just leave
the old value unused?

> @@ -368,6 +367,9 @@ enum {
>      SPICE_MSG_DISPLAY_DRAW_TRANSPARENT,
>      SPICE_MSG_DISPLAY_DRAW_ALPHA_BLEND,
>  
> +    SPICE_MSG_DISPLAY_SURFACE_CREATE,
> +    SPICE_MSG_DISPLAY_SURFACE_DESTROY,
> +
>      SPICE_MSG_END_DISPLAY,
>  };
>  
> @@ -389,7 +391,26 @@ typedef struct SPICE_ATTR_PACKED
> SpiceMsgDisplayMode {
>      uint32_t bits;
>  } SpiceMsgDisplayMode;
>  
> +enum {
> +    SPICE_SURFACE_FLAGS_PRIMARY = (1 << 0),
> +};
> +
> +typedef struct SPICE_ATTR_PACKED SpiceMsgSurfaceCreate {
> +    uint32_t surface_id;
> +    uint32_t width;
> +    uint32_t height;
> +    int32_t stride;
> +    uint8_t depth;
> +    uint32_t flags;
> +    uint32_t type;
> +} SpiceMsgSurfaceCreate;

Do you really need for the surface to have a specific stride? What does
the server care what the stride is on the client?

Also, what happens if you create multiple PRIMARY surfaces? Is that how
multi-monitor works?


-- 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 Alexander Larsson                                            Red Hat, Inc 
       alexl at redhat.com            alexander.larsson at gmail.com 
He's an uncontrollable guerilla sorceror looking for a cure to the poison 
coursing through his veins. She's a supernatural antique-collecting journalist 
on her way to prison for a murder she didn't commit. They fight crime! 



More information about the Spice-devel mailing list