From patchwork Fri Nov 17 10:30:30 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 10062577 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 68A3A60352 for ; Fri, 17 Nov 2017 10:32:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 652222A4F4 for ; Fri, 17 Nov 2017 10:32:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 586132A7A0; Fri, 17 Nov 2017 10:32:29 +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=-6.9 required=2.0 tests=BAYES_00,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 F1AB72A4F4 for ; Fri, 17 Nov 2017 10:32:28 +0000 (UTC) Received: from localhost ([::1]:44973 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eFdwi-0000oF-3O for patchwork-qemu-devel@patchwork.kernel.org; Fri, 17 Nov 2017 05:32:28 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49711) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eFdvB-0000lq-Jp for qemu-devel@nongnu.org; Fri, 17 Nov 2017 05:30:55 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eFdvA-0007KO-Ch for qemu-devel@nongnu.org; Fri, 17 Nov 2017 05:30:53 -0500 Received: from mx1.redhat.com ([209.132.183.28]:51880) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eFdvA-0007Jf-6E for qemu-devel@nongnu.org; Fri, 17 Nov 2017 05:30:52 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 54057C01F291 for ; Fri, 17 Nov 2017 10:30:51 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-116-103.ams2.redhat.com [10.36.116.103]) by smtp.corp.redhat.com (Postfix) with ESMTP id E55948B11F; Fri, 17 Nov 2017 10:30:50 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 9F112409CE; Fri, 17 Nov 2017 11:30:46 +0100 (CET) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Fri, 17 Nov 2017 11:30:30 +0100 Message-Id: <20171117103046.15943-9-kraxel@redhat.com> In-Reply-To: <20171117103046.15943-1-kraxel@redhat.com> References: <20171117103046.15943-1-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Fri, 17 Nov 2017 10:30:51 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 08/24] egl-headless: use DisplayOptions 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+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Switch egl-headless ui to use qapi DisplayOptions for configuration. Signed-off-by: Gerd Hoffmann --- include/ui/console.h | 2 +- ui/egl-headless.c | 2 +- vl.c | 3 ++- qapi/ui.json | 5 +++-- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/include/ui/console.h b/include/ui/console.h index deee5bb606..4cb623112e 100644 --- a/include/ui/console.h +++ b/include/ui/console.h @@ -530,6 +530,6 @@ static inline void early_gtk_display_init(DisplayOptions *opts) #endif /* egl-headless.c */ -void egl_headless_init(void); +void egl_headless_init(DisplayOptions *opts); #endif diff --git a/ui/egl-headless.c b/ui/egl-headless.c index 5d50226869..38b3766548 100644 --- a/ui/egl-headless.c +++ b/ui/egl-headless.c @@ -154,7 +154,7 @@ static const DisplayChangeListenerOps egl_ops = { .dpy_gl_update = egl_scanout_flush, }; -void egl_headless_init(void) +void egl_headless_init(DisplayOptions *opts) { QemuConsole *con; egl_dpy *edpy; diff --git a/vl.c b/vl.c index d461800f13..b5cf02bb46 100644 --- a/vl.c +++ b/vl.c @@ -2214,6 +2214,7 @@ static LegacyDisplayType select_display(const char *p) request_opengl = 1; display_opengl = 1; display = DT_EGL; + dpy.type = DISPLAY_TYPE_EGL_HEADLESS; #else fprintf(stderr, "egl support is disabled\n"); exit(1); @@ -4845,7 +4846,7 @@ int main(int argc, char **argv, char **envp) #ifdef CONFIG_OPENGL_DMABUF if (display_type == DT_EGL) { - egl_headless_init(); + egl_headless_init(&dpy); } #endif diff --git a/qapi/ui.json b/qapi/ui.json index e7d3e8729b..372205c98f 100644 --- a/qapi/ui.json +++ b/qapi/ui.json @@ -1009,7 +1009,7 @@ # ## { 'enum' : 'DisplayType', - 'data' : [ 'default', 'none', 'gtk', 'sdl' ] } + 'data' : [ 'default', 'none', 'gtk', 'sdl', 'egl-headless' ] } ## # @DisplayOptions: @@ -1026,4 +1026,5 @@ 'data' : { 'default' : 'DisplayNoOpts', 'none' : 'DisplayNoOpts', 'gtk' : 'DisplayGTK', - 'sdl' : 'DisplayNoOpts' } } + 'sdl' : 'DisplayNoOpts', + 'egl-headless' : 'DisplayNoOpts' } }