qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v2 1/2] qxl: introduce QXLCookie


From: Gerd Hoffmann
Subject: Re: [Qemu-devel] [PATCH v2 1/2] qxl: introduce QXLCookie
Date: Fri, 17 Feb 2012 14:11:40 +0100
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.26) Gecko/20120130 Red Hat/3.1.18-1.el6_2 Thunderbird/3.1.18

On 02/17/12 09:44, Alon Levy wrote:
> Will be used in the next patch.
> 
> Signed-off-by: Alon Levy <address@hidden>
> ---
>  hw/qxl-render.c    |    2 +-
>  hw/qxl.c           |   60 +++++++++++++++++++++++++++++++++++++--------------
>  hw/qxl.h           |    2 +-
>  ui/spice-display.c |   26 ++++++++++++++++++++--
>  ui/spice-display.h |   12 ++++++++++
>  5 files changed, 80 insertions(+), 22 deletions(-)
> 
> diff --git a/hw/qxl-render.c b/hw/qxl-render.c
> index 133d093..b238b96 100644
> --- a/hw/qxl-render.c
> +++ b/hw/qxl-render.c
> @@ -133,7 +133,7 @@ void qxl_render_update(PCIQXLDevice *qxl)
>  
>      memset(dirty, 0, sizeof(dirty));
>      qxl_spice_update_area(qxl, 0, &update,
> -                          dirty, ARRAY_SIZE(dirty), 1, QXL_SYNC);
> +                          dirty, ARRAY_SIZE(dirty), 1, QXL_SYNC, NULL);
>      if (redraw) {
>          memset(dirty, 0, sizeof(dirty));
>          dirty[0] = update;
> diff --git a/hw/qxl.c b/hw/qxl.c
> index ac69125..02708e3 100644
> --- a/hw/qxl.c
> +++ b/hw/qxl.c
> @@ -143,15 +143,20 @@ void qxl_spice_update_area(PCIQXLDevice *qxl, uint32_t 
> surface_id,
>                             struct QXLRect *area, struct QXLRect *dirty_rects,
>                             uint32_t num_dirty_rects,
>                             uint32_t clear_dirty_region,
> -                           qxl_async_io async)
> +                           qxl_async_io async, QXLCookie *cookie)
>  {
>      if (async == QXL_SYNC) {
>          qxl->ssd.worker->update_area(qxl->ssd.worker, surface_id, area,
>                          dirty_rects, num_dirty_rects, clear_dirty_region);
>      } else {
>  #if SPICE_INTERFACE_QXL_MINOR >= 1
> +        if (cookie == NULL) {
> +            cookie = qxl_cookie_new(QXL_COOKIE_TYPE_IO,
> +                                    QXL_IO_UPDATE_AREA_ASYNC,
> +                                    0);
> +        }

Hmm, why that?  If the callers want a cookie, then they should
explicitly pass in what they want instead of expecting the function to
magically do the correct thing.  If the callers don't need a cookie,
then use something like QXL_COOKIE_TYPE_UNUSED or simply pass on the
NULL pointer.

cheers,
  Gerd




reply via email to

[Prev in Thread] Current Thread [Next in Thread]