[RFC PATCH spice-server v5 19/22] cursor-channel: Allow to not handle a QXL device

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

 



QXL device requires a QXL interface which imply all sorts
of requirements like memory sharing.
Currently RedCursorChannel uses QXL to release resources
allocated from such devices.
However this is quite a limitation as potentially we
can implement cursors in a virtual device.
This for instance is the case of streaming device.

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

diff --git a/server/cursor-channel.c b/server/cursor-channel.c
index 5ece576c..fa75dab2 100644
--- a/server/cursor-channel.c
+++ b/server/cursor-channel.c
@@ -94,7 +94,9 @@ static void cursor_item_unref(CursorItem *item)
         return;
 
     cursor_cmd = item->red_cursor;
-    red_qxl_release_resource(item->qxl, cursor_cmd->release_info_ext);
+    if (item->qxl) {
+        red_qxl_release_resource(item->qxl, cursor_cmd->release_info_ext);
+    }
     red_put_cursor_cmd(cursor_cmd);
     free(cursor_cmd);
 
@@ -290,7 +292,7 @@ static void cursor_channel_send_item(RedChannelClient *rcc, RedPipeItem *pipe_it
     red_channel_client_begin_send_message(rcc);
 }
 
-CursorChannel* cursor_channel_new(RedsState *server, QXLInstance *qxl,
+CursorChannel* cursor_channel_new(RedsState *server, QXLInstance *qxl, uint32_t id,
                                   const SpiceCoreInterfaceInternal *core)
 {
     spice_debug("create cursor channel");
@@ -298,7 +300,7 @@ CursorChannel* cursor_channel_new(RedsState *server, QXLInstance *qxl,
                         "spice-server", server,
                         "core-interface", core,
                         "channel-type", SPICE_CHANNEL_CURSOR,
-                        "id", qxl->id,
+                        "id", id,
                         "migration-flags", 0,
                         "qxl", qxl,
                         "handle-acks", TRUE,
diff --git a/server/cursor-channel.h b/server/cursor-channel.h
index 9f3ef52e..c173e2ca 100644
--- a/server/cursor-channel.h
+++ b/server/cursor-channel.h
@@ -56,8 +56,8 @@ GType cursor_channel_get_type(void) G_GNUC_CONST;
  * provided as helper functions and should only be called from the
  * CursorChannel thread.
  */
-CursorChannel*       cursor_channel_new         (RedsState *server, QXLInstance *qxl,
-                                                 const SpiceCoreInterfaceInternal *core);
+CursorChannel* cursor_channel_new(RedsState *server, QXLInstance *qxl, uint32_t id,
+                                  const SpiceCoreInterfaceInternal *core);
 
 /**
  * Cause the channel to disconnect all clients
diff --git a/server/red-worker.c b/server/red-worker.c
index 0e2e8fa3..81a318ca 100644
--- a/server/red-worker.c
+++ b/server/red-worker.c
@@ -1350,7 +1350,7 @@ RedWorker* red_worker_new(QXLInstance *qxl,
 
     worker->event_timeout = INF_EVENT_WAIT;
 
-    worker->cursor_channel = cursor_channel_new(reds, qxl,
+    worker->cursor_channel = cursor_channel_new(reds, qxl, qxl->id,
                                                 &worker->core);
     channel = RED_CHANNEL(worker->cursor_channel);
     red_channel_init_stat_node(channel, &worker->stat, "cursor_channel");
-- 
2.13.5

_______________________________________________
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]