From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:39149) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RyNbL-0007K5-ML for qemu-devel@nongnu.org; Fri, 17 Feb 2012 08:11:57 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RyNbG-0001ba-Hx for qemu-devel@nongnu.org; Fri, 17 Feb 2012 08:11:51 -0500 Received: from mx1.redhat.com ([209.132.183.28]:9085) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RyNbG-0001bP-B0 for qemu-devel@nongnu.org; Fri, 17 Feb 2012 08:11:46 -0500 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q1HDBiPL012411 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 17 Feb 2012 08:11:44 -0500 Message-ID: <4F3E520C.8030907@redhat.com> Date: Fri, 17 Feb 2012 14:11:40 +0100 From: Gerd Hoffmann MIME-Version: 1.0 References: <1329433888-17678-1-git-send-email-alevy@redhat.com> <1329468300-6507-1-git-send-email-alevy@redhat.com> In-Reply-To: <1329468300-6507-1-git-send-email-alevy@redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v2 1/2] qxl: introduce QXLCookie List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alon Levy Cc: qemu-devel@nongnu.org, elmarco@redhat.com On 02/17/12 09:44, Alon Levy wrote: > Will be used in the next patch. > > Signed-off-by: Alon Levy > --- > 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