From patchwork Thu Feb 18 09:26:50 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 8348001 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 CC58A9FC6A for ; Thu, 18 Feb 2016 09:27:20 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 43B7E20398 for ; Thu, 18 Feb 2016 09:27:20 +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 98B6D202AE for ; Thu, 18 Feb 2016 09:27:19 +0000 (UTC) Received: from localhost ([::1]:38904 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aWKrm-00051D-Vg for patchwork-qemu-devel@patchwork.kernel.org; Thu, 18 Feb 2016 04:27:19 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41582) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aWKrV-0004us-51 for qemu-devel@nongnu.org; Thu, 18 Feb 2016 04:27:02 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aWKrP-0000PD-Vp for qemu-devel@nongnu.org; Thu, 18 Feb 2016 04:27:01 -0500 Received: from mx1.redhat.com ([209.132.183.28]:55542) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aWKrP-0000Oz-Pt for qemu-devel@nongnu.org; Thu, 18 Feb 2016 04:26:55 -0500 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (Postfix) with ESMTPS id 714137AE88; Thu, 18 Feb 2016 09:26:55 +0000 (UTC) Received: from nilsson.home.kraxel.org (ovpn-116-20.ams2.redhat.com [10.36.116.20]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u1I9QsQt006265; Thu, 18 Feb 2016 04:26:54 -0500 Received: by nilsson.home.kraxel.org (Postfix, from userid 500) id 38BAC80C5A; Thu, 18 Feb 2016 10:26:53 +0100 (CET) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Thu, 18 Feb 2016 10:26:50 +0100 Message-Id: <1455787610-31787-9-git-send-email-kraxel@redhat.com> In-Reply-To: <1455787610-31787-1-git-send-email-kraxel@redhat.com> References: <1455787610-31787-1-git-send-email-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: spice-devel@lists.freedesktop.org, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Gerd Hoffmann Subject: [Qemu-devel] [PATCH 8/8] spice/gl: create dummy primary surface (RfC) X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org 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 Current spice client expects we create a primary surface, even if we do display updates using dma-bufs exclusively. So just do that to get things going. Not fully clear whenever that is intentional or a bug on the spice side, so I keep this as separate patch for now. I think this should either be squashed into the previous patch, or dropped after fixing things on the spice side. Signed-off-by: Gerd Hoffmann --- ui/spice-display.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/ui/spice-display.c b/ui/spice-display.c index b222984..54702bb 100644 --- a/ui/spice-display.c +++ b/ui/spice-display.c @@ -856,13 +856,27 @@ static void spice_gl_switch(DisplayChangeListener *dcl, { SimpleSpiceDisplay *ssd = container_of(dcl, SimpleSpiceDisplay, dcl); EGLint stride, fourcc; + bool resize = true; int fd; + if (ssd->ds && new_surface && + surface_width(ssd->ds) == surface_width(new_surface) && + surface_height(ssd->ds) == surface_height(new_surface) && + surface_format(ssd->ds) == surface_format(new_surface)) { + resize = false; + } + if (ssd->ds) { surface_gl_destroy_texture(ssd->gls, ssd->ds); + if (resize) { + qemu_spice_destroy_host_primary(ssd); + } } ssd->ds = new_surface; if (ssd->ds) { + if (resize) { + qemu_spice_create_host_primary(ssd); + } surface_gl_create_texture(ssd->gls, ssd->ds); fd = egl_get_fd_for_texture(ssd->ds->texture, &stride, &fourcc);