From patchwork Fri May 13 12:32:52 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 9091311 Return-Path: X-Original-To: patchwork-qemu-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 2E1209F441 for ; Fri, 13 May 2016 12:41:30 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7EF632024C for ; Fri, 13 May 2016 12:41:29 +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 7C4B22022D for ; Fri, 13 May 2016 12:41:28 +0000 (UTC) Received: from localhost ([::1]:34393 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b1CPH-0003MH-Ma for patchwork-qemu-devel@patchwork.kernel.org; Fri, 13 May 2016 08:41:27 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40028) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b1CHG-0005BI-BD for qemu-devel@nongnu.org; Fri, 13 May 2016 08:33:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b1CH9-0006kK-1q for qemu-devel@nongnu.org; Fri, 13 May 2016 08:33:09 -0400 Received: from mx1.redhat.com ([209.132.183.28]:57321) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b1CH8-0006jN-SZ; Fri, 13 May 2016 08:33:02 -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 6E7A737EEB; Fri, 13 May 2016 12:33:02 +0000 (UTC) Received: from nilsson.home.kraxel.org (ovpn-116-35.ams2.redhat.com [10.36.116.35]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u4DCX1op011760; Fri, 13 May 2016 08:33:01 -0400 Received: by nilsson.home.kraxel.org (Postfix, from userid 500) id 1435D81998; Fri, 13 May 2016 14:33:00 +0200 (CEST) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Fri, 13 May 2016 14:32:52 +0200 Message-Id: <1463142777-13040-13-git-send-email-kraxel@redhat.com> In-Reply-To: <1463142777-13040-1-git-send-email-kraxel@redhat.com> References: <1463142777-13040-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.29]); Fri, 13 May 2016 12:33:02 +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 v2 12/17] 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=-4.9 required=5.0 tests=BAYES_00,FSL_HELO_HOME, RCVD_IN_DNSWL_HI,UNPARSEABLE_RELAY autolearn=ham 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,