[Spice-devel] [PATCH 09/23] simplify dcc_release_item

Jonathon Jongsma jjongsma at redhat.com
Tue May 17 19:59:56 UTC 2016


Acked-by: Jonathon Jongsma <jjongsma at redhat.com>

On Mon, 2016-05-16 at 14:31 +0100, Frediano Ziglio wrote:
> Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
> ---
>  server/dcc.c | 41 +----------------------------------------
>  1 file changed, 1 insertion(+), 40 deletions(-)
> 
> diff --git a/server/dcc.c b/server/dcc.c
> index 20ba6ee..7d9d366 100644
> --- a/server/dcc.c
> +++ b/server/dcc.c
> @@ -1608,46 +1608,7 @@ int dcc_handle_migrate_data(DisplayChannelClient *dcc,
> uint32_t size, void *mess
>      return TRUE;
>  }
>  
> -static void release_item_after_push(RedPipeItem *item)
> -{
> -    red_pipe_item_unref(item);
> -}
> -
> -// TODO: share code between before/after_push since most of the items need
> the same
> -// release
> -static void release_item_before_push(DisplayChannelClient *dcc, RedPipeItem
> *item)
> -{
> -    spice_debug("item.type: %d", item->type);
> -    switch (item->type) {
> -    case RED_PIPE_ITEM_TYPE_STREAM_CREATE:
> -    case RED_PIPE_ITEM_TYPE_STREAM_DESTROY:
> -    case RED_PIPE_ITEM_TYPE_DRAW:
> -    case RED_PIPE_ITEM_TYPE_STREAM_CLIP:
> -    case RED_PIPE_ITEM_TYPE_UPGRADE:
> -    case RED_PIPE_ITEM_TYPE_IMAGE:
> -    case RED_PIPE_ITEM_TYPE_MONITORS_CONFIG:
> -    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:
> -    case RED_PIPE_ITEM_TYPE_GL_SCANOUT:
> -    case RED_PIPE_ITEM_TYPE_GL_DRAW:
> -        red_pipe_item_unref(item);
> -        break;
> -    default:
> -        spice_critical("invalid item type");
> -    }
> -}
> -
>  void dcc_release_item(DisplayChannelClient *dcc, RedPipeItem *item, int
> item_pushed)
>  {
> -    if (item_pushed)
> -        release_item_after_push(item);
> -    else
> -        release_item_before_push(dcc, item);
> +    red_pipe_item_unref(item);
>  }


More information about the Spice-devel mailing list