From nobody Wed Oct 22 13:07:05 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1519899279779485.5665747357742; Thu, 1 Mar 2018 02:14:39 -0800 (PST) Received: from localhost ([::1]:55200 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1erLEU-0004J5-Uo for importer@patchew.org; Thu, 01 Mar 2018 05:14:39 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42617) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1erL62-0005FO-Hu for qemu-devel@nongnu.org; Thu, 01 Mar 2018 05:05:56 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1erL5y-00050J-Ar for qemu-devel@nongnu.org; Thu, 01 Mar 2018 05:05:54 -0500 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:38856 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1erL5y-000500-5S for qemu-devel@nongnu.org; Thu, 01 Mar 2018 05:05:50 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id BCE02402291E for ; Thu, 1 Mar 2018 10:05:49 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-116-147.ams2.redhat.com [10.36.116.147]) by smtp.corp.redhat.com (Postfix) with ESMTP id 822FE2026E04; Thu, 1 Mar 2018 10:05:49 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 3386D17538; Thu, 1 Mar 2018 11:05:48 +0100 (CET) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Thu, 1 Mar 2018 11:05:39 +0100 Message-Id: <20180301100547.18962-6-kraxel@redhat.com> In-Reply-To: <20180301100547.18962-1-kraxel@redhat.com> References: <20180301100547.18962-1-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Thu, 01 Mar 2018 10:05:49 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Thu, 01 Mar 2018 10:05:49 +0000 (UTC) for IP:'10.11.54.4' DOMAIN:'int-mx04.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'kraxel@redhat.com' RCPT:'' X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PATCH v2 05/13] egl-headless: switch over to new display registry 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: Paolo Bonzini , Markus Armbruster , Gerd Hoffmann Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Gerd Hoffmann --- include/ui/console.h | 3 --- ui/egl-headless.c | 20 +++++++++++++++++++- vl.c | 12 ------------ 3 files changed, 19 insertions(+), 16 deletions(-) diff --git a/include/ui/console.h b/include/ui/console.h index 3ea6cf0870..94726cf190 100644 --- a/include/ui/console.h +++ b/include/ui/console.h @@ -456,7 +456,4 @@ int vnc_init_func(void *opaque, QemuOpts *opts, Error *= *errp); /* input.c */ int index_from_key(const char *key, size_t key_length); =20 -/* egl-headless.c */ -void egl_headless_init(DisplayOptions *opts); - #endif diff --git a/ui/egl-headless.c b/ui/egl-headless.c index b33e0b21fd..7c877122d3 100644 --- a/ui/egl-headless.c +++ b/ui/egl-headless.c @@ -164,7 +164,12 @@ static const DisplayChangeListenerOps egl_ops =3D { .dpy_gl_update =3D egl_scanout_flush, }; =20 -void egl_headless_init(DisplayOptions *opts) +static void early_egl_headless_init(DisplayOptions *opts) +{ + display_opengl =3D 1; +} + +static void egl_headless_init(DisplayState *ds, DisplayOptions *opts) { QemuConsole *con; egl_dpy *edpy; @@ -188,3 +193,16 @@ void egl_headless_init(DisplayOptions *opts) register_displaychangelistener(&edpy->dcl); } } + +static QemuDisplay qemu_display_egl =3D { + .type =3D DISPLAY_TYPE_EGL_HEADLESS, + .early_init =3D early_egl_headless_init, + .init =3D egl_headless_init, +}; + +static void register_egl(void) +{ + qemu_display_register(&qemu_display_egl); +} + +type_init(register_egl); diff --git a/vl.c b/vl.c index 2b4af34fbb..47c953f8dc 100644 --- a/vl.c +++ b/vl.c @@ -2153,13 +2153,7 @@ static void parse_display(const char *p) exit(1); } } else if (strstart(p, "egl-headless", &opts)) { -#ifdef CONFIG_OPENGL_DMABUF - display_opengl =3D 1; dpy.type =3D DISPLAY_TYPE_EGL_HEADLESS; -#else - error_report("egl support is disabled"); - exit(1); -#endif } else if (strstart(p, "curses", &opts)) { dpy.type =3D DISPLAY_TYPE_CURSES; } else if (strstart(p, "gtk", &opts)) { @@ -4659,12 +4653,6 @@ int main(int argc, char **argv, char **envp) qemu_spice_display_init(); } =20 -#ifdef CONFIG_OPENGL_DMABUF - if (dpy.type =3D=3D DISPLAY_TYPE_EGL_HEADLESS) { - egl_headless_init(&dpy); - } -#endif - if (foreach_device_config(DEV_GDB, gdbserver_start) < 0) { exit(1); } --=20 2.9.3