From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:48593) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RzEJ0-0004by-2o for qemu-devel@nongnu.org; Sun, 19 Feb 2012 16:28:26 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RzEIy-0004Ui-Gr for qemu-devel@nongnu.org; Sun, 19 Feb 2012 16:28:25 -0500 Received: from mx1.redhat.com ([209.132.183.28]:41294) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RzEIy-0004Ua-9z for qemu-devel@nongnu.org; Sun, 19 Feb 2012 16:28:24 -0500 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q1JLSNSk000530 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Sun, 19 Feb 2012 16:28:23 -0500 From: Alon Levy Date: Sun, 19 Feb 2012 23:28:05 +0200 Message-Id: <1329686886-6853-7-git-send-email-alevy@redhat.com> In-Reply-To: <1329686886-6853-1-git-send-email-alevy@redhat.com> References: <1329686886-6853-1-git-send-email-alevy@redhat.com> Subject: [Qemu-devel] [RFC 6/7] qxl: use spice_qxl_update_area_dirty_async List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org, kraxel@redhat.com, elmarco@redhat.com --- hw/qxl.c | 17 ++++++++--------- 1 files changed, 8 insertions(+), 9 deletions(-) diff --git a/hw/qxl.c b/hw/qxl.c index 2409cb3..6e25bd1 100644 --- a/hw/qxl.c +++ b/hw/qxl.c @@ -150,17 +150,16 @@ void qxl_spice_update_area(PCIQXLDevice *qxl, uint32_t surface_id, dirty_rects, num_dirty_rects, clear_dirty_region); } else { #if SPICE_INTERFACE_QXL_MINOR >= 1 - struct QXLRect *area_copy; - if (cookie == NULL) { - area_copy = g_malloc0(sizeof(*area_copy)); - memcpy(area_copy, area, sizeof(*area)); - area = area_copy; - cookie = qxl_cookie_new(QXL_COOKIE_TYPE_IO, - QXL_IO_UPDATE_AREA_ASYNC, - (uint64_t)area_copy); - } + assert(cookie != NULL); +#if SPICE_SERVER_VERSION >= 0x000a02 + /* use dirty rectangles updating api introduced in 0.10.2 */ + spice_qxl_update_area_dirty_async(&qxl->ssd.qxl, surface_id, area, + dirty_rects, num_dirty_rects, clear_dirty_region, + (uint64_t)cookie); +#else spice_qxl_update_area_async(&qxl->ssd.qxl, surface_id, area, clear_dirty_region, (uint64_t)cookie); +#endif #else abort(); #endif -- 1.7.9