[Spice-devel] [PATCH 06/22] worker: move red_process_draw to display-channel.c
Fabiano FidĂȘncio
fidencio at redhat.com
Wed Dec 2 09:37:45 PST 2015
On Wed, Dec 2, 2015 at 5:19 PM, Frediano Ziglio <fziglio at redhat.com> wrote:
> Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
> ---
> server/display-channel.c | 25 +++++++++++++++++++++----
> server/display-channel.h | 7 ++-----
> server/red_worker.c | 20 ++------------------
> 3 files changed, 25 insertions(+), 27 deletions(-)
>
> diff --git a/server/display-channel.c b/server/display-channel.c
> index 0750de8..645ea04 100644
> --- a/server/display-channel.c
> +++ b/server/display-channel.c
> @@ -1091,9 +1091,9 @@ static int validate_drawable_bbox(DisplayChannel *display, RedDrawable *drawable
> return TRUE;
> }
>
> -Drawable *display_channel_get_drawable(DisplayChannel *display, uint8_t effect,
> - RedDrawable *red_drawable, uint32_t group_id,
> - uint32_t process_commands_generation)
> +static Drawable *display_channel_get_drawable(DisplayChannel *display, uint8_t effect,
> + RedDrawable *red_drawable, uint32_t group_id,
> + uint32_t process_commands_generation)
> {
> Drawable *drawable;
> int x;
> @@ -1131,7 +1131,7 @@ Drawable *display_channel_get_drawable(DisplayChannel *display, uint8_t effect,
> return drawable;
> }
>
> -void display_channel_add_drawable(DisplayChannel *display, Drawable *drawable)
> +static void display_channel_add_drawable(DisplayChannel *display, Drawable *drawable)
> {
> int success = FALSE, surface_id = drawable->surface_id;
> RedDrawable *red_drawable = drawable->red_drawable;
> @@ -1181,6 +1181,23 @@ void display_channel_add_drawable(DisplayChannel *display, Drawable *drawable)
> #endif
> }
>
> +void display_channel_process_draw(DisplayChannel *display, RedDrawable *red_drawable,
> + uint32_t group_id, int process_commands_generation)
> +{
> + Drawable *drawable =
> + display_channel_get_drawable(display, red_drawable->effect, red_drawable, group_id,
> + process_commands_generation);
> +
> + if (!drawable) {
> + return;
> + }
> +
> + display_channel_add_drawable(display, drawable);
> +
> + display_channel_drawable_unref(display, drawable);
> +}
> +
> +
> int display_channel_wait_for_migrate_data(DisplayChannel *display)
> {
> uint64_t end_time = red_get_monotonic_time() + DISPLAY_CLIENT_MIGRATE_DATA_TIMEOUT;
> diff --git a/server/display-channel.h b/server/display-channel.h
> index 83b50ca..a990e09 100644
> --- a/server/display-channel.h
> +++ b/server/display-channel.h
> @@ -286,8 +286,6 @@ void display_channel_surface_unref (DisplayCha
> uint32_t surface_id);
> bool display_channel_surface_has_canvas (DisplayChannel *display,
> uint32_t surface_id);
> -void display_channel_add_drawable (DisplayChannel *display,
> - Drawable *drawable);
> void display_channel_current_flush (DisplayChannel *display,
> int surface_id);
> int display_channel_wait_for_migrate_data (DisplayChannel *display);
> @@ -300,11 +298,10 @@ void display_channel_destroy_surfaces (DisplayCha
> void display_channel_destroy_surface (DisplayChannel *display,
> uint32_t surface_id);
> uint32_t display_channel_generate_uid (DisplayChannel *display);
> -Drawable * display_channel_get_drawable (DisplayChannel *display,
> - uint8_t effect,
> +void display_channel_process_draw (DisplayChannel *display,
> RedDrawable *red_drawable,
> uint32_t group_id,
> - uint32_t process_commands_generation);
> + int process_commands_generation);
> void display_channel_process_surface_cmd (DisplayChannel *display,
> RedSurfaceCmd *surface,
> uint32_t group_id,
> diff --git a/server/red_worker.c b/server/red_worker.c
> index f2c3126..69486bf 100644
> --- a/server/red_worker.c
> +++ b/server/red_worker.c
> @@ -165,23 +165,6 @@ void red_drawable_unref(RedWorker *worker, RedDrawable *red_drawable,
> free(red_drawable);
> }
>
> -static inline void red_process_draw(RedWorker *worker, RedDrawable *red_drawable,
> - uint32_t group_id)
> -{
> - DisplayChannel *display = worker->display_channel;
> - Drawable *drawable =
> - display_channel_get_drawable(display, red_drawable->effect, red_drawable, group_id,
> - worker->process_commands_generation);
> -
> - if (!drawable) {
> - return;
> - }
> -
> - display_channel_add_drawable(worker->display_channel, drawable);
> -
> - display_channel_drawable_unref(display, drawable);
> -}
> -
> static int red_process_cursor(RedWorker *worker, uint32_t max_pipe_size, int *ring_is_empty)
> {
> QXLCommandExt ext_cmd;
> @@ -284,7 +267,8 @@ static int red_process_commands(RedWorker *worker, uint32_t max_pipe_size, int *
>
> if (!red_get_drawable(&worker->mem_slots, ext_cmd.group_id,
> red_drawable, ext_cmd.cmd.data, ext_cmd.flags)) {
> - red_process_draw(worker, red_drawable, ext_cmd.group_id);
> + display_channel_process_draw(worker->display_channel, red_drawable, ext_cmd.group_id,
> + worker->process_commands_generation);
> }
> // release the red_drawable
> red_drawable_unref(worker, red_drawable, ext_cmd.group_id);
> --
> 2.4.3
>
> _______________________________________________
> Spice-devel mailing list
> Spice-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/spice-devel
Acked-by: Fabiano FidĂȘncio <fidencio at redhat.com>
More information about the Spice-devel
mailing list