From nobody Mon May 6 03:55:54 2024 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=1678190231; cv=none; d=zohomail.com; s=zohoarc; b=Dg228PKXQ4EeeItJn5FTMo6IYI0mKGG10Kn+XvdkksyB36Pgm1hUzBM0TftVP1YkKbWRdSj7cO1nqC5Nrw1zjYuXTUo0Zy+OPWZ48ipAWN1ds0R5lAa9HbzrAH9nDPAa2KS9s/LIBTwYRIZELyxPQZPnBrfk5sfPOOs2IrNM+O8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1678190231; 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=c2fLdOmep99GEm1wz4LkhSlmDvHe0KWFE0Af7ma7taQ=; b=FntZww7oKXLShF6/yuliene8cT7m3NWj2CY4M29pyFRY7T/HOyTibirxzigjJvQKeTKwkw0NWtRdkmMYKlqhOc63XXEQW6wZUqg0GXsPMHYlNg53I21/7krdiA9KX+QVKdOaMilNMKsH5jnboFEd2hY+QxhyNJ7pVV7r8daSPPQ= 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 1678190231393601.5638378305588; Tue, 7 Mar 2023 03:57:11 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pZVw2-00024Y-79; Tue, 07 Mar 2023 06:56:50 -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 1pZVw1-00024Q-Bt for qemu-devel@nongnu.org; Tue, 07 Mar 2023 06:56:49 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pZVw0-0002yI-0R for qemu-devel@nongnu.org; Tue, 07 Mar 2023 06:56:49 -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-466-hcpsREGuNzu7AzfR8Yc_Eg-1; Tue, 07 Mar 2023 06:56:45 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id D839D85A5A3; Tue, 7 Mar 2023 11:56:44 +0000 (UTC) Received: from localhost (unknown [10.39.208.40]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0E27840C10FA; Tue, 7 Mar 2023 11:56:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1678190207; 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=c2fLdOmep99GEm1wz4LkhSlmDvHe0KWFE0Af7ma7taQ=; b=dnhmmKFXLyX7HIW1xb4DGsTBbrx8pCr3sjYk06w71SX2NK4UUwI0H6D10FOdWwbOYAURjW dlMvtR98Ny60kbBJQ++6zBWN22eLB/zu00nH49lmVKqUmrikhnmdkLufUidjOhlfrt93Cy e57V0bc9OInPUQVSwMPhcuBBfIm58gw= X-MC-Unique: hcpsREGuNzu7AzfR8Yc_Eg-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 01/18] ui/dbus: initialize cursor_fb Date: Tue, 7 Mar 2023 15:56:20 +0400 Message-Id: <20230307115637.2464377-2-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.2 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.133.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: 1678190232072100007 From: Marc-Andr=C3=A9 Lureau Or else, we may randomly destroy some textures.. Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- include/ui/egl-helpers.h | 2 ++ ui/dbus-listener.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/include/ui/egl-helpers.h b/include/ui/egl-helpers.h index 2fb6e0dd6b..c92dd90e33 100644 --- a/include/ui/egl-helpers.h +++ b/include/ui/egl-helpers.h @@ -22,6 +22,8 @@ typedef struct egl_fb { QemuDmaBuf *dmabuf; } egl_fb; =20 +#define EGL_FB_INIT { 0, } + void egl_fb_destroy(egl_fb *fb); void egl_fb_setup_default(egl_fb *fb, int width, int height); void egl_fb_setup_for_tex(egl_fb *fb, int width, int height, diff --git a/ui/dbus-listener.c b/ui/dbus-listener.c index 57d4e401db..2dafd6569c 100644 --- a/ui/dbus-listener.c +++ b/ui/dbus-listener.c @@ -149,7 +149,7 @@ static void dbus_cursor_dmabuf(DisplayChangeListener *d= cl, DBusDisplayListener *ddl =3D container_of(dcl, DBusDisplayListener, dc= l); DisplaySurface *ds; GVariant *v_data =3D NULL; - egl_fb cursor_fb; + egl_fb cursor_fb =3D EGL_FB_INIT; =20 if (!dmabuf) { qemu_dbus_display1_listener_call_mouse_set( --=20 2.39.2 From nobody Mon May 6 03:55:54 2024 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=1678190231; cv=none; d=zohomail.com; s=zohoarc; b=jdQxM61jzTKBQSgaGnkvXJ9sQ5G4s8w42hvVRc7+Y+11jS7q7LG7E/QBdQfkkmC5tATmjZakh4YU2LxXDArWBvH6PVvwuv9l9YeGZvibMlEMhrk/QXP8XqD1u1uCUT+xElFn5uIAXdEQgR+fTFKEKRHJuzr8l+CG8o2sdAvTULg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1678190231; 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=BaYen6RYaTNohPc0fI84Zfuuo4J8hmoOE0n9kDBqRXY=; b=TTvi7etb8Nn6STaG/OM1EhQ3vpQSNzJy5Jt2mfCs/PqybgoKyNrWUeOV3xJAMdxG/5llJh3sV0EtiTnglTrbZjHg459el1wswzJ8nC1ZWPKfsj1aii7fWRsOLb4mjs0IEpX8hziY+HPDdNIgoqM+uoDYzpTiEbDQY3bgs2HDvt8= 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 1678190231135965.1761930014779; Tue, 7 Mar 2023 03:57:11 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pZVw5-000253-Uc; Tue, 07 Mar 2023 06:56:53 -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 1pZVw4-00024o-O1 for qemu-devel@nongnu.org; Tue, 07 Mar 2023 06:56:52 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pZVw3-0002zL-DN for qemu-devel@nongnu.org; Tue, 07 Mar 2023 06:56:52 -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-216-zjYfRxeVPpiCpNoap5uW8w-1; Tue, 07 Mar 2023 06:56:49 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 5DDE8185A794; Tue, 7 Mar 2023 11:56:49 +0000 (UTC) Received: from localhost (unknown [10.39.208.40]) by smtp.corp.redhat.com (Postfix) with ESMTP id 530B8112132D; Tue, 7 Mar 2023 11:56:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1678190210; 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=BaYen6RYaTNohPc0fI84Zfuuo4J8hmoOE0n9kDBqRXY=; b=MGqaAS6279XTYEMDB8TozsC79FpZcBUrwf6yjwI6UJUvdtY42opjXyuujbL34ZvC4ynsvM xUjYXRMh+L9ZiOza9S/G72sDLxCko4RRxbekQ6Bg1M9ackraajI6ewwSwY0DBfTdDzyR4y ARf3RGqaYjMU4IIOGGl51GZvdzlUIc0= X-MC-Unique: zjYfRxeVPpiCpNoap5uW8w-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 02/18] ui/dbus: unregister clipboard on connection close Date: Tue, 7 Mar 2023 15:56:21 +0400 Message-Id: <20230307115637.2464377-3-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.3 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.133.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: 1678190232078100008 From: Marc-Andr=C3=A9 Lureau Fixes unregistration with p2p connections, since they don't have an associated name owner. Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Daniel P. Berrang=C3=A9 --- ui/dbus-clipboard.c | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/ui/dbus-clipboard.c b/ui/dbus-clipboard.c index df9a754a8d..fe7fcdecb6 100644 --- a/ui/dbus-clipboard.c +++ b/ui/dbus-clipboard.c @@ -204,15 +204,6 @@ dbus_clipboard_unregister_proxy(DBusDisplay *dpy) g_clear_object(&dpy->clipboard_proxy); } =20 -static void -dbus_on_clipboard_proxy_name_owner_changed( - DBusDisplay *dpy, - GObject *object, - GParamSpec *pspec) -{ - dbus_clipboard_unregister_proxy(dpy); -} - static gboolean dbus_clipboard_register( DBusDisplay *dpy, @@ -220,6 +211,7 @@ dbus_clipboard_register( { g_autoptr(GError) err =3D NULL; const char *name =3D NULL; + GDBusConnection *connection =3D g_dbus_method_invocation_get_connectio= n(invocation); =20 if (dpy->clipboard_proxy) { g_dbus_method_invocation_return_error( @@ -232,7 +224,7 @@ dbus_clipboard_register( =20 dpy->clipboard_proxy =3D qemu_dbus_display1_clipboard_proxy_new_sync( - g_dbus_method_invocation_get_connection(invocation), + connection, G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START, g_dbus_method_invocation_get_sender(invocation), "/org/qemu/Display1/Clipboard", @@ -252,7 +244,11 @@ dbus_clipboard_register( =20 g_object_connect(dpy->clipboard_proxy, "swapped-signal::notify::g-name-owner", - dbus_on_clipboard_proxy_name_owner_changed, dpy, + dbus_clipboard_unregister_proxy, dpy, + NULL); + g_object_connect(connection, + "swapped-signal::closed", + dbus_clipboard_unregister_proxy, dpy, NULL); qemu_clipboard_reset_serial(); =20 --=20 2.39.2 From nobody Mon May 6 03:55:54 2024 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=1678190236; cv=none; d=zohomail.com; s=zohoarc; b=bkKv54IXvYFFV2RSdjjRcF/5LOTyCpjYwxWKOwBNk+m85cVlVIyQVWSbAw5FrJaTaVtmNIqCXqbnitDsy4S9umQC3sSo/q0VhISaP2IlelLBRxT/KX+xhJNEJdk1aqND2EO4G3R6O1cN5ppewmCoxqYwL0BwZDqg5KbyoYAw7I8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1678190236; 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=gA8uaBKEfrK57cXWJj/Lx2FJcIP6rrA/fU32buhjLbA=; b=MUZ4RsrX5YiMUA4a7RhCqUKiwhNKFwC0xPkFjVY5te8dj2q0Dfy+O1lQp+SRK2A3ZOpkbWRYI96ObPqzkpkbBYh9KEHPT+RnqNX94fDvqhgO7BDbxmIPf6p3hY0sJcEhlTtNuLjaJ1MbG2yBYjQhEHMdF1tMJtMVCMoktIckJC4= 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 1678190236073948.7533199392884; Tue, 7 Mar 2023 03:57:16 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pZVwC-00025o-IN; Tue, 07 Mar 2023 06:57:00 -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 1pZVwA-00025U-N2 for qemu-devel@nongnu.org; Tue, 07 Mar 2023 06:56:58 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pZVw9-00030d-98 for qemu-devel@nongnu.org; Tue, 07 Mar 2023 06:56:58 -0500 Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-528-R9_hd6aIMT6DkzxftyhPBQ-1; Tue, 07 Mar 2023 06:56:53 -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 69DD9280AA23; Tue, 7 Mar 2023 11:56:53 +0000 (UTC) Received: from localhost (unknown [10.39.208.40]) by smtp.corp.redhat.com (Postfix) with ESMTP id A50A0492C14; Tue, 7 Mar 2023 11:56:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1678190216; 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=gA8uaBKEfrK57cXWJj/Lx2FJcIP6rrA/fU32buhjLbA=; b=MWmYWKp/9F83XJ5HXg8HRsopab7xDBG/qdspvQZ/I2o0brn/F5vLZAZjZu5f7OXM100FMi sRndEd+2v8kh0NK7dPWdLZ0XhDTbwAL6MHfhLsCpydNcDnisbMm5AUC6aF+FrlAOcFtQGg aSSlLiEFn+oqTqNJfQEdAdf+OHbJpq0= X-MC-Unique: R9_hd6aIMT6DkzxftyhPBQ-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 03/18] audio/dbus: there are no sender for p2p mode Date: Tue, 7 Mar 2023 15:56:22 +0400 Message-Id: <20230307115637.2464377-4-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.133.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: 1678190238153100003 From: Marc-Andr=C3=A9 Lureau Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Daniel P. Berrang=C3=A9 --- audio/audio_int.h | 2 +- audio/dbusaudio.c | 6 ++++-- ui/dbus.c | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/audio/audio_int.h b/audio/audio_int.h index d51d63f08d..e57ff50155 100644 --- a/audio/audio_int.h +++ b/audio/audio_int.h @@ -143,7 +143,7 @@ struct audio_driver { void *(*init) (Audiodev *); void (*fini) (void *); #ifdef CONFIG_GIO - void (*set_dbus_server) (AudioState *s, GDBusObjectManagerServer *mana= ger); + void (*set_dbus_server) (AudioState *s, GDBusObjectManagerServer *mana= ger, bool p2p); #endif struct audio_pcm_ops *pcm_ops; int can_be_default; diff --git a/audio/dbusaudio.c b/audio/dbusaudio.c index 722df0355e..9032dda49c 100644 --- a/audio/dbusaudio.c +++ b/audio/dbusaudio.c @@ -43,6 +43,7 @@ =20 typedef struct DBusAudio { GDBusObjectManagerServer *server; + bool p2p; GDBusObjectSkeleton *audio; QemuDBusDisplay1Audio *iface; GHashTable *out_listeners; @@ -448,7 +449,7 @@ dbus_audio_register_listener(AudioState *s, bool out) { DBusAudio *da =3D s->drv_opaque; - const char *sender =3D g_dbus_method_invocation_get_sender(invocation); + const char *sender =3D da->p2p ? "p2p" : g_dbus_method_invocation_get_= sender(invocation); g_autoptr(GDBusConnection) listener_conn =3D NULL; g_autoptr(GError) err =3D NULL; g_autoptr(GSocket) socket =3D NULL; @@ -591,7 +592,7 @@ dbus_audio_register_in_listener(AudioState *s, } =20 static void -dbus_audio_set_server(AudioState *s, GDBusObjectManagerServer *server) +dbus_audio_set_server(AudioState *s, GDBusObjectManagerServer *server, boo= l p2p) { DBusAudio *da =3D s->drv_opaque; =20 @@ -599,6 +600,7 @@ dbus_audio_set_server(AudioState *s, GDBusObjectManager= Server *server) g_assert(!da->server); =20 da->server =3D g_object_ref(server); + da->p2p =3D p2p; =20 da->audio =3D g_dbus_object_skeleton_new(DBUS_DISPLAY1_AUDIO_PATH); da->iface =3D qemu_dbus_display1_audio_skeleton_new(); diff --git a/ui/dbus.c b/ui/dbus.c index f2dcba03d0..f529928f0b 100644 --- a/ui/dbus.c +++ b/ui/dbus.c @@ -220,7 +220,7 @@ dbus_display_complete(UserCreatable *uc, Error **errp) dd->audiodev); return; } - audio_state->drv->set_dbus_server(audio_state, dd->server); + audio_state->drv->set_dbus_server(audio_state, dd->server, dd->p2p= ); } =20 consoles =3D g_array_new(FALSE, FALSE, sizeof(guint32)); --=20 2.39.2 From nobody Mon May 6 03:55:54 2024 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=1678190330; cv=none; d=zohomail.com; s=zohoarc; b=F8ysG4AU8YCbYHFJqKr/vadhAMP3hm9V0pGvT+ZTfJk23YBH09xLeQ5UrIke27HKYKwxYHEQq8/CtkYYRBNda4MptgaAm0Sa7XJj1KzY+jCWULG/iULHJC9/osGc+Pqc4zwTA2Sc8SgWOR2acPkrWsZ6rIpeb5NcnIX6M4HRfb8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1678190330; 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=hmg13HbxJwHg24durNrODulsq2BuE/jBI17HBX3LcJQ=; b=FezsMyMgi0hU34bti/dRgFXczmw7MFprHHhXDUHu2L+12b/0hddnEqdwkFP4YQ6h/G4KnSUxMSFImkLpW6AXhuBh9R3tVNrtY58KMcwSMM3kOf1n1FF1xXbjKTUB+4hPepa6NjPpih7435J3Dsih+mOnuT8fOZv1ksIk/f+zo4Q= 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 1678190330016935.5967817696982; Tue, 7 Mar 2023 03:58:50 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pZVwG-00028M-6s; Tue, 07 Mar 2023 06:57:04 -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 1pZVwD-00026G-Uz for qemu-devel@nongnu.org; Tue, 07 Mar 2023 06:57:02 -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 1pZVwC-00031N-1I for qemu-devel@nongnu.org; Tue, 07 Mar 2023 06:57:01 -0500 Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-33-W6-FqCG8P4Ks4-LYnLLE_g-1; Tue, 07 Mar 2023 06:56:58 -0500 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A7B68280AA24; Tue, 7 Mar 2023 11:56:57 +0000 (UTC) Received: from localhost (unknown [10.39.208.40]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9F7CE492B00; Tue, 7 Mar 2023 11:56:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1678190219; 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=hmg13HbxJwHg24durNrODulsq2BuE/jBI17HBX3LcJQ=; b=cQ6R/s6ajCngplVpV/K6gyWhShWlT+zCAge/gv14ePuHEvgG5AqbSvDzBsJLsHx3uctjVg jM+Q9EvnWjsrvUDm2uHOPlQxGJasdJsML7dPzXtaJSFs1/iz2YrwA3IN8LCbCXrWZh7/nV xYZG857K0UEZtZ2LSXUOij1GoehtdLg= X-MC-Unique: W6-FqCG8P4Ks4-LYnLLE_g-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 04/18] ui/dbus: set mouse is-absolute during console creation Date: Tue, 7 Mar 2023 15:56:23 +0400 Message-Id: <20230307115637.2464377-5-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.10 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: 1678190330674100001 From: Marc-Andr=C3=A9 Lureau Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- ui/dbus-console.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/ui/dbus-console.c b/ui/dbus-console.c index 0bfaa2298d..f77bc49d2e 100644 --- a/ui/dbus-console.c +++ b/ui/dbus-console.c @@ -411,15 +411,21 @@ dbus_mouse_release(DBusDisplayConsole *ddc, return DBUS_METHOD_INVOCATION_HANDLED; } =20 +static void +dbus_mouse_update_is_absolute(DBusDisplayConsole *ddc) +{ + g_object_set(ddc->iface_mouse, + "is-absolute", qemu_input_is_absolute(), + NULL); +} + static void dbus_mouse_mode_change(Notifier *notify, void *data) { DBusDisplayConsole *ddc =3D container_of(notify, DBusDisplayConsole, mouse_mode_notifier); =20 - g_object_set(ddc->iface_mouse, - "is-absolute", qemu_input_is_absolute(), - NULL); + dbus_mouse_update_is_absolute(ddc); } =20 int dbus_display_console_get_index(DBusDisplayConsole *ddc) @@ -492,6 +498,7 @@ dbus_display_console_new(DBusDisplay *display, QemuCons= ole *con) register_displaychangelistener(&ddc->dcl); ddc->mouse_mode_notifier.notify =3D dbus_mouse_mode_change; qemu_add_mouse_mode_change_notifier(&ddc->mouse_mode_notifier); + dbus_mouse_update_is_absolute(ddc); =20 return ddc; } --=20 2.39.2 From nobody Mon May 6 03:55:54 2024 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=1678190245; cv=none; d=zohomail.com; s=zohoarc; b=Or8nJyyBMm2Bxw5oO8W3/q2CVUKQyrbJgBg+0wQyAT4UDuDUOMNbLG+wqXAoJUNnwOPl7L+9+g0kHbFZ+zAtXzkLKbs+h5yDn1hJ/kQ4Svw3WRPv5QQCE+VJIkRZLeYpK/x9sMrqDEwsU8lof+5tT1v6gUKYPWRkaKHKC5hkiSM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1678190245; 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=MO2aoZ44E6myoCFN2vgXYm+jOHocGXEpoXAwrcahkY8=; b=ZOjbfaRnyKdLeIOs8YI1kr33xdrNIwln5IikSGSTZItU93Mp1H7CiRYtC+UM8nEw3XCjh3LevWEkVFyDlhEEWUakvyTWlipNh8AGf1ygAcKGRKFNY/8sqkTMrUEuFXSb5irJzdgbxjS3zvE7p2XUSYdxZep2WaGE0DU+KQTqJ+U= 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 1678190245114481.05657543274685; Tue, 7 Mar 2023 03:57:25 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pZVwL-0002Ei-Pk; Tue, 07 Mar 2023 06:57:09 -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 1pZVwK-00028l-4U for qemu-devel@nongnu.org; Tue, 07 Mar 2023 06:57:08 -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 1pZVwI-00033f-HZ for qemu-devel@nongnu.org; Tue, 07 Mar 2023 06:57:07 -0500 Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-377-yPvzkbgTMhmNF5Lrz_sRwg-1; Tue, 07 Mar 2023 06:57:02 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 6261A280AA23; Tue, 7 Mar 2023 11:57:02 +0000 (UTC) Received: from localhost (unknown [10.39.208.40]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3F5B2140EBF4; Tue, 7 Mar 2023 11:57:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1678190225; 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=MO2aoZ44E6myoCFN2vgXYm+jOHocGXEpoXAwrcahkY8=; b=DN/pr2b6CenLEX7btLaYUz51xeQgSQbp8a8tZqa81a6ciH1qwVD0/zkpJTEaUVwgOzCYdb Bc8eXiol3lzdd4v+wZDaY/sBLHHyZ1/T4ZVuPj3xbFIlmKHLF4+Ofh76P54h30JeEyylBH KdWWyTl4tls2f1gjviLpvffBzPMh8Lc= X-MC-Unique: yPvzkbgTMhmNF5Lrz_sRwg-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 05/18] meson: ensure dbus-display generated code is built before other units Date: Tue, 7 Mar 2023 15:56:24 +0400 Message-Id: <20230307115637.2464377-6-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.7 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: 1678190246166100003 From: Marc-Andr=C3=A9 Lureau It's simply by luck that dbus-display header is built first before the other units using it. With sourceset, I can't find an easier way out than declaring an extra dependency for dbus-display1 generate code. Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Daniel P. Berrang=C3=A9 --- ui/meson.build | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ui/meson.build b/ui/meson.build index 612ea2325b..0b2d0d21d1 100644 --- a/ui/meson.build +++ b/ui/meson.build @@ -83,7 +83,9 @@ if dbus_display '--interface-prefix', 'org.qemu.= ', '--c-namespace', 'QemuDBus', '--generate-c-code', '@BASENAME@= ']) - dbus_ss.add(when: [gio, pixman, opengl, gbm], + dbus_display1_lib =3D static_library('dbus-display1', dbus_display1, dep= endencies: gio) + dbus_display1_dep =3D declare_dependency(link_with: dbus_display1_lib, i= nclude_directories: include_directories('.')) + dbus_ss.add(when: [gio, pixman, opengl, gbm, dbus_display1_dep], if_true: [files( 'dbus-chardev.c', 'dbus-clipboard.c', @@ -91,7 +93,7 @@ if dbus_display 'dbus-error.c', 'dbus-listener.c', 'dbus.c', - ), dbus_display1]) + )]) ui_modules +=3D {'dbus' : dbus_ss} endif =20 --=20 2.39.2 From nobody Mon May 6 03:55:54 2024 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=1678190338; cv=none; d=zohomail.com; s=zohoarc; b=S5z3ITprSYq+TfdpiSO/1pg6HQ4JYdmvbOBymjzXT3dQrA9LlBnp06TAHjpzkS11j2B7mSXdGeOSBNnLwfdkam/s/eKSG6AWUW7JiMYh3135Mt9X3nHsi+H6T+ksZy/HX/azkwafS2KO17rq4yYK9d9KogvomS3wRAV73H8kEQM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1678190338; 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=4oW5umH4ZkRKjbUVDdAZ1ycDk5Po+5JIgilT0AKAMLg=; b=Qw6OlD7iunrCvqLWRisFLtKHnmK0rdeakrWJkgSMKYZrbzU1pmZR4LBa0IxtNBvhi1Iop763VmXkJYtzvydar63Y9wej+Yu5lDruq5x8rFjTYgXrbzDGxW4labvZ2zixmj1E3/ZTwFhenBPVAcKB45Lh3R/9B1lekPYUvfpqBjU= 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 1678190338326592.6120807021289; Tue, 7 Mar 2023 03:58:58 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pZVwO-0002IL-GV; Tue, 07 Mar 2023 06:57:12 -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 1pZVwN-0002HG-4L for qemu-devel@nongnu.org; Tue, 07 Mar 2023 06:57:11 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pZVwL-00034B-HG for qemu-devel@nongnu.org; Tue, 07 Mar 2023 06:57:10 -0500 Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-620-MgyFcWbKNBiIUvPAOk9K0Q-1; Tue, 07 Mar 2023 06:57:07 -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 55852280AA23; Tue, 7 Mar 2023 11:57:07 +0000 (UTC) Received: from localhost (unknown [10.39.208.40]) by smtp.corp.redhat.com (Postfix) with ESMTP id ED0FF492C14; Tue, 7 Mar 2023 11:57:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1678190229; 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=4oW5umH4ZkRKjbUVDdAZ1ycDk5Po+5JIgilT0AKAMLg=; b=GgvKmQDT/9TggLerh/jQx/haMwVl7WysUuqAcwlHGdiaWkM7Gz6vc9Uj5X148TaYbBquj7 lZ4y+/qKeaYpVcdVeoVAXBqEgmJnfGpq+D87KiBVxbLHoCiBVwM18seJ7cVupEUp7berbq qf3cTY7cYDhHIt8UnapGhAXEzcuR7ho= X-MC-Unique: MgyFcWbKNBiIUvPAOk9K0Q-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 06/18] ui: rename cursor_{put->unref} Date: Tue, 7 Mar 2023 15:56:25 +0400 Message-Id: <20230307115637.2464377-7-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.133.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: 1678190338796100001 From: Marc-Andr=C3=A9 Lureau The naming is more conventional in QEMU. Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Daniel P. Berrang=C3=A9 --- include/ui/console.h | 2 +- hw/display/qxl-render.c | 4 ++-- hw/display/qxl.c | 2 +- hw/display/vmware_vga.c | 4 ++-- ui/cursor.c | 2 +- ui/dbus-listener.c | 2 +- ui/spice-display.c | 4 ++-- ui/vnc.c | 2 +- 8 files changed, 11 insertions(+), 11 deletions(-) diff --git a/include/ui/console.h b/include/ui/console.h index 1cb53acc33..3efd1f6b82 100644 --- a/include/ui/console.h +++ b/include/ui/console.h @@ -152,7 +152,7 @@ typedef struct QEMUCursor { =20 QEMUCursor *cursor_alloc(int width, int height); void cursor_get(QEMUCursor *c); -void cursor_put(QEMUCursor *c); +void cursor_unref(QEMUCursor *c); QEMUCursor *cursor_builtin_hidden(void); QEMUCursor *cursor_builtin_left_ptr(void); void cursor_print_ascii_art(QEMUCursor *c, const char *prefix); diff --git a/hw/display/qxl-render.c b/hw/display/qxl-render.c index fcfd40c3ac..ec99ec887a 100644 --- a/hw/display/qxl-render.c +++ b/hw/display/qxl-render.c @@ -290,7 +290,7 @@ static QEMUCursor *qxl_cursor(PCIQXLDevice *qxl, QXLCur= sor *cursor, return c; =20 fail: - cursor_put(c); + cursor_unref(c); return NULL; } =20 @@ -336,7 +336,7 @@ int qxl_render_cursor(PCIQXLDevice *qxl, QXLCommandExt = *ext) } qemu_mutex_lock(&qxl->ssd.lock); if (qxl->ssd.cursor) { - cursor_put(qxl->ssd.cursor); + cursor_unref(qxl->ssd.cursor); } qxl->ssd.cursor =3D c; qxl->ssd.mouse_x =3D cmd->u.set.position.x; diff --git a/hw/display/qxl.c b/hw/display/qxl.c index ec712d3ca2..80ce1e9a93 100644 --- a/hw/display/qxl.c +++ b/hw/display/qxl.c @@ -299,7 +299,7 @@ void qxl_spice_reset_cursor(PCIQXLDevice *qxl) qxl->guest_cursor =3D 0; qemu_mutex_unlock(&qxl->track_lock); if (qxl->ssd.cursor) { - cursor_put(qxl->ssd.cursor); + cursor_unref(qxl->ssd.cursor); } qxl->ssd.cursor =3D cursor_builtin_hidden(); } diff --git a/hw/display/vmware_vga.c b/hw/display/vmware_vga.c index 59ae7f74b8..09591fbd39 100644 --- a/hw/display/vmware_vga.c +++ b/hw/display/vmware_vga.c @@ -550,12 +550,12 @@ static inline void vmsvga_cursor_define(struct vmsvga= _state_s *s, default: fprintf(stderr, "%s: unhandled bpp %d, using fallback cursor\n", __func__, c->bpp); - cursor_put(qc); + cursor_unref(qc); qc =3D cursor_builtin_left_ptr(); } =20 dpy_cursor_define(s->vga.con, qc); - cursor_put(qc); + cursor_unref(qc); } #endif =20 diff --git a/ui/cursor.c b/ui/cursor.c index 835f0802f9..31b09bf058 100644 --- a/ui/cursor.c +++ b/ui/cursor.c @@ -111,7 +111,7 @@ void cursor_get(QEMUCursor *c) c->refcount++; } =20 -void cursor_put(QEMUCursor *c) +void cursor_unref(QEMUCursor *c) { if (c =3D=3D NULL) return; diff --git a/ui/dbus-listener.c b/ui/dbus-listener.c index 2dafd6569c..906ab296ca 100644 --- a/ui/dbus-listener.c +++ b/ui/dbus-listener.c @@ -345,7 +345,7 @@ static void dbus_cursor_define(DisplayChangeListener *d= cl, c->data, c->width * c->height * 4, TRUE, - (GDestroyNotify)cursor_put, + (GDestroyNotify)cursor_unref, c); =20 qemu_dbus_display1_listener_call_cursor_define( diff --git a/ui/spice-display.c b/ui/spice-display.c index 16802f99cb..243a794638 100644 --- a/ui/spice-display.c +++ b/ui/spice-display.c @@ -464,7 +464,7 @@ void qemu_spice_cursor_refresh_bh(void *opaque) qemu_mutex_unlock(&ssd->lock); dpy_cursor_define(ssd->dcl.con, c); qemu_mutex_lock(&ssd->lock); - cursor_put(c); + cursor_unref(c); } =20 if (ssd->mouse_x !=3D -1 && ssd->mouse_y !=3D -1) { @@ -766,7 +766,7 @@ static void display_mouse_define(DisplayChangeListener = *dcl, =20 qemu_mutex_lock(&ssd->lock); cursor_get(c); - cursor_put(ssd->cursor); + cursor_unref(ssd->cursor); ssd->cursor =3D c; ssd->hot_x =3D c->hot_x; ssd->hot_y =3D c->hot_y; diff --git a/ui/vnc.c b/ui/vnc.c index d9eacad759..0bdcc3dfce 100644 --- a/ui/vnc.c +++ b/ui/vnc.c @@ -1029,7 +1029,7 @@ static void vnc_dpy_cursor_define(DisplayChangeListen= er *dcl, VncDisplay *vd =3D container_of(dcl, VncDisplay, dcl); VncState *vs; =20 - cursor_put(vd->cursor); + cursor_unref(vd->cursor); g_free(vd->cursor_mask); =20 vd->cursor =3D c; --=20 2.39.2 From nobody Mon May 6 03:55:54 2024 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=1678190268; cv=none; d=zohomail.com; s=zohoarc; b=IbpqRJhy1KOJRQrWwDE2KbWEYRtNNxg1Vvmf1MEr2/LI1SmTPA/paTuwfgLlGu5gW/6sN1dTW/A6RM4kxPg9RrZNFb7TVaV9pLdvjNNPlxKcyROSIZHPOQbPBdaokmUHy46h+5Y/fCaxeZOPq7FTce50fCqUkM4/WUKDkZ8l+5Q= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1678190268; 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=ytodyDxxW/PQaRahgYZVdVd9qaMgivkqwlEJGugBkco=; b=Vf67gMi/BEk6NnBWSW79TLoIL1zZusnVx9XjjJwwvn9fir/sFi/+pjgrOquSjf/k3vBj2R93Ri51jwMV+is9UxVNPAoKesO/ehO4wUHIxgwcZmU4Qb1fgXXUhxG9Ok1X6gVAPvb/s5l8N/zSiMVbEjaPO2NP/ifYtaYALR1ojLg= 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 1678190268484364.7142389529955; Tue, 7 Mar 2023 03:57:48 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pZVwU-0002Ux-3S; Tue, 07 Mar 2023 06:57:18 -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 1pZVwS-0002OT-Vt for qemu-devel@nongnu.org; Tue, 07 Mar 2023 06:57:17 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pZVwR-00034h-3Y for qemu-devel@nongnu.org; Tue, 07 Mar 2023 06:57:16 -0500 Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-74-uD4e8SY3MyaWP_Uc8zFzaA-1; Tue, 07 Mar 2023 06:57:12 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 6C48F280AA24; Tue, 7 Mar 2023 11:57:12 +0000 (UTC) Received: from localhost (unknown [10.39.208.40]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2F3AF35454; Tue, 7 Mar 2023 11:57:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1678190233; 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=ytodyDxxW/PQaRahgYZVdVd9qaMgivkqwlEJGugBkco=; b=jMuviznYq3w9fJe3cA842Fv1/egC6GKJv4+5QqW7O2c6hIl/spQYbenXNMiKQR6N2FDP/z I09LKwKS/iubWKS7HkmS8aKEI/xacK88JgdwyLCUnbPL6jHxORy9iLgva41aoqWv04zDHV /lc9MjL3vHJhJwUstZndU7wMliZE49k= X-MC-Unique: uD4e8SY3MyaWP_Uc8zFzaA-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 07/18] ui: rename cursor_{get->ref}, return it Date: Tue, 7 Mar 2023 15:56:26 +0400 Message-Id: <20230307115637.2464377-8-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.5 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.133.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: 1678190270313100003 From: Marc-Andr=C3=A9 Lureau The naming is more conventional in QEMU code, and allows to simplify some code. Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Daniel P. Berrang=C3=A9 --- include/ui/console.h | 2 +- ui/cursor.c | 3 ++- ui/dbus-listener.c | 3 +-- ui/spice-display.c | 4 ++-- ui/vnc.c | 3 +-- 5 files changed, 7 insertions(+), 8 deletions(-) diff --git a/include/ui/console.h b/include/ui/console.h index 3efd1f6b82..0b01df947e 100644 --- a/include/ui/console.h +++ b/include/ui/console.h @@ -151,7 +151,7 @@ typedef struct QEMUCursor { } QEMUCursor; =20 QEMUCursor *cursor_alloc(int width, int height); -void cursor_get(QEMUCursor *c); +QEMUCursor *cursor_ref(QEMUCursor *c); void cursor_unref(QEMUCursor *c); QEMUCursor *cursor_builtin_hidden(void); QEMUCursor *cursor_builtin_left_ptr(void); diff --git a/ui/cursor.c b/ui/cursor.c index 31b09bf058..6fe67990e2 100644 --- a/ui/cursor.c +++ b/ui/cursor.c @@ -106,9 +106,10 @@ QEMUCursor *cursor_alloc(int width, int height) return c; } =20 -void cursor_get(QEMUCursor *c) +QEMUCursor *cursor_ref(QEMUCursor *c) { c->refcount++; + return c; } =20 void cursor_unref(QEMUCursor *c) diff --git a/ui/dbus-listener.c b/ui/dbus-listener.c index 906ab296ca..2e87ed7e9a 100644 --- a/ui/dbus-listener.c +++ b/ui/dbus-listener.c @@ -339,14 +339,13 @@ static void dbus_cursor_define(DisplayChangeListener = *dcl, DBusDisplayListener *ddl =3D container_of(dcl, DBusDisplayListener, dc= l); GVariant *v_data =3D NULL; =20 - cursor_get(c); v_data =3D g_variant_new_from_data( G_VARIANT_TYPE("ay"), c->data, c->width * c->height * 4, TRUE, (GDestroyNotify)cursor_unref, - c); + cursor_ref(c)); =20 qemu_dbus_display1_listener_call_cursor_define( ddl->proxy, diff --git a/ui/spice-display.c b/ui/spice-display.c index 243a794638..5bee19a7f9 100644 --- a/ui/spice-display.c +++ b/ui/spice-display.c @@ -460,7 +460,7 @@ void qemu_spice_cursor_refresh_bh(void *opaque) if (ssd->cursor) { QEMUCursor *c =3D ssd->cursor; assert(ssd->dcl.con); - cursor_get(c); + cursor_ref(c); qemu_mutex_unlock(&ssd->lock); dpy_cursor_define(ssd->dcl.con, c); qemu_mutex_lock(&ssd->lock); @@ -765,7 +765,7 @@ static void display_mouse_define(DisplayChangeListener = *dcl, SimpleSpiceDisplay *ssd =3D container_of(dcl, SimpleSpiceDisplay, dcl); =20 qemu_mutex_lock(&ssd->lock); - cursor_get(c); + cursor_ref(c); cursor_unref(ssd->cursor); ssd->cursor =3D c; ssd->hot_x =3D c->hot_x; diff --git a/ui/vnc.c b/ui/vnc.c index 0bdcc3dfce..8aec5d751e 100644 --- a/ui/vnc.c +++ b/ui/vnc.c @@ -1032,8 +1032,7 @@ static void vnc_dpy_cursor_define(DisplayChangeListen= er *dcl, cursor_unref(vd->cursor); g_free(vd->cursor_mask); =20 - vd->cursor =3D c; - cursor_get(vd->cursor); + vd->cursor =3D cursor_ref(vd->cursor); vd->cursor_msize =3D cursor_get_mono_bpl(c) * c->height; vd->cursor_mask =3D g_malloc0(vd->cursor_msize); cursor_get_mono_mask(c, 0, vd->cursor_mask); --=20 2.39.2 From nobody Mon May 6 03:55:54 2024 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=1678190309; cv=none; d=zohomail.com; s=zohoarc; b=TrO2DfjpJWniPUdRVoYJn2UscXAYZE/b1uXs0wg1KYo1Z1fWYyu4nOQc3gBQxKOgeJwEJMTkVqENxN0WxgakI1qKxBk7/pLAlzhLJWizvBp0s4R/88eGYI6G67VYuzGHZIIIx2jTeSiCQsHtUWWAIRk36JMJLB1k03RPDV53Wsg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1678190309; 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=qe7J5Ktw3Y8AFalGM+UhHqZ+i10pyYP2ot8WGgkWLjA=; b=GmPdq6xOHy3bioxwGvZaZPz8+qlp+B+2J60Ik+72DBABAxkplTLvQPXadkrLM5dPLlronObzYKb/yztyh8ae88s0FtXELtzeL3JOSgJWleB9SqP+jLAhukpdQvVG6M04am4QJyebd0d5xNYrpVjxLuk+dmVakZBYpmMsaPLqb+E= 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 1678190309783313.2053593566475; Tue, 7 Mar 2023 03:58:29 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pZVwg-0002cI-7s; Tue, 07 Mar 2023 06:57:30 -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 1pZVwY-0002YM-NJ for qemu-devel@nongnu.org; Tue, 07 Mar 2023 06:57:24 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pZVwX-00035M-AP for qemu-devel@nongnu.org; Tue, 07 Mar 2023 06:57:22 -0500 Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-404-_dJcL3Z0OC6qV9DeboRdQw-1; Tue, 07 Mar 2023 06:57:17 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 5EEC13C10ED2; Tue, 7 Mar 2023 11:57:17 +0000 (UTC) Received: from localhost (unknown [10.39.208.40]) by smtp.corp.redhat.com (Postfix) with ESMTP id 57B2F140EBF4; Tue, 7 Mar 2023 11:57:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1678190240; 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=qe7J5Ktw3Y8AFalGM+UhHqZ+i10pyYP2ot8WGgkWLjA=; b=ES2O9WyVLic/vqxm0pP7erguIOlda/pcDaJviAXKrTFa4S8UO0F6tCl5M0Veuz6y3ujgZY FNODMjy99taHIlX9VB/isn0Xo8BVpFG03nj9EUE4rs7+WyY68SZl43pQuy9vLAZV6bO9I9 1sF9pHQnzRSnR0rn5FBF4Uu4xjp9DMU= X-MC-Unique: _dJcL3Z0OC6qV9DeboRdQw-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 08/18] ui: keep current cursor with QemuConsole Date: Tue, 7 Mar 2023 15:56:27 +0400 Message-Id: <20230307115637.2464377-9-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.7 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.133.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: 1678190310629100001 From: Marc-Andr=C3=A9 Lureau Keeping the current cursor around is useful, not only for VNC, but for other displays. Let's move it down, see the following patches for other usages. Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Daniel P. Berrang=C3=A9 --- include/ui/console.h | 1 + ui/vnc.h | 1 - ui/console.c | 8 ++++++++ ui/vnc.c | 7 ++----- 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/include/ui/console.h b/include/ui/console.h index 0b01df947e..2a8fab091f 100644 --- a/include/ui/console.h +++ b/include/ui/console.h @@ -459,6 +459,7 @@ QemuConsole *qemu_console_lookup_by_device(DeviceState = *dev, uint32_t head); QemuConsole *qemu_console_lookup_by_device_name(const char *device_id, uint32_t head, Error **err= p); QemuConsole *qemu_console_lookup_unused(void); +QEMUCursor *qemu_console_get_cursor(QemuConsole *con); bool qemu_console_is_visible(QemuConsole *con); bool qemu_console_is_graphic(QemuConsole *con); bool qemu_console_is_fixedsize(QemuConsole *con); diff --git a/ui/vnc.h b/ui/vnc.h index a60fb13115..757fa83044 100644 --- a/ui/vnc.h +++ b/ui/vnc.h @@ -159,7 +159,6 @@ struct VncDisplay QKbdState *kbd; QemuMutex mutex; =20 - QEMUCursor *cursor; int cursor_msize; uint8_t *cursor_mask; =20 diff --git a/ui/console.c b/ui/console.c index 98b701f5a3..0dccbdd4be 100644 --- a/ui/console.c +++ b/ui/console.c @@ -94,6 +94,7 @@ struct QemuConsole { uint32_t head; QemuUIInfo ui_info; QEMUTimer *ui_timer; + QEMUCursor *cursor; const GraphicHwOps *hw_ops; void *hw; =20 @@ -1923,6 +1924,8 @@ void dpy_cursor_define(QemuConsole *con, QEMUCursor *= cursor) DisplayState *s =3D con->ds; DisplayChangeListener *dcl; =20 + cursor_unref(con->cursor); + con->cursor =3D cursor_ref(cursor); if (!qemu_console_is_visible(con)) { return; } @@ -2288,6 +2291,11 @@ QemuConsole *qemu_console_lookup_unused(void) return NULL; } =20 +QEMUCursor *qemu_console_get_cursor(QemuConsole *con) +{ + return con->cursor; +} + bool qemu_console_is_visible(QemuConsole *con) { return (con =3D=3D active_console) || (con->dcls > 0); diff --git a/ui/vnc.c b/ui/vnc.c index 8aec5d751e..bbd8b6baae 100644 --- a/ui/vnc.c +++ b/ui/vnc.c @@ -988,10 +988,10 @@ static void vnc_mouse_set(DisplayChangeListener *dcl, =20 static int vnc_cursor_define(VncState *vs) { - QEMUCursor *c =3D vs->vd->cursor; + QEMUCursor *c =3D qemu_console_get_cursor(vs->vd->dcl.con); int isize; =20 - if (!vs->vd->cursor) { + if (!c) { return -1; } =20 @@ -1029,10 +1029,7 @@ static void vnc_dpy_cursor_define(DisplayChangeListe= ner *dcl, VncDisplay *vd =3D container_of(dcl, VncDisplay, dcl); VncState *vs; =20 - cursor_unref(vd->cursor); g_free(vd->cursor_mask); - - vd->cursor =3D cursor_ref(vd->cursor); vd->cursor_msize =3D cursor_get_mono_bpl(c) * c->height; vd->cursor_mask =3D g_malloc0(vd->cursor_msize); cursor_get_mono_mask(c, 0, vd->cursor_mask); --=20 2.39.2 From nobody Mon May 6 03:55:54 2024 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=1678190324; cv=none; d=zohomail.com; s=zohoarc; b=aQ9ZtCSLWt/67bdnKlJI20wuLs29DqzSZ0JmcnE7qiM8C9coF5lkQGC+2Kbg5xXUG3nZLngToOReDKhAtAEe4O+sXbyrQ46OTbcs/JNRbvJDkUkl3uYg6QfiwDQjeKymNkXRPFjeMO1SNHhnB4NrNmTnP2JeRbl/flLnzUj6btA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1678190324; 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=gm6H6AmvoABX8Fjg8D0FXSGcIYjEDAuaAHHlb20Ak1U=; b=bECkSNg9BasLVgy19gJ+K4RymIIx3IbS/xDyHw8b9HV0p/vDaEq1BOrJUoAvx2ZYBbhMAlY+hNunORhvny9Vi9GAQIRCSTekmxxA1zFTLyaQ6Ijpuy9FNrgA/M7Uaym6SY74xziERuCR+ebCLEs3whpRD58rQ67VIQg8/IW7aIs= 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 1678190324355567.6712768368989; Tue, 7 Mar 2023 03:58:44 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pZVwg-0002d6-Uu; Tue, 07 Mar 2023 06:57:30 -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 1pZVwb-0002aR-Tt for qemu-devel@nongnu.org; Tue, 07 Mar 2023 06:57:26 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pZVwa-00035e-4F for qemu-devel@nongnu.org; Tue, 07 Mar 2023 06:57:25 -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-92-dUHfZXy0OteebxK0EHImJw-1; Tue, 07 Mar 2023 06:57:21 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A26208828C2; Tue, 7 Mar 2023 11:57:21 +0000 (UTC) Received: from localhost (unknown [10.39.208.40]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7D8EC40CF8EE; Tue, 7 Mar 2023 11:57:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1678190243; 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=gm6H6AmvoABX8Fjg8D0FXSGcIYjEDAuaAHHlb20Ak1U=; b=dAlelEkVL2viDgZj7UyIaMTz/ioqKUXNTSNUqnC/fkL5Fqd+qYBvwUGKgRT5uPbiqLV5j0 7id+mMYNyTPI557oMauuDjk7oC0H+JgTMjF5lRIOymMikg3dJ8w5n3/HrDWaj2yEByJM4r jKoKcBdviAY7ztb4KWyQzXX/i9Hge2A= X-MC-Unique: dUHfZXy0OteebxK0EHImJw-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 09/18] ui: set cursor upon listener registration Date: Tue, 7 Mar 2023 15:56:28 +0400 Message-Id: <20230307115637.2464377-10-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.1 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.133.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: 1678190324581100001 From: Marc-Andr=C3=A9 Lureau Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Daniel P. Berrang=C3=A9 --- ui/console.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ui/console.c b/ui/console.c index 0dccbdd4be..7b808f080e 100644 --- a/ui/console.c +++ b/ui/console.c @@ -1662,6 +1662,9 @@ void register_displaychangelistener(DisplayChangeList= ener *dcl) con =3D active_console; } displaychangelistener_display_console(dcl, con, dcl->con ? &error_fata= l : NULL); + if (con->cursor && dcl->ops->dpy_cursor_define) { + dcl->ops->dpy_cursor_define(dcl, con->cursor); + } text_console_update_cursor(NULL); } =20 --=20 2.39.2 From nobody Mon May 6 03:55:54 2024 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=1678190349; cv=none; d=zohomail.com; s=zohoarc; b=mB5LkIxCXmDprufCouzwEcDlWqhwJ9EKpwXcwy+QkXaKQ6PNwz+62bRALplkHm/FNmevvvf2hHO/7EPHFz843GUL6sIMKGVmNUk+XyIjvk3OygG8YxCdUGpzVfwGeS0/1P/OUUHffaK3zP3l8O9yC8/S46f6iOLGZq9yiPDz9A0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1678190349; 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=VU2GS+OJItwdmT7dr8MxEEEEbWfKF5GqYz/ZMnZtEzw=; b=Fmh9WxSiaYzcoxDcuIUBLI88qlJq9HT2DwpQFF31a3ecoqNretVgm5QQf0y16WKtan8owkQYmdUzBxKywLJLq+DBp9dKsxSMspe3py1SHV2B5tEoRW+SgZbhhIi0qvkryaFAzZEdLfKeOc0mntPk3chsVFmmm/HTg3BTvaoy2y4= 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 1678190349160439.798956814707; Tue, 7 Mar 2023 03:59:09 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pZVwj-0002hN-Rt; Tue, 07 Mar 2023 06:57:33 -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 1pZVwh-0002dZ-SM for qemu-devel@nongnu.org; Tue, 07 Mar 2023 06:57:32 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pZVwg-00036S-Iy for qemu-devel@nongnu.org; Tue, 07 Mar 2023 06:57:31 -0500 Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-280-ztbGUdpVP7SLgKeZDZaiEw-1; Tue, 07 Mar 2023 06:57:26 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 57415280AA24; Tue, 7 Mar 2023 11:57:26 +0000 (UTC) Received: from localhost (unknown [10.39.208.40]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1D46F400DFA1; Tue, 7 Mar 2023 11:57:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1678190249; 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=VU2GS+OJItwdmT7dr8MxEEEEbWfKF5GqYz/ZMnZtEzw=; b=TFFa2nTor60fmXz8pN6kt4/5qaw9yXfqO72eFkkj2zQvMN0Hr8nv0/S+PIuP8TXUtbMoFN qGk8vz6iN3Zw7aijOu9qkxtn91G1oUlIKEvkOcq1QiGCHRjene1sNPI0cEAUv4XAGVCyS0 VoxQGF2mlkN0poaqYZxnCpRou1X5T90= X-MC-Unique: ztbGUdpVP7SLgKeZDZaiEw-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 10/18] ui: set cursor position upon listener registration Date: Tue, 7 Mar 2023 15:56:29 +0400 Message-Id: <20230307115637.2464377-11-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.1 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.133.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: 1678190350824100003 From: Marc-Andr=C3=A9 Lureau Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Daniel P. Berrang=C3=A9 --- ui/console.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ui/console.c b/ui/console.c index 7b808f080e..8fc18c44bf 100644 --- a/ui/console.c +++ b/ui/console.c @@ -95,6 +95,7 @@ struct QemuConsole { QemuUIInfo ui_info; QEMUTimer *ui_timer; QEMUCursor *cursor; + int cursor_x, cursor_y, cursor_on; const GraphicHwOps *hw_ops; void *hw; =20 @@ -1665,6 +1666,9 @@ void register_displaychangelistener(DisplayChangeList= ener *dcl) if (con->cursor && dcl->ops->dpy_cursor_define) { dcl->ops->dpy_cursor_define(dcl, con->cursor); } + if (dcl->ops->dpy_mouse_set) { + dcl->ops->dpy_mouse_set(dcl, con->cursor_x, con->cursor_y, con->cu= rsor_on); + } text_console_update_cursor(NULL); } =20 @@ -1909,6 +1913,9 @@ void dpy_mouse_set(QemuConsole *con, int x, int y, in= t on) DisplayState *s =3D con->ds; DisplayChangeListener *dcl; =20 + con->cursor_x =3D x; + con->cursor_y =3D y; + con->cursor_on =3D on; if (!qemu_console_is_visible(con)) { return; } --=20 2.39.2 From nobody Mon May 6 03:55:54 2024 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=1678190316; cv=none; d=zohomail.com; s=zohoarc; b=XUZhVeeAbV62lJNrahNOGIgsnkfZkmiyJiPv3sZiTA+MfQ3Hr98qfEyY91BUpyCtBE1LdZr81Zqfafemx7k++9CLItRNiSHStMfCnewOMhdkNstcjX8CYbm/0pM8T6+xZJKPe4JDF314GoKQq0D7V8U1m5TEtUAKF8O2zfFeA/o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1678190316; 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=Lu6WC4I8hNO27qRD5ujsocujWgXmoTYqycdVwyHBBEc=; b=Ru1Szhgi4bdNPpUdUi5MMUUYyfeGYYL8d6TwgyeeJH6Xq+w3wWolW8Spocs2UpyUc22h+aFtAVVccIjPSEp3HWKqM8E+s1GYNGC0iYWFTgxbvyzDGoijWaxqX50HJ1/w24RniFl6in2XyH2FNZU19T36Rrw2cntgHZO5lv6L4uo= 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 1678190316268142.24976465099542; Tue, 7 Mar 2023 03:58:36 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pZVwm-0002vf-KO; Tue, 07 Mar 2023 06:57:36 -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 1pZVwl-0002sM-UN for qemu-devel@nongnu.org; Tue, 07 Mar 2023 06:57:35 -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 1pZVwk-00036k-82 for qemu-devel@nongnu.org; Tue, 07 Mar 2023 06:57:35 -0500 Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-7-tpR4BcJ6MZuQNsbkUlJH2Q-1; Tue, 07 Mar 2023 06:57:32 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id BF7623C10ED5; Tue, 7 Mar 2023 11:57:31 +0000 (UTC) Received: from localhost (unknown [10.39.208.40]) by smtp.corp.redhat.com (Postfix) with ESMTP id B61B3112132D; Tue, 7 Mar 2023 11:57:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1678190253; 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=Lu6WC4I8hNO27qRD5ujsocujWgXmoTYqycdVwyHBBEc=; b=jWeIcyvEhBWBtqR+YfAMGUN1lCRQZ35fpauA+dGOblfD22GvS3XmW/+ykGR7dE4NbsCVFp m13b09hl4fhOyvo9RgKh2fPrCi3RmkD6EM7ngnOCUfHHOLH9S1/KBA47ulot5hBlVEaXBU M1/ht/tNs6SFDPwCZXum7yo0/cNIQcA= X-MC-Unique: tpR4BcJ6MZuQNsbkUlJH2Q-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 11/18] ui/sdl: get the GL context from the window Date: Tue, 7 Mar 2023 15:56:30 +0400 Message-Id: <20230307115637.2464377-12-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.3 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: 1678190316542100001 From: Marc-Andr=C3=A9 Lureau There is no guarantee to have a current GL context here. The current code seems to rely on the renderer using a GL backend, and to set a current GL context. But this is not always the case, for example if the renderer backend is DirectX. This change is enough to fix using virgl with sdl2 on win32, on my setup. Signed-off-by: Marc-Andr=C3=A9 Lureau --- ui/sdl2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/sdl2.c b/ui/sdl2.c index 8cb77416af..f259e4c4d1 100644 --- a/ui/sdl2.c +++ b/ui/sdl2.c @@ -101,7 +101,7 @@ void sdl2_window_create(struct sdl2_console *scon) flags); scon->real_renderer =3D SDL_CreateRenderer(scon->real_window, -1, 0); if (scon->opengl) { - scon->winctx =3D SDL_GL_GetCurrentContext(); + scon->winctx =3D SDL_GL_CreateContext(scon->real_window); } sdl_update_caption(scon); } --=20 2.39.2 From nobody Mon May 6 03:55:54 2024 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=1678190296; cv=none; d=zohomail.com; s=zohoarc; b=XSbS2WQoudbAzaHUFX9/FxcBqh9eZGUE5hnV8Msd9YVueCvqU7L5Ioj7HOtUPwLQQSDE49BS3ijw+8KrlM6nepikw+/GLhEhgt2AAH1HjldO/lgAISRJTwMm57i1ZaBJZYYP3TNvccVC3q5wjjMfa8GMcSSlLvD/cqd29RE5KNI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1678190296; 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=U/4V+AvA/fQKPJ8Z8PltJAtGmk5zVH0xY1utFsaz2fw=; b=kHBCOZHgXn3HMcybTyrMydYA8/gXHtw7503fe8xkoWPqcTw/UDRnha2FFmNHC+gfROAH7jnxMVerI7x6ZhH0j+qiz0wGSlmQAS/K2Z5q3FjazAGbL+Ri0daaQ/eQKO+8T91WQMmhP8pt/myC610dFIc2nd27Z2osyEcOo85MRgg= 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 1678190296054182.6466934776995; Tue, 7 Mar 2023 03:58:16 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pZVx4-0004zQ-Sl; Tue, 07 Mar 2023 06:57:54 -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 1pZVx2-0004nw-Ij for qemu-devel@nongnu.org; Tue, 07 Mar 2023 06:57:52 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pZVx1-00038i-7T for qemu-devel@nongnu.org; Tue, 07 Mar 2023 06:57:52 -0500 Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-294-mywbVT2dOdGpE-d--tZ5FQ-1; Tue, 07 Mar 2023 06:57:36 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 1375438221C9; Tue, 7 Mar 2023 11:57:36 +0000 (UTC) Received: from localhost (unknown [10.39.208.40]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0DC1B400F8FA; Tue, 7 Mar 2023 11:57:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1678190270; 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=U/4V+AvA/fQKPJ8Z8PltJAtGmk5zVH0xY1utFsaz2fw=; b=In2bw4vFUgTj3/k0ofw8TQwK6J84e/bFhFKjMRT19RubopKTBSlIpqgeUh6Qesglt1Lw5S oiyqMiuJXLDEcLCNhKRhLuQOvhc1G+HQBj0VvH1fzR8nARLScNrC3NSPoRVpDTKU9AYAay UVYvlAC3nl3XhEgB1fQnmHX8rfvZbsU= X-MC-Unique: mywbVT2dOdGpE-d--tZ5FQ-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 12/18] ui/shader: fix #version directive must occur on first line Date: Tue, 7 Mar 2023 15:56:31 +0400 Message-Id: <20230307115637.2464377-13-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.2 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.133.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: 1678190296440100001 From: Marc-Andr=C3=A9 Lureau ANGLE fails to compile shaders otherwise. Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Daniel P. Berrang=C3=A9 --- ui/shader/texture-blit-flip.vert | 1 - ui/shader/texture-blit.frag | 1 - ui/shader/texture-blit.vert | 1 - 3 files changed, 3 deletions(-) diff --git a/ui/shader/texture-blit-flip.vert b/ui/shader/texture-blit-flip= .vert index ba081fa5a6..f7a448d229 100644 --- a/ui/shader/texture-blit-flip.vert +++ b/ui/shader/texture-blit-flip.vert @@ -1,4 +1,3 @@ - #version 300 es =20 in vec2 in_position; diff --git a/ui/shader/texture-blit.frag b/ui/shader/texture-blit.frag index bfa202c22b..8ed95a46b6 100644 --- a/ui/shader/texture-blit.frag +++ b/ui/shader/texture-blit.frag @@ -1,4 +1,3 @@ - #version 300 es =20 uniform sampler2D image; diff --git a/ui/shader/texture-blit.vert b/ui/shader/texture-blit.vert index 6fe2744d68..fb48d70665 100644 --- a/ui/shader/texture-blit.vert +++ b/ui/shader/texture-blit.vert @@ -1,4 +1,3 @@ - #version 300 es =20 in vec2 in_position; --=20 2.39.2 From nobody Mon May 6 03:55:54 2024 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=1678190342; cv=none; d=zohomail.com; s=zohoarc; b=IxYCKXITJidOz9cE7DmYhc7z1wskj4nc7q3x4l5guR19or0O6dLyeLdj1zxY/ljoFpfnkKehF1S+Q1nRJ8JNrPkqL+ilDb8Vixeg0XnHFkYFRckgO2B5orHukFB3hmpUCE+t5aPxwRTCmZhsGOqTeMylL3w6RN9n5ooiOySRiGk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1678190342; 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=tGh20aFBMd/ysU+6R1OS2Y6iV2bWlbvY0yYLpsHUyYU=; b=EFhtqrUK2p9tH1OVyGR+LZOWk10ecssl/cXpwIYBiShNuozh6OudolsqxMse2QM1Zg66s6x1tWdeYsaRn3BzE4oJKe88yjAxoGx8VODCMd+dWhnLhJLX3NSuLtf9SLDu7zoNaT1zOS2DCQ9VgwEhO3H3SaaW0GrQYgtxUK8EEYQ= 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 1678190342305295.442622188625; Tue, 7 Mar 2023 03:59:02 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pZVwx-00043S-Ey; Tue, 07 Mar 2023 06:57:47 -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 1pZVwv-0003tY-JU for qemu-devel@nongnu.org; Tue, 07 Mar 2023 06:57:45 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pZVwu-00037q-5j for qemu-devel@nongnu.org; Tue, 07 Mar 2023 06:57:45 -0500 Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-382-uz0S8PTQNW-X9zRGS3GigQ-1; Tue, 07 Mar 2023 06:57:40 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 251EC280A323; Tue, 7 Mar 2023 11:57:40 +0000 (UTC) Received: from localhost (unknown [10.39.208.40]) by smtp.corp.redhat.com (Postfix) with ESMTP id 49FC52166B26; Tue, 7 Mar 2023 11:57:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1678190263; 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=tGh20aFBMd/ysU+6R1OS2Y6iV2bWlbvY0yYLpsHUyYU=; b=iAhoi3vJ0CR590cXy6XwyAW6zTvXErM1HRXaNpffI2KZOdSBmwNxkudyT//xw13IWHv/NO /o5Rrb8WG2WNgk/pLqTGN1ZAAqVruL1rIO8+Ye5oKAVC1WGA1OS5b1VXJ9NO1D/u1f0pwe gX3GKbTh+m31YQ5+QbFldidz4p8thrs= X-MC-Unique: uz0S8PTQNW-X9zRGS3GigQ-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 13/18] ui/egl: print EGL error, helping debugging Date: Tue, 7 Mar 2023 15:56:32 +0400 Message-Id: <20230307115637.2464377-14-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.6 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.133.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: 1678190342732100001 From: Marc-Andr=C3=A9 Lureau Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- ui/egl-helpers.c | 54 ++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 48 insertions(+), 6 deletions(-) diff --git a/ui/egl-helpers.c b/ui/egl-helpers.c index 3a88245b67..10772b6471 100644 --- a/ui/egl-helpers.c +++ b/ui/egl-helpers.c @@ -26,6 +26,48 @@ DisplayGLMode qemu_egl_mode; =20 /* ------------------------------------------------------------------ */ =20 +#if defined(CONFIG_X11) || defined(CONFIG_GBM) +static const char *egl_get_error_string(void) +{ + EGLint error =3D eglGetError(); + + switch (error) { + case EGL_SUCCESS: + return "EGL_SUCCESS"; + case EGL_NOT_INITIALIZED: + return "EGL_NOT_INITIALIZED"; + case EGL_BAD_ACCESS: + return "EGL_BAD_ACCESS"; + case EGL_BAD_ALLOC: + return "EGL_BAD_ALLOC"; + case EGL_BAD_ATTRIBUTE: + return "EGL_BAD_ATTRIBUTE"; + case EGL_BAD_CONTEXT: + return "EGL_BAD_CONTEXT"; + case EGL_BAD_CONFIG: + return "EGL_BAD_CONFIG"; + case EGL_BAD_CURRENT_SURFACE: + return "EGL_BAD_CURRENT_SURFACE"; + case EGL_BAD_DISPLAY: + return "EGL_BAD_DISPLAY"; + case EGL_BAD_SURFACE: + return "EGL_BAD_SURFACE"; + case EGL_BAD_MATCH: + return "EGL_BAD_MATCH"; + case EGL_BAD_PARAMETER: + return "EGL_BAD_PARAMETER"; + case EGL_BAD_NATIVE_PIXMAP: + return "EGL_BAD_NATIVE_PIXMAP"; + case EGL_BAD_NATIVE_WINDOW: + return "EGL_BAD_NATIVE_WINDOW"; + case EGL_CONTEXT_LOST: + return "EGL_CONTEXT_LOST"; + default: + return "Unknown EGL error"; + } +} +#endif + static void egl_fb_delete_texture(egl_fb *fb) { if (!fb->delete_texture) { @@ -438,20 +480,20 @@ static int qemu_egl_init_dpy(EGLNativeDisplayType dpy, =20 qemu_egl_display =3D qemu_egl_get_display(dpy, platform); if (qemu_egl_display =3D=3D EGL_NO_DISPLAY) { - error_report("egl: eglGetDisplay failed"); + error_report("egl: eglGetDisplay failed: %s", egl_get_error_string= ()); return -1; } =20 b =3D eglInitialize(qemu_egl_display, &major, &minor); if (b =3D=3D EGL_FALSE) { - error_report("egl: eglInitialize failed"); + error_report("egl: eglInitialize failed: %s", egl_get_error_string= ()); return -1; } =20 b =3D eglBindAPI(gles ? EGL_OPENGL_ES_API : EGL_OPENGL_API); if (b =3D=3D EGL_FALSE) { - error_report("egl: eglBindAPI failed (%s mode)", - gles ? "gles" : "core"); + error_report("egl: eglBindAPI failed (%s mode): %s", + gles ? "gles" : "core", egl_get_error_string()); return -1; } =20 @@ -459,8 +501,8 @@ static int qemu_egl_init_dpy(EGLNativeDisplayType dpy, gles ? conf_att_gles : conf_att_core, &qemu_egl_config, 1, &n); if (b =3D=3D EGL_FALSE || n !=3D 1) { - error_report("egl: eglChooseConfig failed (%s mode)", - gles ? "gles" : "core"); + error_report("egl: eglChooseConfig failed (%s mode): %s", + gles ? "gles" : "core", egl_get_error_string()); return -1; } =20 --=20 2.39.2 From nobody Mon May 6 03:55:54 2024 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=1678190325; cv=none; d=zohomail.com; s=zohoarc; b=VSzWHYUvuFYtkAp1t+yz6pD1MyX5AkeWu4U10nZo1OP75q7onlflD9Bal/Uk8k35o/pWO5ETfwmMOGW9WbyyX9Cp++bjbPG35veYoot6/uf/VpdR2YPo+qZ5IZPHnU/otMkwvM3tSmA9GappJ1N/77me0Yqb5td0AFC8W9xdN5M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1678190325; 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=68pvYe/0fh7+ksxqpXN2pdkgide/UfgXPlMTgTXTWvY=; b=FiDtyF6537SuPV5dmKUhcVTl//xsmUxZnd96tEIm9CAo+4Q8BNZ4E1E6ZSW6Q5HQh4vqP0D2s30svhUdEHXNSFt359bMj9Pp4MZhzSouJcKhAaCL7XXrTY+R0RFs25HUry54x2mfyuFEJlImWsXzBCWYk+NheLCl/VYJsFlCbGw= 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 1678190325171436.58895978374903; Tue, 7 Mar 2023 03:58:45 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pZVx0-0004RR-5A; Tue, 07 Mar 2023 06:57:50 -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 1pZVwx-00049d-Uc for qemu-devel@nongnu.org; Tue, 07 Mar 2023 06:57:47 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pZVww-000386-D8 for qemu-devel@nongnu.org; Tue, 07 Mar 2023 06:57:47 -0500 Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-288-Wyh7NAucMX2Kw4U79PJLqQ-1; Tue, 07 Mar 2023 06:57:44 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 757583823A03; Tue, 7 Mar 2023 11:57:44 +0000 (UTC) Received: from localhost (unknown [10.39.208.40]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5B8C82166B26; Tue, 7 Mar 2023 11:57:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1678190265; 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=68pvYe/0fh7+ksxqpXN2pdkgide/UfgXPlMTgTXTWvY=; b=LQhT8dhwFAFJ3KMI4n2yd+ALMCPGPghLbqf9aFpBgAS2x9832Lue3Fg71xjoI/1B93/36N y5Os68MG08pw/3gU0+G/UGenJrW/4NhX2IWbyOe9fFlG+WlHt0erxZzYVxFdEH4E4/OTh6 bYNVYfthV/l3ysZOvO8gnLneUJNpdo4= X-MC-Unique: Wyh7NAucMX2Kw4U79PJLqQ-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 14/18] ui/sdl: add optional logging when _SDL_DEBUG is set Date: Tue, 7 Mar 2023 15:56:33 +0400 Message-Id: <20230307115637.2464377-15-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.6 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.133.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: 1678190326694100007 From: Marc-Andr=C3=A9 Lureau Apparently, there is no environment variable you can set for libsdl to enable logging. (similar to _VNC_DEBUG) Signed-off-by: Marc-Andr=C3=A9 Lureau --- include/ui/sdl2.h | 2 ++ ui/sdl2.c | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/include/ui/sdl2.h b/include/ui/sdl2.h index 8fb7e08262..6fea36db82 100644 --- a/include/ui/sdl2.h +++ b/include/ui/sdl2.h @@ -6,6 +6,8 @@ =20 #include =20 +/* #define _SDL_DEBUG 1 */ + /* with Alpine / muslc SDL headers pull in directfb headers * which in turn trigger warning about redundant decls for * direct_waitqueue_deinit. diff --git a/ui/sdl2.c b/ui/sdl2.c index f259e4c4d1..592eca3e1c 100644 --- a/ui/sdl2.c +++ b/ui/sdl2.c @@ -841,6 +841,10 @@ static void sdl2_display_init(DisplayState *ds, Displa= yOptions *o) } #endif =20 +#ifdef _SDL_DEBUG + SDL_LogSetAllPriority(SDL_LOG_PRIORITY_VERBOSE); +#endif + if (SDL_Init(SDL_INIT_VIDEO)) { fprintf(stderr, "Could not initialize SDL(%s) - exiting\n", SDL_GetError()); --=20 2.39.2 From nobody Mon May 6 03:55:54 2024 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=1678190367; cv=none; d=zohomail.com; s=zohoarc; b=TXO9NP+SxPEs6oIpF6Htre7hBPoz+JHDPnowhj7a0WIxUdxCT2tMh8P5lC/CGcgnR+3HdAsaMeWUzYltrrt0W0BPLHHjSLFNpJhhP6GPROIXJODt73xTsA/GiA8CSDpCIPrhcqhX6g6f6A0lKsRido+GW3+MsY3uOCTw/SBLtD8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1678190367; 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=0RJQY43s2GclWYOsh3Cy5FP1kKhEpDMEydGU9O04K9g=; b=h04HCmp7d40elYrXLddeC3KmnxVrKrP71ibNSKoZzmRtEcjiKV3JVM+u/2HoMxo+rwyiSmH88HG0Ajm+xitgs0vYHmeKGTFUDbRHDWWWu1qyFNmQlZk9VS6TlUwZC3yjQJuIY1A1rIlN9Kb8d4Fbo5gEY0NXw98GEZ7jCNZ6uug= 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 1678190367394658.2911514989153; Tue, 7 Mar 2023 03:59:27 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pZVx6-00057f-Cf; Tue, 07 Mar 2023 06:57:56 -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 1pZVx4-0004xT-CF for qemu-devel@nongnu.org; Tue, 07 Mar 2023 06:57:54 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pZVx3-00038z-1p for qemu-devel@nongnu.org; Tue, 07 Mar 2023 06:57:54 -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-624-WYKWQ7SyPrCtCbZXkZHG6w-1; Tue, 07 Mar 2023 06:57:49 -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 0786B85A588; Tue, 7 Mar 2023 11:57:49 +0000 (UTC) Received: from localhost (unknown [10.39.208.40]) by smtp.corp.redhat.com (Postfix) with ESMTP id 09D05492C14; Tue, 7 Mar 2023 11:57:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1678190272; 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=0RJQY43s2GclWYOsh3Cy5FP1kKhEpDMEydGU9O04K9g=; b=At43oeFkS2OFrQy1s/iHWdRgobemu9le/KSd/iRZTVlNgkJhvfFb0SauhVPToPdzMZnjos cbnUzwoJ4mb+Jjv+xAonEsgyq2FIjku7mDQlL0zZz1E1VY+C+wJsjvB6iZIMmZpqiQ5saz 6+ih7vv+3/CaX6Yf5BEa4s/HjrIGKss= X-MC-Unique: WYKWQ7SyPrCtCbZXkZHG6w-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 15/18] ui/sdl: try to instantiate the matching opengl renderer Date: Tue, 7 Mar 2023 15:56:34 +0400 Message-Id: <20230307115637.2464377-16-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.133.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: 1678190368862100003 From: Marc-Andr=C3=A9 Lureau User can still bypass the QEMU choice with SDL_RENDER_DRIVER environment variable. (for some reason, specifying a driver disables batching and breaks rendering, so enable it explicitly) Signed-off-by: Marc-Andr=C3=A9 Lureau --- ui/sdl2.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/ui/sdl2.c b/ui/sdl2.c index 592eca3e1c..e83ea53628 100644 --- a/ui/sdl2.c +++ b/ui/sdl2.c @@ -99,7 +99,18 @@ void sdl2_window_create(struct sdl2_console *scon) surface_width(scon->surface), surface_height(scon->surface), flags); + if (scon->opengl) { + const char *driver =3D "opengl"; + + if (scon->opts->gl =3D=3D DISPLAYGL_MODE_ES) { + driver =3D "opengles2"; + } + + SDL_SetHint(SDL_HINT_RENDER_DRIVER, driver); + SDL_SetHint(SDL_HINT_RENDER_BATCHING, "1"); + } scon->real_renderer =3D SDL_CreateRenderer(scon->real_window, -1, 0); + if (scon->opengl) { scon->winctx =3D SDL_GL_CreateContext(scon->real_window); } --=20 2.39.2 From nobody Mon May 6 03:55:55 2024 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=1678190311; cv=none; d=zohomail.com; s=zohoarc; b=OHo7FYEXisCI2gveQaoyaQyT3vl+SziyZUNDHfWrgvidVMkfvXKLhS5cM2pqS8+0bnavNNFoPibnq+LCPyt/kFjEOExlCEHg5XDRXyAsirCC+g49uj1xS8+F+lo4W32bRovdb9H/10ZeACmx8tZxb739nH34kB3Jyn3LbCnlWCs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1678190311; 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=gz2gPLG/RouFtIjBTzYDNnr40PwbLaGeE0foRR2kE94=; b=WdOEbQH8gWfhAc5o+BmFZCnRttvwKZoOKdv693S1l9D+Vck6/PAT8kmdsYibFDYaTg3UfZdHIfziFE77+SH2JZWqMX2KHWqr0am8H0rZSL6KvrudPNHZ9bG54GF1Y3j71wVvxem7gvEbOsM21tCpUF0VJFMLI9oEBbsBKZNDd0M= 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 1678190311228968.3560305741004; Tue, 7 Mar 2023 03:58:31 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pZVx9-0005Bm-6E; Tue, 07 Mar 2023 06:57:59 -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 1pZVx7-0005BD-Re for qemu-devel@nongnu.org; Tue, 07 Mar 2023 06:57:57 -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 1pZVx6-00039F-9G for qemu-devel@nongnu.org; Tue, 07 Mar 2023 06:57:57 -0500 Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-139-0NAR3etCNtexxeGVWrBeKA-1; Tue, 07 Mar 2023 06:57:54 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id C35F13C1485E; Tue, 7 Mar 2023 11:57:53 +0000 (UTC) Received: from localhost (unknown [10.39.208.40]) by smtp.corp.redhat.com (Postfix) with ESMTP id BB4E2C15BA0; Tue, 7 Mar 2023 11:57:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1678190275; 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=gz2gPLG/RouFtIjBTzYDNnr40PwbLaGeE0foRR2kE94=; b=iQA+cjAvVj5U/CIYfvAv4wK9rVqgwmCaudH4hSg0wk92gMr6eYreer8Cfr0V5olGclWXAz /r9lv/0kZAiRqS0krXI7yE7OCiEkal2TYrl0uANDBs7GfCH0PvaCxXC/UEXDFmHjqXnPmh yK2efiM9UFMnCMGUH8xl/7d8XJEAzCE= X-MC-Unique: 0NAR3etCNtexxeGVWrBeKA-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 16/18] ui: introduce egl_init() Date: Tue, 7 Mar 2023 15:56:35 +0400 Message-Id: <20230307115637.2464377-17-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.8 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: 1678190312513100007 From: Marc-Andr=C3=A9 Lureau Future patches will introduce EGL support on win32 (too late for 8.0 though). Having a common place for EGL initialization and error handling will make it simpler. Signed-off-by: Marc-Andr=C3=A9 Lureau --- include/ui/egl-helpers.h | 2 ++ ui/dbus.c | 7 +------ ui/egl-headless.c | 16 ++++++++-------- ui/egl-helpers.c | 25 +++++++++++++++++++++++++ ui/spice-core.c | 7 +------ 5 files changed, 37 insertions(+), 20 deletions(-) diff --git a/include/ui/egl-helpers.h b/include/ui/egl-helpers.h index c92dd90e33..53d953ddf4 100644 --- a/include/ui/egl-helpers.h +++ b/include/ui/egl-helpers.h @@ -65,4 +65,6 @@ int qemu_egl_init_dpy_mesa(EGLNativeDisplayType dpy, Disp= layGLMode mode); EGLContext qemu_egl_init_ctx(void); bool qemu_egl_has_dmabuf(void); =20 +bool egl_init(const char *rendernode, DisplayGLMode mode, Error **errp); + #endif /* EGL_HELPERS_H */ diff --git a/ui/dbus.c b/ui/dbus.c index f529928f0b..ebf03bd84d 100644 --- a/ui/dbus.c +++ b/ui/dbus.c @@ -451,12 +451,7 @@ early_dbus_init(DisplayOptions *opts) DisplayGLMode mode =3D opts->has_gl ? opts->gl : DISPLAYGL_MODE_OFF; =20 if (mode !=3D DISPLAYGL_MODE_OFF) { - if (egl_rendernode_init(opts->u.dbus.rendernode, mode) < 0) { - error_report("dbus: render node init failed"); - exit(1); - } - - display_opengl =3D 1; + egl_init(opts->u.dbus.rendernode, mode, &error_fatal); } =20 type_register(&dbus_vc_type_info); diff --git a/ui/egl-headless.c b/ui/egl-headless.c index ae07e91302..ef70e6a18e 100644 --- a/ui/egl-headless.c +++ b/ui/egl-headless.c @@ -1,7 +1,7 @@ #include "qemu/osdep.h" #include "qemu/error-report.h" #include "qemu/module.h" -#include "sysemu/sysemu.h" +#include "qapi/error.h" #include "ui/console.h" #include "ui/egl-helpers.h" #include "ui/egl-context.h" @@ -191,21 +191,21 @@ static const DisplayGLCtxOps eglctx_ops =3D { =20 static void early_egl_headless_init(DisplayOptions *opts) { - display_opengl =3D 1; + DisplayGLMode mode =3D DISPLAYGL_MODE_ON; + + if (opts->has_gl) { + mode =3D opts->gl; + } + + egl_init(opts->u.egl_headless.rendernode, mode, &error_fatal); } =20 static void egl_headless_init(DisplayState *ds, DisplayOptions *opts) { - DisplayGLMode mode =3D opts->has_gl ? opts->gl : DISPLAYGL_MODE_ON; QemuConsole *con; egl_dpy *edpy; int idx; =20 - if (egl_rendernode_init(opts->u.egl_headless.rendernode, mode) < 0) { - error_report("egl: render node init failed"); - exit(1); - } - for (idx =3D 0;; idx++) { DisplayGLCtx *ctx; =20 diff --git a/ui/egl-helpers.c b/ui/egl-helpers.c index 10772b6471..36b4fc51d9 100644 --- a/ui/egl-helpers.c +++ b/ui/egl-helpers.c @@ -19,6 +19,8 @@ #include "qemu/error-report.h" #include "ui/console.h" #include "ui/egl-helpers.h" +#include "sysemu/sysemu.h" +#include "qapi/error.h" =20 EGLDisplay *qemu_egl_display; EGLConfig qemu_egl_config; @@ -569,3 +571,26 @@ EGLContext qemu_egl_init_ctx(void) =20 return ectx; } + +bool egl_init(const char *rendernode, DisplayGLMode mode, Error **errp) +{ + ERRP_GUARD(); + + if (mode =3D=3D DISPLAYGL_MODE_OFF) { + error_setg(errp, "egl: turning off GL doesn't make sense"); + return false; + } + +#ifdef CONFIG_GBM + if (egl_rendernode_init(rendernode, mode) < 0) { + error_setg(errp, "egl: render node init failed"); + return false; + } +#else + error_setg(errp, "egl: not available on this platform"); + return false; +#endif + + display_opengl =3D 1; + return true; +} diff --git a/ui/spice-core.c b/ui/spice-core.c index 76f7c2bc3d..b05c830086 100644 --- a/ui/spice-core.c +++ b/ui/spice-core.c @@ -820,12 +820,7 @@ static void qemu_spice_init(void) "incompatible with -spice port/tls-port"); exit(1); } - if (egl_rendernode_init(qemu_opt_get(opts, "rendernode"), - DISPLAYGL_MODE_ON) !=3D 0) { - error_report("Failed to initialize EGL render node for SPICE G= L"); - exit(1); - } - display_opengl =3D 1; + egl_init(qemu_opt_get(opts, "rendernode"), DISPLAYGL_MODE_ON, &err= or_fatal); spice_opengl =3D 1; } #endif --=20 2.39.2 From nobody Mon May 6 03:55:55 2024 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=1678190375; cv=none; d=zohomail.com; s=zohoarc; b=CayVYdV+GJKcPAKFqSJXl4yMMEqAPYYCJiuwJIWBEGmIcndYZPW9f6NyYY5AfXwPUtdbZds7SAaGk6rAAe/mUslC2A5TvaMMyEruYL5dcqp7Qz1YgvcKN3e5DY4xPm6UDcZhiWqR4UmP2HliqleQBOT8xVJEyHt+GtsHFEzO57s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1678190375; 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=s0c2Oiu9qlE1v0FMPBlTtDxtvjbmQE+HGiKmS8Aj5zU=; b=CE2oMDSNPD/OXO83Fg9WOh1ORFoxDZyJqKnbU0FVaETi8tDBN8/92sSvvS8jquKdUKZ4iZbmevLY+nY+ZOS33YvkV4QCUSzyZACLASUEMBjeiBG/UBDac1oc5f8LvUUPiXtnkxnxkgPpCDNNeVFrNTMxFrZLIiYgNPDZWxe94V8= 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 1678190375439638.4664665214892; Tue, 7 Mar 2023 03:59:35 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pZVxD-0005EL-GB; Tue, 07 Mar 2023 06:58:03 -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 1pZVxC-0005CY-LH for qemu-devel@nongnu.org; Tue, 07 Mar 2023 06:58:02 -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 1pZVxA-00039d-OB for qemu-devel@nongnu.org; Tue, 07 Mar 2023 06:58:02 -0500 Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-473-zQsNdG2zPJGjBwu_d2Ajgw-1; Tue, 07 Mar 2023 06:57:59 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 979CA3C14844; Tue, 7 Mar 2023 11:57:58 +0000 (UTC) Received: from localhost (unknown [10.39.208.40]) by smtp.corp.redhat.com (Postfix) with ESMTP id 432C640C10FA; Tue, 7 Mar 2023 11:57:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1678190280; 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=s0c2Oiu9qlE1v0FMPBlTtDxtvjbmQE+HGiKmS8Aj5zU=; b=AkeviEEyZPPchSCnd3EdZGhPtMyIUoGXopIVYwBpCkf1f5IFKctNFqYBWPjl60JdM3OsgD Q+pgX60WNOJr09xXlxvx71pEVfB41Wxd7NK5nQ+4P0C9A0EPHuz6dG50CaC8SCNgmEd99Y wNO3XnpPvgDcqQD9t3wxc/5d2+lK3Rk= X-MC-Unique: zQsNdG2zPJGjBwu_d2Ajgw-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 17/18] ui/dbus: do not require opengl & gbm Date: Tue, 7 Mar 2023 15:56:36 +0400 Message-Id: <20230307115637.2464377-18-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.2 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: 1678190377055100003 From: Marc-Andr=C3=A9 Lureau Allow to build & use the DBus display without 3d/GPU acceleration support. Signed-off-by: Marc-Andr=C3=A9 Lureau --- meson.build | 2 -- ui/dbus-listener.c | 15 +++++++++++++-- ui/dbus.c | 8 ++++++++ tests/qtest/meson.build | 2 +- ui/meson.build | 4 ++-- 5 files changed, 24 insertions(+), 7 deletions(-) diff --git a/meson.build b/meson.build index 6bcab8bf0d..a73d050946 100644 --- a/meson.build +++ b/meson.build @@ -1746,8 +1746,6 @@ dbus_display =3D get_option('dbus_display') \ error_message: '-display dbus requires glib>=3D2.64') \ .require(gdbus_codegen.found(), error_message: gdbus_codegen_error.format('-display dbus')) \ - .require(opengl.found() and gbm.found(), - error_message: '-display dbus requires epoxy/egl and gbm') \ .allowed() =20 have_virtfs =3D get_option('virtfs') \ diff --git a/ui/dbus-listener.c b/ui/dbus-listener.c index 2e87ed7e9a..85692f1b27 100644 --- a/ui/dbus-listener.c +++ b/ui/dbus-listener.c @@ -27,9 +27,11 @@ #include "dbus.h" #include =20 +#ifdef CONFIG_OPENGL #include "ui/shader.h" #include "ui/egl-helpers.h" #include "ui/egl-context.h" +#endif #include "trace.h" =20 struct _DBusDisplayListener { @@ -48,6 +50,7 @@ struct _DBusDisplayListener { =20 G_DEFINE_TYPE(DBusDisplayListener, dbus_display_listener, G_TYPE_OBJECT) =20 +#ifdef CONFIG_OPENGL static void dbus_update_gl_cb(GObject *source_object, GAsyncResult *res, gpointer user_data) @@ -229,12 +232,14 @@ static void dbus_gl_refresh(DisplayChangeListener *dc= l) ddl->gl_updates =3D 0; } } +#endif =20 static void dbus_refresh(DisplayChangeListener *dcl) { graphic_hw_update(dcl->con); } =20 +#ifdef CONFIG_OPENGL static void dbus_gl_gfx_update(DisplayChangeListener *dcl, int x, int y, int w, int h) { @@ -242,6 +247,7 @@ static void dbus_gl_gfx_update(DisplayChangeListener *d= cl, =20 ddl->gl_updates++; } +#endif =20 static void dbus_gfx_update(DisplayChangeListener *dcl, int x, int y, int w, int h) @@ -296,6 +302,7 @@ static void dbus_gfx_update(DisplayChangeListener *dcl, DBUS_DEFAULT_TIMEOUT, NULL, NULL, NULL); } =20 +#ifdef CONFIG_OPENGL static void dbus_gl_gfx_switch(DisplayChangeListener *dcl, struct DisplaySurface *new_surface) { @@ -311,6 +318,7 @@ static void dbus_gl_gfx_switch(DisplayChangeListener *d= cl, width, height, 0, 0, width, height); } } +#endif =20 static void dbus_gfx_switch(DisplayChangeListener *dcl, struct DisplaySurface *new_surface) @@ -361,6 +369,7 @@ static void dbus_cursor_define(DisplayChangeListener *d= cl, NULL); } =20 +#ifdef CONFIG_OPENGL const DisplayChangeListenerOps dbus_gl_dcl_ops =3D { .dpy_name =3D "dbus-gl", .dpy_gfx_update =3D dbus_gl_gfx_update, @@ -378,6 +387,7 @@ const DisplayChangeListenerOps dbus_gl_dcl_ops =3D { .dpy_gl_release_dmabuf =3D dbus_release_dmabuf, .dpy_gl_update =3D dbus_scanout_update, }; +#endif =20 const DisplayChangeListenerOps dbus_dcl_ops =3D { .dpy_name =3D "dbus", @@ -406,11 +416,12 @@ dbus_display_listener_constructed(GObject *object) { DBusDisplayListener *ddl =3D DBUS_DISPLAY_LISTENER(object); =20 + ddl->dcl.ops =3D &dbus_dcl_ops; +#ifdef CONFIG_OPENGL if (display_opengl) { ddl->dcl.ops =3D &dbus_gl_dcl_ops; - } else { - ddl->dcl.ops =3D &dbus_dcl_ops; } +#endif =20 G_OBJECT_CLASS(dbus_display_listener_parent_class)->constructed(object= ); } diff --git a/ui/dbus.c b/ui/dbus.c index ebf03bd84d..904f5a0a6d 100644 --- a/ui/dbus.c +++ b/ui/dbus.c @@ -30,8 +30,10 @@ #include "qom/object_interfaces.h" #include "sysemu/sysemu.h" #include "ui/dbus-module.h" +#ifdef CONFIG_OPENGL #include "ui/egl-helpers.h" #include "ui/egl-context.h" +#endif #include "audio/audio.h" #include "audio/audio_int.h" #include "qapi/error.h" @@ -41,6 +43,7 @@ =20 static DBusDisplay *dbus_display; =20 +#ifdef CONFIG_OPENGL static QEMUGLContext dbus_create_context(DisplayGLCtx *dgc, QEMUGLParams *params) { @@ -84,6 +87,7 @@ static const DisplayGLCtxOps dbus_gl_ops =3D { .dpy_gl_ctx_destroy_texture =3D dbus_destroy_texture, .dpy_gl_ctx_update_texture =3D dbus_update_texture, }; +#endif =20 static NotifierList dbus_display_notifiers =3D NOTIFIER_LIST_INITIALIZER(dbus_display_notifiers); @@ -112,10 +116,12 @@ dbus_display_init(Object *o) DBusDisplay *dd =3D DBUS_DISPLAY(o); g_autoptr(GDBusObjectSkeleton) vm =3D NULL; =20 +#ifdef CONFIG_OPENGL dd->glctx.ops =3D &dbus_gl_ops; if (display_opengl) { dd->glctx.gls =3D qemu_gl_init_shader(); } +#endif dd->iface =3D qemu_dbus_display1_vm_skeleton_new(); dd->consoles =3D g_ptr_array_new_with_free_func(g_object_unref); =20 @@ -152,7 +158,9 @@ dbus_display_finalize(Object *o) g_clear_object(&dd->iface); g_free(dd->dbus_addr); g_free(dd->audiodev); +#ifdef CONFIG_OPENGL g_clear_pointer(&dd->glctx.gls, qemu_gl_fini_shader); +#endif dbus_display =3D NULL; } =20 diff --git a/tests/qtest/meson.build b/tests/qtest/meson.build index 29a4efb4c2..f23a4aaa24 100644 --- a/tests/qtest/meson.build +++ b/tests/qtest/meson.build @@ -101,7 +101,7 @@ qtests_i386 =3D \ 'numa-test' ] =20 -if dbus_display +if dbus_display and targetos !=3D 'windows' qtests_i386 +=3D ['dbus-display-test'] endif =20 diff --git a/ui/meson.build b/ui/meson.build index 0b2d0d21d1..330369707d 100644 --- a/ui/meson.build +++ b/ui/meson.build @@ -85,7 +85,7 @@ if dbus_display '--generate-c-code', '@BASENAME@= ']) dbus_display1_lib =3D static_library('dbus-display1', dbus_display1, dep= endencies: gio) dbus_display1_dep =3D declare_dependency(link_with: dbus_display1_lib, i= nclude_directories: include_directories('.')) - dbus_ss.add(when: [gio, pixman, opengl, gbm, dbus_display1_dep], + dbus_ss.add(when: [gio, pixman, dbus_display1_dep], if_true: [files( 'dbus-chardev.c', 'dbus-clipboard.c', @@ -93,7 +93,7 @@ if dbus_display 'dbus-error.c', 'dbus-listener.c', 'dbus.c', - )]) + ), opengl, gbm]) ui_modules +=3D {'dbus' : dbus_ss} endif =20 --=20 2.39.2 From nobody Mon May 6 03:55:55 2024 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