From patchwork Tue May 10 05:51:57 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 9054381 Return-Path: X-Original-To: patchwork-qemu-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 5BC89BF29F for ; Tue, 10 May 2016 05:52:26 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id BBC5620114 for ; Tue, 10 May 2016 05:52:25 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id EA9302012B for ; Tue, 10 May 2016 05:52:24 +0000 (UTC) Received: from localhost ([::1]:44587 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b00am-0006Fe-3L for patchwork-qemu-devel@patchwork.kernel.org; Tue, 10 May 2016 01:52:24 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42524) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b00aY-00068a-BR for qemu-devel@nongnu.org; Tue, 10 May 2016 01:52:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b00aS-0001EJ-V1 for qemu-devel@nongnu.org; Tue, 10 May 2016 01:52:10 -0400 Received: from mx1.redhat.com ([209.132.183.28]:56103) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b00aS-0001Df-Of; Tue, 10 May 2016 01:52:04 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 419CE3B70D; Tue, 10 May 2016 05:52:04 +0000 (UTC) Received: from nilsson.home.kraxel.org (ovpn-116-43.ams2.redhat.com [10.36.116.43]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u4A5q28b021988; Tue, 10 May 2016 01:52:03 -0400 Received: by nilsson.home.kraxel.org (Postfix, from userid 500) id E6E4C828F9; Tue, 10 May 2016 07:51:59 +0200 (CEST) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Tue, 10 May 2016 07:51:57 +0200 Message-Id: <1462859517-30207-13-git-send-email-kraxel@redhat.com> In-Reply-To: <1462859517-30207-1-git-send-email-kraxel@redhat.com> References: <1462859517-30207-1-git-send-email-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Tue, 10 May 2016 05:52:04 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 12/12] spice/gl: add & use qemu_spice_gl_monitor_config X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Gerd Hoffmann , qemu-stable@nongnu.org Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Cc: qemu-stable@nongnu.org Signed-off-by: Gerd Hoffmann Reviewed-by: Marc-André Lureau --- 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; 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 *sin, uint64_t cookie_token) qemu_bh_schedule(ssd->gl_unblock_bh); break; } + case QXL_COOKIE_TYPE_IO: + if (cookie->io == 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_listener_ops = { #ifdef HAVE_SPICE_GL +static void qemu_spice_gl_monitor_config(SimpleSpiceDisplay *ssd, + int x, int y, int w, int h) +{ + QXLMonitorsConfig *config; + QXLCookie *cookie; + + config = g_malloc0(sizeof(QXLMonitorsConfig) + sizeof(QXLHead)); + config->count = 1; + config->max_allowed = 1; + config->heads[0].x = x; + config->heads[0].y = y; + config->heads[0].width = w; + config->heads[0].height = h; + cookie = qxl_cookie_new(QXL_COOKIE_TYPE_IO, + QXL_IO_MONITORS_CONFIG_ASYNC); + cookie->u.data = 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(DisplayChangeListener *dcl, surface_width(ssd->ds), surface_height(ssd->ds), stride, fourcc, y_0_top); + + qemu_spice_gl_monitor_config(ssd, x, y, w, h); } static void qemu_spice_gl_update(DisplayChangeListener *dcl,