From nobody Thu Jul 17 12:54:22 2025 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1678190334; cv=none; d=zohomail.com; s=zohoarc; b=mp8f5s7mb4/8UScx8ZUN0X1R78lhXMjsJzwaKxg+5FkmkeCtmZnTuw1ehBiFdQ1e09n/9JY+9PlE5TOqHlzlDxhHTTgd9O8HoXQYhRX37Fefef1iP1XtWIoMAdBfSUJBAjsbknMSuw4ZZztQw+jg00Dm+ObtHrK3cWdhAjjVAA0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1678190334; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=9+vkE9LuKiXw6hgpIr6rng/DVtJGgtEFf712e+28JsU=; b=lJtTwWmCORtGUQOtInf9fgUdHNI7OGJiQm04xVrKAA5jDhW4hsxUQlaB4vSG0deSif9Vy/bygG3Z2lwoSPsLitdS354qID7fZwHO208fr/XySbreKPSmDRRCoYL1uDrOd4Wiaf55PEA6QM7r98Z66VlTabxiAM2OToAGoCc2wag= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1678190334875174.8161424643389; Tue, 7 Mar 2023 03:58:54 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pZVxL-0005io-6h; Tue, 07 Mar 2023 06:58:11 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pZVxH-0005c6-AP for qemu-devel@nongnu.org; Tue, 07 Mar 2023 06:58:07 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pZVxF-0003Bf-Q1 for qemu-devel@nongnu.org; Tue, 07 Mar 2023 06:58:07 -0500 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-59-37LBqeo3OHWoOEUNVTbJIA-1; Tue, 07 Mar 2023 06:58:03 -0500 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 41FAE800B23; Tue, 7 Mar 2023 11:58:03 +0000 (UTC) Received: from localhost (unknown [10.39.208.40]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1D02C492C14; Tue, 7 Mar 2023 11:58:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1678190285; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=9+vkE9LuKiXw6hgpIr6rng/DVtJGgtEFf712e+28JsU=; b=D4MxFZbtvaBsRw3yyeL579N9onGhqnJyKCk4YlBYxis4WvpAVyjk4TPppSdK3tiNUtBzCR l4llC/caJ7m/gDLfPQkkv4yqAyd3YSCWcdpAdVvK87PVWZ0OW5XvNtI+cqDfjJ4XAem/6l kUrM7ikQ9D308N/aAXH8cagfAEynjyc= X-MC-Unique: 37LBqeo3OHWoOEUNVTbJIA-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Paolo Bonzini , Thomas Huth , Gerd Hoffmann , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Laurent Vivier Subject: [PATCH v2 18/18] ui/dbus: restrict opengl to gbm-enabled config Date: Tue, 7 Mar 2023 15:56:37 +0400 Message-Id: <20230307115637.2464377-19-marcandre.lureau@redhat.com> In-Reply-To: <20230307115637.2464377-1-marcandre.lureau@redhat.com> References: <20230307115637.2464377-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1678190336689100003 From: Marc-Andr=C3=A9 Lureau We can enable EGL later for non-GBM hosts. Signed-off-by: Marc-Andr=C3=A9 Lureau --- ui/dbus-listener.c | 10 +++++----- ui/dbus.c | 12 +++++++++++- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/ui/dbus-listener.c b/ui/dbus-listener.c index 85692f1b27..911acdc529 100644 --- a/ui/dbus-listener.c +++ b/ui/dbus-listener.c @@ -50,7 +50,7 @@ struct _DBusDisplayListener { =20 G_DEFINE_TYPE(DBusDisplayListener, dbus_display_listener, G_TYPE_OBJECT) =20 -#ifdef CONFIG_OPENGL +#ifdef CONFIG_GBM static void dbus_update_gl_cb(GObject *source_object, GAsyncResult *res, gpointer user_data) @@ -239,7 +239,7 @@ static void dbus_refresh(DisplayChangeListener *dcl) graphic_hw_update(dcl->con); } =20 -#ifdef CONFIG_OPENGL +#ifdef CONFIG_GBM static void dbus_gl_gfx_update(DisplayChangeListener *dcl, int x, int y, int w, int h) { @@ -302,7 +302,7 @@ static void dbus_gfx_update(DisplayChangeListener *dcl, DBUS_DEFAULT_TIMEOUT, NULL, NULL, NULL); } =20 -#ifdef CONFIG_OPENGL +#ifdef CONFIG_GBM static void dbus_gl_gfx_switch(DisplayChangeListener *dcl, struct DisplaySurface *new_surface) { @@ -369,7 +369,7 @@ static void dbus_cursor_define(DisplayChangeListener *d= cl, NULL); } =20 -#ifdef CONFIG_OPENGL +#ifdef CONFIG_GBM const DisplayChangeListenerOps dbus_gl_dcl_ops =3D { .dpy_name =3D "dbus-gl", .dpy_gfx_update =3D dbus_gl_gfx_update, @@ -417,7 +417,7 @@ dbus_display_listener_constructed(GObject *object) DBusDisplayListener *ddl =3D DBUS_DISPLAY_LISTENER(object); =20 ddl->dcl.ops =3D &dbus_dcl_ops; -#ifdef CONFIG_OPENGL +#ifdef CONFIG_GBM if (display_opengl) { ddl->dcl.ops =3D &dbus_gl_dcl_ops; } diff --git a/ui/dbus.c b/ui/dbus.c index 904f5a0a6d..0513de9918 100644 --- a/ui/dbus.c +++ b/ui/dbus.c @@ -47,8 +47,10 @@ static DBusDisplay *dbus_display; static QEMUGLContext dbus_create_context(DisplayGLCtx *dgc, QEMUGLParams *params) { +#ifdef CONFIG_GBM eglMakeCurrent(qemu_egl_display, EGL_NO_SURFACE, EGL_NO_SURFACE, qemu_egl_rn_ctx); +#endif return qemu_egl_create_context(dgc, params); } =20 @@ -56,7 +58,11 @@ static bool dbus_is_compatible_dcl(DisplayGLCtx *dgc, DisplayChangeListener *dcl) { - return dcl->ops =3D=3D &dbus_gl_dcl_ops || dcl->ops =3D=3D &dbus_conso= le_dcl_ops; + return +#ifdef CONFIG_GBM + dcl->ops =3D=3D &dbus_gl_dcl_ops || +#endif + dcl->ops =3D=3D &dbus_console_dcl_ops; } =20 static void @@ -459,7 +465,11 @@ early_dbus_init(DisplayOptions *opts) DisplayGLMode mode =3D opts->has_gl ? opts->gl : DISPLAYGL_MODE_OFF; =20 if (mode !=3D DISPLAYGL_MODE_OFF) { +#ifdef CONFIG_OPENGL egl_init(opts->u.dbus.rendernode, mode, &error_fatal); +#else + error_report("dbus: GL rendering is not supported"); +#endif } =20 type_register(&dbus_vc_type_info); --=20 2.39.2