[PATCH 05/23] simplify release of CREATE_SURFACE and DESTROY_SURFACE pipe items

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

 



Putting base as first item the default free function is fine.

Signed-off-by: Frediano Ziglio <fziglio@xxxxxxxxxx>
---
 server/dcc.c             | 16 ++--------------
 server/dcc.h             |  2 +-
 server/display-channel.h |  2 +-
 3 files changed, 4 insertions(+), 16 deletions(-)

diff --git a/server/dcc.c b/server/dcc.c
index 6f08cd9..a6d4fc4 100644
--- a/server/dcc.c
+++ b/server/dcc.c
@@ -1653,24 +1653,12 @@ static void release_item_before_push(DisplayChannelClient *dcc, RedPipeItem *ite
     case RED_PIPE_ITEM_TYPE_UPGRADE:
     case RED_PIPE_ITEM_TYPE_IMAGE:
     case RED_PIPE_ITEM_TYPE_MONITORS_CONFIG:
-        red_pipe_item_unref(item);
-        break;
-    case RED_PIPE_ITEM_TYPE_CREATE_SURFACE: {
-        RedSurfaceCreateItem *surface_create = SPICE_CONTAINEROF(item, RedSurfaceCreateItem,
-                                                                 pipe_item);
-        free(surface_create);
-        break;
-    }
-    case RED_PIPE_ITEM_TYPE_DESTROY_SURFACE: {
-        RedSurfaceDestroyItem *surface_destroy = SPICE_CONTAINEROF(item, RedSurfaceDestroyItem,
-                                                                   pipe_item);
-        free(surface_destroy);
-        break;
-    }
+    case RED_PIPE_ITEM_TYPE_CREATE_SURFACE:
     case RED_PIPE_ITEM_TYPE_INVAL_ONE:
     case RED_PIPE_ITEM_TYPE_VERB:
     case RED_PIPE_ITEM_TYPE_MIGRATE_DATA:
     case RED_PIPE_ITEM_TYPE_PIXMAP_SYNC:
+    case RED_PIPE_ITEM_TYPE_DESTROY_SURFACE:
     case RED_PIPE_ITEM_TYPE_PIXMAP_RESET:
     case RED_PIPE_ITEM_TYPE_INVAL_PALETTE_CACHE:
     case RED_PIPE_ITEM_TYPE_STREAM_ACTIVATE_REPORT:
diff --git a/server/dcc.h b/server/dcc.h
index 89934bc..63a7496 100644
--- a/server/dcc.h
+++ b/server/dcc.h
@@ -122,8 +122,8 @@ struct DisplayChannelClient {
 #define RCC_TO_DCC(rcc) SPICE_CONTAINEROF((rcc), DisplayChannelClient, common.base)
 
 typedef struct RedSurfaceCreateItem {
-    SpiceMsgSurfaceCreate surface_create;
     RedPipeItem pipe_item;
+    SpiceMsgSurfaceCreate surface_create;
 } RedSurfaceCreateItem;
 
 typedef struct RedGlScanoutUnixItem {
diff --git a/server/display-channel.h b/server/display-channel.h
index 76668de..647d8c0 100644
--- a/server/display-channel.h
+++ b/server/display-channel.h
@@ -241,8 +241,8 @@ static inline int get_stream_id(DisplayChannel *display, Stream *stream)
 }
 
 typedef struct RedSurfaceDestroyItem {
-    SpiceMsgSurfaceDestroy surface_destroy;
     RedPipeItem pipe_item;
+    SpiceMsgSurfaceDestroy surface_destroy;
 } RedSurfaceDestroyItem;
 
 typedef struct RedUpgradeItem {
-- 
2.7.4

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