From patchwork Thu Nov 15 15:15:54 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Erik Skultety X-Patchwork-Id: 998404 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 42wlPG2gsvz9s9G for ; Fri, 16 Nov 2018 02:18:26 +1100 (AEDT) Received: from localhost ([::1]:39428 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gNJPT-00040p-Rw for incoming@patchwork.ozlabs.org; Thu, 15 Nov 2018 10:18:23 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48916) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gNJOf-0003uc-Hh for qemu-devel@nongnu.org; Thu, 15 Nov 2018 10:17:38 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gNJOc-0003Gk-Mt for qemu-devel@nongnu.org; Thu, 15 Nov 2018 10:17:33 -0500 Received: from mx1.redhat.com ([209.132.183.28]:55600) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gNJOa-0003Dp-OX for qemu-devel@nongnu.org; Thu, 15 Nov 2018 10:17:28 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E3B95300295C for ; Thu, 15 Nov 2018 15:17:24 +0000 (UTC) Received: from beluga.usersys.redhat.com (unknown [10.43.2.166]) by smtp.corp.redhat.com (Postfix) with ESMTP id ACFE260BE4; Thu, 15 Nov 2018 15:17:23 +0000 (UTC) From: Erik Skultety To: qemu-devel@nongnu.org Date: Thu, 15 Nov 2018 16:15:54 +0100 Message-Id: <85078eacaa4ba2c83f0ff25387a664dcccb65308.1542294676.git.eskultet@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.43]); Thu, 15 Nov 2018 15:17:24 +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 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: Markus Armbruster , Gerd Hoffmann , Erik Skultety Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 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 rendernode option to QAPI. Signed-off-by: Erik Skultety --- qapi/ui.json | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/qapi/ui.json b/qapi/ui.json index bf9e157d5a..7ecc6eb67e 100644 --- a/qapi/ui.json +++ b/qapi/ui.json @@ -1037,6 +1037,19 @@ 'data' : { '*grab-on-hover' : 'bool', '*zoom-to-fit' : 'bool' } } +## +# @DisplayEGLHeadless: +# +# EGL headless display options. +# +# @rendernode: Which DRM render node should be used. +# +# Since: 3.2 +# +## +{ 'struct' : 'DisplayEGLHeadless', + 'data' : { '*rendernode' : 'str' } } + ## # @DisplayGLMode: # @@ -1086,4 +1099,5 @@ '*window-close' : 'bool', '*gl' : 'DisplayGLMode' }, 'discriminator' : 'type', - 'data' : { 'gtk' : 'DisplayGTK' } } + 'data' : { 'gtk' : 'DisplayGTK', + 'egl-headless' : 'DisplayEGLHeadless'} } From patchwork Thu Nov 15 15:15:55 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Erik Skultety X-Patchwork-Id: 998405 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 42wlPQ4dTDz9s8F for ; Fri, 16 Nov 2018 02:18:34 +1100 (AEDT) Received: from localhost ([::1]:39429 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gNJPc-0004Bb-6a for incoming@patchwork.ozlabs.org; Thu, 15 Nov 2018 10:18:32 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48967) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gNJOr-0004A6-OQ for qemu-devel@nongnu.org; Thu, 15 Nov 2018 10:17:47 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gNJOl-0003Ml-4V for qemu-devel@nongnu.org; Thu, 15 Nov 2018 10:17:42 -0500 Received: from mx1.redhat.com ([209.132.183.28]:44060) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gNJOf-0003ES-J5 for qemu-devel@nongnu.org; Thu, 15 Nov 2018 10:17:35 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 279B23002F84 for ; Thu, 15 Nov 2018 15:17:26 +0000 (UTC) Received: from beluga.usersys.redhat.com (unknown [10.43.2.166]) by smtp.corp.redhat.com (Postfix) with ESMTP id 42B296092E; Thu, 15 Nov 2018 15:17:25 +0000 (UTC) From: Erik Skultety To: qemu-devel@nongnu.org Date: Thu, 15 Nov 2018 16:15:55 +0100 Message-Id: <9f7b6b74de7f2122378f1e140de84845fbaf3280.1542294676.git.eskultet@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.47]); Thu, 15 Nov 2018 15:17:26 +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 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 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 Thu Nov 15 15:15:56 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Erik Skultety X-Patchwork-Id: 998407 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 42wlSN005kz9s9G for ; Fri, 16 Nov 2018 02:21:07 +1100 (AEDT) Received: from localhost ([::1]:39442 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gNJS5-0006LF-Hj for incoming@patchwork.ozlabs.org; Thu, 15 Nov 2018 10:21:05 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48966) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gNJOr-0004A5-ON for qemu-devel@nongnu.org; Thu, 15 Nov 2018 10:17:47 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gNJOk-0003M0-EB for qemu-devel@nongnu.org; Thu, 15 Nov 2018 10:17:42 -0500 Received: from mx1.redhat.com ([209.132.183.28]:40101) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gNJOf-0003Ey-H3 for qemu-devel@nongnu.org; Thu, 15 Nov 2018 10:17:33 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 32C94308AA0F for ; Thu, 15 Nov 2018 15:17:27 +0000 (UTC) Received: from beluga.usersys.redhat.com (unknown [10.43.2.166]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7C70760BF7; Thu, 15 Nov 2018 15:17:26 +0000 (UTC) From: Erik Skultety To: qemu-devel@nongnu.org Date: Thu, 15 Nov 2018 16:15:56 +0100 Message-Id: <2e068d4e0cb5ae06aaa401a89cdcf79df7a5df7d.1542294676.git.eskultet@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.41]); Thu, 15 Nov 2018 15:17:27 +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 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 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