From patchwork Fri Nov 16 10:14:42 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Erik Skultety X-Patchwork-Id: 10685851 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6D31714D6 for ; Fri, 16 Nov 2018 10:20:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5DB342CF33 for ; Fri, 16 Nov 2018 10:20:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4FCE82CF83; Fri, 16 Nov 2018 10:20:42 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 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.wl.linuxfoundation.org (Postfix) with ESMTPS id F25E72CF69 for ; Fri, 16 Nov 2018 10:20:41 +0000 (UTC) Received: from localhost ([::1]:43839 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gNbEv-0005kO-68 for patchwork-qemu-devel@patchwork.kernel.org; Fri, 16 Nov 2018 05:20:41 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48621) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gNbAB-0001bf-SL for qemu-devel@nongnu.org; Fri, 16 Nov 2018 05:15:48 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gNbA7-0006QZ-R2 for qemu-devel@nongnu.org; Fri, 16 Nov 2018 05:15:47 -0500 Received: from mx1.redhat.com ([209.132.183.28]:60416) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gNbA7-0006Py-L1 for qemu-devel@nongnu.org; Fri, 16 Nov 2018 05:15:43 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id EDB9D308FEE5 for ; Fri, 16 Nov 2018 10:15:42 +0000 (UTC) Received: from beluga.usersys.redhat.com (unknown [10.43.2.166]) by smtp.corp.redhat.com (Postfix) with ESMTP id 93FE4600CD; Fri, 16 Nov 2018 10:15:41 +0000 (UTC) From: Erik Skultety To: qemu-devel@nongnu.org Date: Fri, 16 Nov 2018 11:14:42 +0100 Message-Id: <7658e15eca72d520e7a5fb1c2e724702d83d4f7f.1542362949.git.eskultet@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.49]); Fri, 16 Nov 2018 10:15: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 v2 1/3] qapi: Add "rendernode" display option for egl-headless 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 , Markus Armbruster , Erik Skultety Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Unlike SPICE, egl-headless doesn't offer a way of specifying the DRM node used for OpenGL, hence QEMU always selecting the first one that is available. Thus, add the 'rendernode' option for egl-headless to QAPI. Signed-off-by: Erik Skultety --- qapi/ui.json | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/qapi/ui.json b/qapi/ui.json index bf9e157d5a..e0000248d3 100644 --- a/qapi/ui.json +++ b/qapi/ui.json @@ -1037,6 +1037,20 @@ 'data' : { '*grab-on-hover' : 'bool', '*zoom-to-fit' : 'bool' } } +## +# @DisplayEGLHeadless: +# +# EGL headless display options. +# +# @rendernode: Which DRM render node should be used. Default is the first +# available node on the host. +# +# Since: 3.1 +# +## +{ 'struct' : 'DisplayEGLHeadless', + 'data' : { '*rendernode' : 'str' } } + ## # @DisplayGLMode: # @@ -1086,4 +1100,5 @@ '*window-close' : 'bool', '*gl' : 'DisplayGLMode' }, 'discriminator' : 'type', - 'data' : { 'gtk' : 'DisplayGTK' } } + 'data' : { 'gtk' : 'DisplayGTK', + 'egl-headless' : 'DisplayEGLHeadless'} } From patchwork Fri Nov 16 10:14:43 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Erik Skultety X-Patchwork-Id: 10685845 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id BDC4814BD for ; Fri, 16 Nov 2018 10:17:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AD17A2CDA9 for ; Fri, 16 Nov 2018 10:17:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A00552CDAC; Fri, 16 Nov 2018 10:17:28 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 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.wl.linuxfoundation.org (Postfix) with ESMTPS id 4DDBB2CDA9 for ; Fri, 16 Nov 2018 10:17:28 +0000 (UTC) Received: from localhost ([::1]:43819 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gNbBm-0002mp-U2 for patchwork-qemu-devel@patchwork.kernel.org; Fri, 16 Nov 2018 05:17:27 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48620) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gNbAB-0001be-SJ for qemu-devel@nongnu.org; Fri, 16 Nov 2018 05:15:48 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gNbA9-0006RJ-9N for qemu-devel@nongnu.org; Fri, 16 Nov 2018 05:15:47 -0500 Received: from mx1.redhat.com ([209.132.183.28]:60868) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gNbA9-0006R3-48 for qemu-devel@nongnu.org; Fri, 16 Nov 2018 05:15:45 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4B6FF12F8E7 for ; Fri, 16 Nov 2018 10:15:44 +0000 (UTC) Received: from beluga.usersys.redhat.com (unknown [10.43.2.166]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4C53C600C2; Fri, 16 Nov 2018 10:15:43 +0000 (UTC) From: Erik Skultety To: qemu-devel@nongnu.org Date: Fri, 16 Nov 2018 11:14:43 +0100 Message-Id: <27f4617f19aa1072114f10f1aa9dd199735ef982.1542362949.git.eskultet@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Fri, 16 Nov 2018 10:15:44 +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 v2 2/3] ui: Allow specifying 'rendernode' display option for egl-headless 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 , Erik Skultety Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP As libvirt can't predict which rendernode QEMU would pick, it won't adjust the permissions on the device, hence QEMU getting "Permission denied" when opening the DRI device. Therefore, enable 'rendernode' option for egl-headless display type. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1648236 Signed-off-by: Erik Skultety --- ui/egl-headless.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/egl-headless.c b/ui/egl-headless.c index 42a41310b0..4cf3bbc0e4 100644 --- a/ui/egl-headless.c +++ b/ui/egl-headless.c @@ -176,7 +176,7 @@ static void egl_headless_init(DisplayState *ds, DisplayOptions *opts) egl_dpy *edpy; int idx; - if (egl_rendernode_init(NULL, mode) < 0) { + if (egl_rendernode_init(opts->u.egl_headless.rendernode, mode) < 0) { error_report("egl: render node init failed"); exit(1); } From patchwork Fri Nov 16 10:14:44 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Erik Skultety X-Patchwork-Id: 10685849 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7BFAE14BD for ; Fri, 16 Nov 2018 10:20:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6C25F28E17 for ; Fri, 16 Nov 2018 10:20:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 608BF2CE98; Fri, 16 Nov 2018 10:20:14 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 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.wl.linuxfoundation.org (Postfix) with ESMTPS id 67E652CE76 for ; Fri, 16 Nov 2018 10:20:05 +0000 (UTC) Received: from localhost ([::1]:43834 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gNbEK-0005Dr-LF for patchwork-qemu-devel@patchwork.kernel.org; Fri, 16 Nov 2018 05:20:04 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48619) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gNbAB-0001bd-SI for qemu-devel@nongnu.org; Fri, 16 Nov 2018 05:15:48 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gNbAA-0006Ry-86 for qemu-devel@nongnu.org; Fri, 16 Nov 2018 05:15:47 -0500 Received: from mx1.redhat.com ([209.132.183.28]:48914) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gNbAA-0006RX-2h for qemu-devel@nongnu.org; Fri, 16 Nov 2018 05:15:46 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6030C88E44 for ; Fri, 16 Nov 2018 10:15:45 +0000 (UTC) Received: from beluga.usersys.redhat.com (unknown [10.43.2.166]) by smtp.corp.redhat.com (Postfix) with ESMTP id 991FD600C2; Fri, 16 Nov 2018 10:15:44 +0000 (UTC) From: Erik Skultety To: qemu-devel@nongnu.org Date: Fri, 16 Nov 2018 11:14:44 +0100 Message-Id: <87ef678b0934d3abba66c46c9e65b57119d29295.1542362949.git.eskultet@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Fri, 16 Nov 2018 10:15:45 +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 v2 3/3] help: Provide help for egl-headless 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: Erik Skultety Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP EGL headless has been missing from QEMU's help or man page, we should mention that such a thing exists, especially since projects like libvirt might rely on that. This patch also adds the newly introduced option for egl-headless 'rendernode'. Signed-off-by: Erik Skultety --- qemu-options.hx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/qemu-options.hx b/qemu-options.hx index ee379b32e3..f7df472f43 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -1216,7 +1216,8 @@ DEF("display", HAS_ARG, QEMU_OPTION_display, "-display gtk[,grab_on_hover=on|off][,gl=on|off]|\n" "-display vnc=[,]\n" "-display curses\n" - "-display none" + "-display none\n" + "-display egl-headless[,rendernode=]" " select display type\n" "The default display is equivalent to\n" #if defined(CONFIG_GTK) @@ -1258,6 +1259,9 @@ menus and other UI elements to configure and control the VM during runtime. @item vnc Start a VNC server on display +@item egl-headless +Offload all OpenGL operations to a local DRI device. For any graphical display, +this display needs to be paired with either VNC or SPICE displays. @end table ETEXI