Simplify release of CREATE_SURFACE and DESTROY_SURFACE pipe items

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

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
This commit is contained in:
Frediano Ziglio 2016-05-13 18:03:25 +01:00
parent 9ecff9e061
commit 68c6d52e32
3 changed files with 4 additions and 16 deletions

View File

@ -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:

View File

@ -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 {

View File

@ -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 {