Received: from eggs.gnu.org ([2001:4830:134:3::10]:41899) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bWrkC-00043J-H5 for qemu-devel@nongnu.org; Mon, 08 Aug 2016 17:05:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bWrk9-0005ya-78 for qemu-devel@nongnu.org; Mon, 08 Aug 2016 17:05:55 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:57475) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bWrk8-0005yN-UD for qemu-devel@nongnu.org; Mon, 08 Aug 2016 17:05:53 -0400 Received: from pps.filterd (m0098393.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.11/8.16.0.11) with SMTP id u78L3s9c131657 for ; Mon, 8 Aug 2016 17:05:52 -0400 Received: from e18.ny.us.ibm.com (e18.ny.us.ibm.com [129.33.205.208]) by mx0a-001b2d01.pphosted.com with ESMTP id 24n8sjdyqy-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Mon, 08 Aug 2016 17:05:52 -0400 Received: from localhost by e18.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 8 Aug 2016 17:05:51 -0400 From: Michael Roth Date: Mon, 8 Aug 2016 16:03:33 -0500 In-Reply-To: <1470690267-31454-1-git-send-email-mdroth@linux.vnet.ibm.com> References: <1470690267-31454-1-git-send-email-mdroth@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Message-Id: <1470690267-31454-3-git-send-email-mdroth@linux.vnet.ibm.com> Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PATCH 02/56] spice/gl: add & use qemu_spice_gl_monitor_config List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, Gerd Hoffmann From: Gerd Hoffmann Cc: qemu-stable@nongnu.org Signed-off-by: Gerd Hoffmann Reviewed-by: Marc-Andr=C3=A9 Lureau (cherry picked from commit 39414ef4e93db9041e463a097084a407d0d374f0) Signed-off-by: Michael Roth --- include/ui/spice-display.h | 1 + ui/spice-display.c | 30 ++++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+) diff --git a/include/ui/spice-display.h b/include/ui/spice-display.h index 30ccfe3..568b64a 100644 --- a/include/ui/spice-display.h +++ b/include/ui/spice-display.h @@ -71,6 +71,7 @@ typedef struct QXLCookie { QXLRect area; int redraw; } render; + void *data; } u; } QXLCookie; =20 diff --git a/ui/spice-display.c b/ui/spice-display.c index 242ab5f..2a77a54 100644 --- a/ui/spice-display.c +++ b/ui/spice-display.c @@ -660,6 +660,11 @@ static void interface_async_complete(QXLInstance *si= n, uint64_t cookie_token) qemu_bh_schedule(ssd->gl_unblock_bh); break; } + case QXL_COOKIE_TYPE_IO: + if (cookie->io =3D=3D QXL_IO_MONITORS_CONFIG_ASYNC) { + g_free(cookie->u.data); + } + break; #endif default: /* should never be called, used in qxl native mode only */ @@ -795,6 +800,29 @@ static const DisplayChangeListenerOps display_listen= er_ops =3D { =20 #ifdef HAVE_SPICE_GL =20 +static void qemu_spice_gl_monitor_config(SimpleSpiceDisplay *ssd, + int x, int y, int w, int h) +{ + QXLMonitorsConfig *config; + QXLCookie *cookie; + + config =3D g_malloc0(sizeof(QXLMonitorsConfig) + sizeof(QXLHead)); + config->count =3D 1; + config->max_allowed =3D 1; + config->heads[0].x =3D x; + config->heads[0].y =3D y; + config->heads[0].width =3D w; + config->heads[0].height =3D h; + cookie =3D qxl_cookie_new(QXL_COOKIE_TYPE_IO, + QXL_IO_MONITORS_CONFIG_ASYNC); + cookie->u.data =3D config; + + spice_qxl_monitors_config_async(&ssd->qxl, + (uintptr_t)config, + MEMSLOT_GROUP_HOST, + (uintptr_t)cookie); +} + static void qemu_spice_gl_block(SimpleSpiceDisplay *ssd, bool block) { uint64_t timeout; @@ -858,6 +886,8 @@ static void qemu_spice_gl_scanout(DisplayChangeListen= er *dcl, surface_width(ssd->ds), surface_height(ssd->ds), stride, fourcc, y_0_top); + + qemu_spice_gl_monitor_config(ssd, x, y, w, h); } =20 static void qemu_spice_gl_update(DisplayChangeListener *dcl, --=20 1.9.1