summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Levy <alevy@redhat.com>2013-08-03 14:37:54 +0200
committerAlon Levy <alevy@redhat.com>2013-08-12 20:20:37 +0300
commit8b456c0aef1b0a39e675284ce4d53c9d0704010c (patch)
tree459172fcaa892876d326fdb9ea67663f0d9545ee
parentfc27fb20b8ecd3e07809aec884f99f2121712bc9 (diff)
shared memory support in display channelnew
see spice protocol commit "add shared memory display channel support" for the design. This commit adds messages to support sharing the primary surface between the remote client for the display channel and the server. This commit updates the spice-protocol submodule as well.
-rw-r--r--common/client_marshallers.h1
-rw-r--r--common/messages.h22
m---------spice-protocol0
-rw-r--r--spice.proto26
4 files changed, 48 insertions, 1 deletions
diff --git a/common/client_marshallers.h b/common/client_marshallers.h
index 85051a0..01113d7 100644
--- a/common/client_marshallers.h
+++ b/common/client_marshallers.h
@@ -45,6 +45,7 @@ typedef struct {
void (*msgc_main_migrate_dst_do_seamless)(SpiceMarshaller *m, SpiceMsgcMainMigrateDstDoSeamless *msg);
void (*msgc_display_init)(SpiceMarshaller *m, SpiceMsgcDisplayInit *msg);
void (*msgc_display_stream_report)(SpiceMarshaller *m, SpiceMsgcDisplayStreamReport *msg);
+ void (*msgc_display_shm_reply)(SpiceMarshaller *m, SpiceMsgcDisplayShmReply *msg);
void (*msgc_inputs_key_down)(SpiceMarshaller *m, SpiceMsgcKeyDown *msg);
void (*msgc_inputs_key_up)(SpiceMarshaller *m, SpiceMsgcKeyUp *msg);
void (*msgc_inputs_key_modifiers)(SpiceMarshaller *m, SpiceMsgcKeyModifiers *msg);
diff --git a/common/messages.h b/common/messages.h
index a8a0eee..aa31e26 100644
--- a/common/messages.h
+++ b/common/messages.h
@@ -233,6 +233,15 @@ typedef struct SpiceMsgSurfaceCreate {
uint32_t flags;
} SpiceMsgSurfaceCreate;
+typedef struct SpiceMsgSurfaceCreateShm {
+ uint64_t shm_offset;
+ uint32_t surface_id;
+ uint32_t width;
+ uint32_t height;
+ uint32_t format;
+ uint32_t flags;
+} SpiceMsgSurfaceCreateShm;
+
typedef struct SpiceMsgSurfaceDestroy {
uint32_t surface_id;
} SpiceMsgSurfaceDestroy;
@@ -630,6 +639,19 @@ typedef struct SpiceMsgcPortEvent {
uint8_t event;
} SpiceMsgcPortEvent;
+typedef struct SpiceMsgcDisplayShmReply {
+ uint8_t accepted;
+} SpiceMsgcDisplayShmReply;
+
+typedef struct SpiceMsgDisplayShmOffer {
+ uint8_t name[128];
+} SpiceMsgDisplayShmOffer;
+
+typedef struct SpiceMsgDisplayShmDamage {
+ SpiceRect box;
+ SpiceClip clip;
+} SpiceMsgDisplayShmDamage;
+
SPICE_END_DECLS
#endif /* _H_SPICE_PROTOCOL */
diff --git a/spice-protocol b/spice-protocol
-Subproject 7be0e88e7e03a956b364cc847aad11b96ed4727
+Subproject 8c370b6a012993d1228302e6ce30a5ef5c57761
diff --git a/spice.proto b/spice.proto
index 5eede6b..0e94a12 100644
--- a/spice.proto
+++ b/spice.proto
@@ -425,7 +425,8 @@ flags8 string_flags {
};
flags32 surface_flags {
- PRIMARY
+ PRIMARY,
+ TOP_DOWN,
};
enum32 surface_fmt {
@@ -897,6 +898,25 @@ channel DisplayChannel : BaseChannel {
uint32 timeout_ms;
} stream_activate_report;
+ message {
+ uint8 name[128];
+ } shm_offer;
+
+ message {
+ /* TODO: does it make sense to care about surface_id != 0? */
+ Rect box;
+ Clip clip;
+ } shm_damage;
+
+ message {
+ uint64 shm_offset;
+ uint32 surface_id;
+ uint32 width;
+ uint32 height;
+ surface_fmt format;
+ surface_flags flags;
+ } @ctype(SpiceMsgSurfaceCreateShm) surface_create_shm;
+
client:
message {
uint8 pixmap_cache_id;
@@ -915,6 +935,10 @@ channel DisplayChannel : BaseChannel {
int32 last_frame_delay;
uint32 audio_delay;
} stream_report;
+
+ message {
+ uint8 accepted; // 0 not accepted, 1 accepted
+ } shm_reply;
};
flags16 keyboard_modifier_flags {