[PATCH spice-server] red-worker: Introduce RedWorkerMessageGlDraw structure

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



All RedWorker messages starts with RedWorker except
SpiceMsgDisplayGlDraw.
For coherence introduce a RedWorkerMessageGlDraw structure
holding just SpiceMsgDisplayGlDraw. This also allows possible
extensions.

Signed-off-by: Frediano Ziglio <fziglio@xxxxxxxxxx>
---
 server/red-qxl.c    | 12 +++++++-----
 server/red-qxl.h    |  4 ++++
 server/red-worker.c |  6 +++---
 3 files changed, 14 insertions(+), 8 deletions(-)

diff --git a/server/red-qxl.c b/server/red-qxl.c
index de0546f..b6b3770 100644
--- a/server/red-qxl.c
+++ b/server/red-qxl.c
@@ -907,11 +907,13 @@ void spice_qxl_gl_draw_async(QXLInstance *qxl,
 {
     QXLState *qxl_state;
     RedWorkerMessage message = RED_WORKER_MESSAGE_GL_DRAW_ASYNC;
-    SpiceMsgDisplayGlDraw draw = {
-        .x = x,
-        .y = y,
-        .w = w,
-        .h = h
+    RedWorkerMessageGlDraw draw = {
+        {
+            .x = x,
+            .y = y,
+            .w = w,
+            .h = h
+        },
     };
 
     spice_return_if_fail(qxl != NULL);
diff --git a/server/red-qxl.h b/server/red-qxl.h
index 7743124..0c9498a 100644
--- a/server/red-qxl.h
+++ b/server/red-qxl.h
@@ -298,6 +298,10 @@ typedef struct RedWorkerMessageGlScanout {
 typedef struct RedWorkerMessageClose {
 } RedWorkerMessageClose;
 
+typedef struct RedWorkerMessageGlDraw {
+    SpiceMsgDisplayGlDraw draw;
+} RedWorkerMessageGlDraw;
+
 enum {
     RED_DISPATCHER_PENDING_WAKEUP,
     RED_DISPATCHER_PENDING_OOM,
diff --git a/server/red-worker.c b/server/red-worker.c
index 9be4b99..d6a5e77 100644
--- a/server/red-worker.c
+++ b/server/red-worker.c
@@ -967,9 +967,9 @@ static
 void handle_dev_gl_draw_async(void *opaque, void *payload)
 {
     RedWorker *worker = opaque;
-    SpiceMsgDisplayGlDraw *draw = payload;
+    RedWorkerMessageGlDraw *draw = payload;
 
-    display_channel_gl_draw(worker->display_channel, draw);
+    display_channel_gl_draw(worker->display_channel, &draw->draw);
 }
 
 static void handle_dev_close(void *opaque, void *payload)
@@ -1227,7 +1227,7 @@ static void register_callbacks(Dispatcher *dispatcher)
     dispatcher_register_handler(dispatcher,
                                 RED_WORKER_MESSAGE_GL_DRAW_ASYNC,
                                 handle_dev_gl_draw_async,
-                                sizeof(SpiceMsgDisplayGlDraw),
+                                sizeof(RedWorkerMessageGlDraw),
                                 DISPATCHER_NONE);
     dispatcher_register_handler(dispatcher,
                                 RED_WORKER_MESSAGE_CLOSE_WORKER,
-- 
2.9.3

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]