From patchwork Fri Jul 15 13:49:25 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frediano Ziglio X-Patchwork-Id: 648822 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3rrYvH46Hyz9s9N for ; Fri, 15 Jul 2016 23:53:47 +1000 (AEST) Received: from localhost ([::1]:60899 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bO3Ym-00049j-8E for incoming@patchwork.ozlabs.org; Fri, 15 Jul 2016 09:53:44 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35365) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bO3Uw-0007JM-F5 for qemu-devel@nongnu.org; Fri, 15 Jul 2016 09:49:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bO3Ut-0005xb-Bt for qemu-devel@nongnu.org; Fri, 15 Jul 2016 09:49:46 -0400 Received: from mx1.redhat.com ([209.132.183.28]:46659) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bO3Ut-0005xR-6M for qemu-devel@nongnu.org; Fri, 15 Jul 2016 09:49:43 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) (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 45E443DC42; Fri, 15 Jul 2016 13:49:42 +0000 (UTC) Received: from rhwork.redhat.com (vpn-55-177.rdu2.redhat.com [10.10.55.177]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u6FDndCT028176; Fri, 15 Jul 2016 09:49:41 -0400 From: Frediano Ziglio To: spice-devel@lists.freedesktop.org, Qemu-devel Date: Fri, 15 Jul 2016 14:49:25 +0100 Message-Id: <1468590577-30914-2-git-send-email-fziglio@redhat.com> In-Reply-To: <1468590577-30914-1-git-send-email-fziglio@redhat.com> References: <1468590577-30914-1-git-send-email-fziglio@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Fri, 15 Jul 2016 13:49:42 +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] [PATCH Qemu] Change spice-server protocol for GL texture passing 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: Frediano Ziglio Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" --- ui/spice-core.c | 5 ----- ui/spice-display.c | 29 ++++++++--------------------- 2 files changed, 8 insertions(+), 26 deletions(-) diff --git a/ui/spice-core.c b/ui/spice-core.c index da05054..f7647f7 100644 --- a/ui/spice-core.c +++ b/ui/spice-core.c @@ -828,11 +828,6 @@ void qemu_spice_init(void) #ifdef HAVE_SPICE_GL if (qemu_opt_get_bool(opts, "gl", 0)) { - if ((port != 0) || (tls_port != 0)) { - error_report("SPICE GL support is local-only for now and " - "incompatible with -spice port/tls-port"); - exit(1); - } if (egl_rendernode_init() != 0) { error_report("Failed to initialize EGL render node for SPICE GL"); exit(1); diff --git a/ui/spice-display.c b/ui/spice-display.c index 2a77a54..72137bd 100644 --- a/ui/spice-display.c +++ b/ui/spice-display.c @@ -852,6 +852,10 @@ static void qemu_spice_gl_block_timer(void *opaque) static QEMUGLContext qemu_spice_gl_create_context(DisplayChangeListener *dcl, QEMUGLParams *params) { + SimpleSpiceDisplay *ssd = container_of(dcl, SimpleSpiceDisplay, dcl); + + spice_qxl_gl_init(&ssd->qxl, qemu_egl_display, qemu_egl_rn_ctx); + eglMakeCurrent(qemu_egl_display, EGL_NO_SURFACE, EGL_NO_SURFACE, qemu_egl_rn_ctx); return qemu_egl_create_context(dcl, params); @@ -864,28 +868,11 @@ static void qemu_spice_gl_scanout(DisplayChangeListener *dcl, uint32_t w, uint32_t h) { SimpleSpiceDisplay *ssd = container_of(dcl, SimpleSpiceDisplay, dcl); - EGLint stride = 0, fourcc = 0; - int fd = -1; - - if (tex_id) { - fd = egl_get_fd_for_texture(tex_id, &stride, &fourcc); - if (fd < 0) { - fprintf(stderr, "%s: failed to get fd for texture\n", __func__); - return; - } - dprint(1, "%s: %dx%d (stride %d, fourcc 0x%x)\n", __func__, - w, h, stride, fourcc); - } else { - dprint(1, "%s: no texture (no framebuffer)\n", __func__); - } - - assert(!tex_id || fd >= 0); - /* note: spice server will close the fd */ - spice_qxl_gl_scanout(&ssd->qxl, fd, - surface_width(ssd->ds), - surface_height(ssd->ds), - stride, fourcc, y_0_top); + spice_qxl_gl_scanout_texture(&ssd->qxl, tex_id, + surface_width(ssd->ds), + surface_height(ssd->ds), + y_0_top); qemu_spice_gl_monitor_config(ssd, x, y, w, h); }