[Spice-devel] [PATCH 06/10] worker: some cleanup

Fabiano Fidêncio fidencio at redhat.com
Thu Nov 5 03:53:56 PST 2015


On Thu, Nov 5, 2015 at 10:29 AM, Fabiano Fidêncio <fidencio at redhat.com> wrote:
> On Thu, Nov 5, 2015 at 10:22 AM, Frediano Ziglio <fziglio at redhat.com> wrote:
>>
>>>
>>> From: Marc-André Lureau <marcandre.lureau at gmail.com>
>>>
>>> ---
>>>  server/red_worker.c | 20 +++++++-------------
>>>  1 file changed, 7 insertions(+), 13 deletions(-)
>>>
>>> diff --git a/server/red_worker.c b/server/red_worker.c
>>> index dc646bc..32611e2 100644
>>> --- a/server/red_worker.c
>>> +++ b/server/red_worker.c
>>> @@ -600,12 +600,6 @@ static void
>>> dcc_push_monitors_config(DisplayChannelClient *dcc);
>>>      SAFE_FOREACH(link, next, drawable, &(drawable)->glz_ring, glz,
>>>      LINK_TO_GLZ(link))
>>>
>>>
>>> -// TODO: replace with DCC_FOREACH when it is introduced
>>> -#define WORKER_TO_DCC(worker) \
>>> -    (worker->display_channel ?
>>> SPICE_CONTAINEROF(worker->display_channel->common.base.rcc,\
>>> -                       DisplayChannelClient, common.base) : NULL)
>>> -
>>> -
>>>  /* fixme: move to display channel */
>>>  DrawablePipeItem *drawable_pipe_item_new(DisplayChannelClient *dcc,
>>>                                           Drawable *drawable)
>>
>> I think this is the real cleanup, I'll split it into a new
>> "worker: remove unused WORKER_TO_DCC macro" patch.
>
> Okay (for the part that you'll split).
> Would be super handy if you could wait for the next series to resend
> the new version of this one.

Okay, okay. Just got to this patch now.
I completely agree with Frediano. This first hunk could be in another patch ...

>
>>
>>> @@ -833,7 +827,7 @@ static int cursor_is_connected(RedWorker *worker)
>>>          red_channel_is_connected(RED_CHANNEL(worker->cursor_channel));
>>>  }
>>>
>>> -static inline void red_pipe_add_drawable(DisplayChannelClient *dcc, Drawable
>>> *drawable)
>>> +static void dcc_add_drawable(DisplayChannelClient *dcc, Drawable *drawable)
>>>  {
>>>      DrawablePipeItem *dpi;
>>>
>>> @@ -842,18 +836,18 @@ static inline void
>>> red_pipe_add_drawable(DisplayChannelClient *dcc, Drawable *dr
>>>      red_channel_client_pipe_add(&dcc->common.base, &dpi->dpi_pipe_item);
>>>  }
>>>
>>> -static inline void red_pipes_add_drawable(RedWorker *worker, Drawable
>>> *drawable)
>>> +static void red_pipes_add_drawable(RedWorker *worker, Drawable *drawable)
>>>  {
>>>      DisplayChannelClient *dcc;
>>>      RingItem *dcc_ring_item, *next;
>>>
>>>      spice_warn_if(!ring_is_empty(&drawable->pipes));
>>>      WORKER_FOREACH_DCC_SAFE(worker, dcc_ring_item, next, dcc) {
>>> -        red_pipe_add_drawable(dcc, drawable);
>>> +        dcc_add_drawable(dcc, drawable);
>>>      }
>>>  }
>>>
>>> -static inline void red_pipe_add_drawable_to_tail(DisplayChannelClient *dcc,
>>> Drawable *drawable)
>>> +static void dcc_add_drawable_to_tail(DisplayChannelClient *dcc, Drawable
>>> *drawable)
>>>  {
>>>      DrawablePipeItem *dpi;
>>>
>>> @@ -897,7 +891,7 @@ static inline void red_pipes_add_drawable_after(RedWorker
>>> *worker,
>>>                  }
>>>              }
>>>              if (!sent) {
>>> -                red_pipe_add_drawable(dcc, drawable);
>>> +                dcc_add_drawable(dcc, drawable);
>>>              }
>>>          }
>>>      }
>>> @@ -2703,7 +2697,7 @@ static inline int red_current_add_equal(RedWorker
>>> *worker, DrawItem *item, TreeI
>>>                                          common.base.channel_link);
>>>                  dpi = SPICE_CONTAINEROF(dpi_ring_item, DrawablePipeItem,
>>>                  base);
>>>                  while (worker_ring_item && (!dpi || dcc != dpi->dcc)) {
>>> -                    red_pipe_add_drawable(dcc, drawable);
>>> +                    dcc_add_drawable(dcc, drawable);
>>>                      worker_ring_item =
>>>                      ring_next(&RED_CHANNEL(worker->display_channel)->clients,
>>>                                                   worker_ring_item);
>>>                      dcc = SPICE_CONTAINEROF(worker_ring_item,
>>>                      DisplayChannelClient,
>>> @@ -6057,7 +6051,7 @@ static void
>>> red_add_lossless_drawable_dependencies(RedWorker *worker,
>>>
>>>      if (!sync_rendered) {
>>>          // pushing the pipe item back to the pipe
>>> -        red_pipe_add_drawable_to_tail(dcc, item);
>>> +        dcc_add_drawable_to_tail(dcc, item);
>>>          // the surfaces areas will be sent as DRAW_COPY commands, that
>>>          // will be executed before the current drawable
>>>          for (i = 0; i < num_deps; i++) {
>>
>> The other part can be renamed to
>> "worker: rename red_pipe_add_drawable* to dcc_add_drawable*"

Agreed as well.

>>
>> Frediano
>> _______________________________________________
>> Spice-devel mailing list
>> Spice-devel at lists.freedesktop.org
>> http://lists.freedesktop.org/mailman/listinfo/spice-devel


More information about the Spice-devel mailing list