Received: from eggs.gnu.org ([140.186.70.92]:41780) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RyPYK-00050X-BC for qemu-devel@nongnu.org; Fri, 17 Feb 2012 10:16:57 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RyPYF-0001gF-Sv for qemu-devel@nongnu.org; Fri, 17 Feb 2012 10:16:52 -0500 Received: from mx1.redhat.com ([209.132.183.28]:53337) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RyPYF-0001g4-Ep for qemu-devel@nongnu.org; Fri, 17 Feb 2012 10:16:47 -0500 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q1HFGkwD010830 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 17 Feb 2012 10:16:46 -0500 Date: Fri, 17 Feb 2012 17:16:39 +0200 From: Alon Levy Message-ID: <20120217151639.GM16163@garlic.redhat.com> References: <1329433888-17678-1-git-send-email-alevy@redhat.com> <1329468300-6507-1-git-send-email-alevy@redhat.com> <4F3E520C.8030907@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4F3E520C.8030907@redhat.com> Subject: Re: [Qemu-devel] [PATCH v2 1/2] qxl: introduce QXLCookie List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gerd Hoffmann Cc: qemu-devel@nongnu.org, elmarco@redhat.com On Fri, Feb 17, 2012 at 02:11:40PM +0100, Gerd Hoffmann wrote: > 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. I can move it to the users if it makes it a little less magic. Note that I will be sending a revized version, since: 1) I forgot about my previous attempt (october 2010, http://lists.gnu.org/archive/html/qemu-devel/2011-10/msg02758.html) 2) there are a few bugs with this approach, that I fixed correctly back then: one is the async monitor command, which I will not send this time since I don't want to get into the same argument. 3) the second is the dirty rectangles, for which I have to raise SPICE_INTERFACE_QXL_MINOR. > > cheers, > Gerd >