From nobody Thu May 2 23:55:35 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=1678702431; cv=none; d=zohomail.com; s=zohoarc; b=k4p/ECP3ThVrVFMLp20PLxDFys+UMskQbL+OhBRZWTsrNcMWypXhVEn0fTXiID73V+H36wPp+goeHWDOPD/N1+deHbTyA6qVyh4XjgrOeZNkQZ0DqpAmxpdMIXs+0rPMBrCo2nO4gD/WiXio4WVSxl7KOmHFUUUwsFP1pu8z+tM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1678702431; 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=BA7l9vQBtACbjO/vvnkw6BUsXZXvz6oIDcAMztMFRnw=; b=jqKAKgSrP4gPGadfG7ZuVs9u+5rjpYfEIiQ5gnMuHuqSb8yK2LHujaKbpZfZobt0Rwu2601fhYDcA4WRVGCmtHsZ/pgOMFGpqZeb6f+dghQOyBFiSOjYm1eDhVG8debxbWMHEyT0+vYfREmem9eXKKxlr50Q7uhHxILReIPz8QQ= 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 1678702431260215.35265484566764; Mon, 13 Mar 2023 03:13:51 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pbfAL-0002O9-Cz; Mon, 13 Mar 2023 06:12:29 -0400 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 1pbfAJ-0002ND-Kd for qemu-devel@nongnu.org; Mon, 13 Mar 2023 06:12:27 -0400 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 1pbfAI-0004BD-85 for qemu-devel@nongnu.org; Mon, 13 Mar 2023 06:12:27 -0400 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-227-4OYUsQ1lMfmMg-iPT8xPWA-1; Mon, 13 Mar 2023 06:12:16 -0400 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 0912285A5B1; Mon, 13 Mar 2023 10:12:16 +0000 (UTC) Received: from localhost (unknown [10.39.208.8]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0092740C6E67; Mon, 13 Mar 2023 10:12:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1678702345; 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=BA7l9vQBtACbjO/vvnkw6BUsXZXvz6oIDcAMztMFRnw=; b=g2CbwO9SMWT/BPK9iroBoXUgnBT0nd/z4UURFPExHgQnWSQbwDv1/W3zEPJsdBLGXTCUM7 SB/XUGQedYxGOght3yABkEhVIpxdzOc/kcnvvzjB9NtKbA0uFyY1xR2pXhZc0MXeLu/S2x 7rjTUXaMVIRV0akSUxXt+xerPCyD2Jc= X-MC-Unique: 4OYUsQ1lMfmMg-iPT8xPWA-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: Gerd Hoffmann , Paolo Bonzini , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Laurent Vivier , Thomas Huth Subject: [PATCH v3 01/18] ui/dbus: initialize cursor_fb Date: Mon, 13 Mar 2023 14:11:50 +0400 Message-Id: <20230313101207.375125-2-marcandre.lureau@redhat.com> In-Reply-To: <20230313101207.375125-1-marcandre.lureau@redhat.com> References: <20230313101207.375125-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: 1678702431617100003 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 Thu May 2 23:55:35 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=1678702353; cv=none; d=zohomail.com; s=zohoarc; b=UQsbnf/ZfKPakukpA1WIt6+4BnBBlP0uTf7f6B0Gzs9Ah+s3IsGplHOH4HrmQ4O0LX8ntNg56KOUX/wkWlUGKwDCgcZu9qXrb7GGZ2nY/RJRvDKtsWNCHAAL+3UzrgP2AlKZ+pomQpP07f+d7GnzLoAPDPmNzgj+hCXYM2azxm0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1678702353; 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=4NNc/52APlEVsUfrxs3RhBrzY/pv7Yq9X27evoA0Gi4=; b=GllekIqjtV2vSiVhDA+5zKK4FMy2JwLXQiWT975PkgHF030fNeHM1j/GY/wZZpYQkfzWCa50NWkdh1GGLcWRFodPxeMpt5kMaqCUKbRjMDncFl+Cr4fGne0/Cr5FKYjBMlUfTu6PCeWJ9hFSlvpD4CUvUb/CNBVWKkR+Rs6sojM= 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 1678702353050220.63021456335025; Mon, 13 Mar 2023 03:12:33 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pbfAI-0002N4-Rh; Mon, 13 Mar 2023 06:12:26 -0400 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 1pbfAI-0002Mv-1u for qemu-devel@nongnu.org; Mon, 13 Mar 2023 06:12:26 -0400 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 1pbfAG-0004B6-Jy for qemu-devel@nongnu.org; Mon, 13 Mar 2023 06:12:25 -0400 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-12-XwMxm84gOHm5FpskCYs3dg-1; Mon, 13 Mar 2023 06:12:20 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 3783B800B23; Mon, 13 Mar 2023 10:12:20 +0000 (UTC) Received: from localhost (unknown [10.39.208.8]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5E810202701E; Mon, 13 Mar 2023 10:12:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1678702343; 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=4NNc/52APlEVsUfrxs3RhBrzY/pv7Yq9X27evoA0Gi4=; b=JLjeek+MPBoyAzoRN91ZW8VIBdjuyQ8niHY8NejmvCi+OXU2KrDclHWnJIREZBsrpwob2T 1dDypmUVTzmOOva902bblnT9O4052wr/tZslly2Nam5IEXoKSmNRLxoJDj1vR208Li86ZF XjAAAJ8rQfreL11srY3ciT+71+HJzOk= X-MC-Unique: XwMxm84gOHm5FpskCYs3dg-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: Gerd Hoffmann , Paolo Bonzini , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Laurent Vivier , Thomas Huth Subject: [PATCH v3 02/18] ui/dbus: unregister clipboard on connection close Date: Mon, 13 Mar 2023 14:11:51 +0400 Message-Id: <20230313101207.375125-3-marcandre.lureau@redhat.com> In-Reply-To: <20230313101207.375125-1-marcandre.lureau@redhat.com> References: <20230313101207.375125-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.4 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: 1678702355386100001 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 Thu May 2 23:55:35 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=1678702491; cv=none; d=zohomail.com; s=zohoarc; b=Xi/tXamOQkUYWtjoMUN+PBiO1/kfHDgeArdJzG2Z3BmmBvMnkoShYJcsVQxI9SfyfmqfB6m3UgHrEbnYUcCA4bDDLXlB41jkVkwDlATPJw+KJ8WARXV7y01tz8YvyC/S3gOO8qRkeThs0uFxGXUti0M9diiYekzEIhrJj+/7zQk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1678702491; 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=O4igNrjk9KD9RDMi1RSLZacQpI7Uofe/DCpbxepvU14=; b=n59IaQH5pGOV9yB0zNFK88iV9m+lCVWfcIiHImuJZLQjPftHKuEuoErvfHux351wvWG31iMSgqw/ODjR5jr1Gwi5nouk4HRToeuzXMtDzlHaur4m344bXEIg0fWu0BvhMzRbTqvNyUBsfOItBahmstg9JNfvloXWRpuSWu/FoiY= 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 1678702491731384.38112436684753; Mon, 13 Mar 2023 03:14:51 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pbfAN-0002OO-W5; Mon, 13 Mar 2023 06:12:32 -0400 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 1pbfAM-0002OB-OA for qemu-devel@nongnu.org; Mon, 13 Mar 2023 06:12:30 -0400 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 1pbfAL-0004Bh-3j for qemu-devel@nongnu.org; Mon, 13 Mar 2023 06:12:30 -0400 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-169-9SFT5_G1MIm33FwC-sdRwQ-1; Mon, 13 Mar 2023 06:12:24 -0400 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 7538685A5B1; Mon, 13 Mar 2023 10:12:24 +0000 (UTC) Received: from localhost (unknown [10.39.208.8]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9AA07C090DC; Mon, 13 Mar 2023 10:12:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1678702348; 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=O4igNrjk9KD9RDMi1RSLZacQpI7Uofe/DCpbxepvU14=; b=N7xMn/9SfZgFwz3zqqKwc36aUZQD4qyOXofgf0LAbCXifpWhxHmuFhLfABOVnB5hafnIbv OJRilO7AEhPHnqqQm3LgCtcLNttNijoIUJ7ZTTfPDcsn7mthAN+t3S+cqhIl2dPjvz4wm5 sUAbHP205nJkQfcTrc6yGG5T8TMGHws= X-MC-Unique: 9SFT5_G1MIm33FwC-sdRwQ-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: Gerd Hoffmann , Paolo Bonzini , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Laurent Vivier , Thomas Huth Subject: [PATCH v3 03/18] audio/dbus: there are no sender for p2p mode Date: Mon, 13 Mar 2023 14:11:52 +0400 Message-Id: <20230313101207.375125-4-marcandre.lureau@redhat.com> In-Reply-To: <20230313101207.375125-1-marcandre.lureau@redhat.com> References: <20230313101207.375125-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: 1678702494141100004 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 | 7 +++++-- ui/dbus.c | 2 +- 3 files changed, 7 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..fece74f78c 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,8 @@ 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 +593,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 +601,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 Thu May 2 23:55:35 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=1678702484; cv=none; d=zohomail.com; s=zohoarc; b=awEglFyYzc1i1MTQMMxWB5ftQrsJai4CMM/wEG4vMdjDvtnAeVGsizJSb7Mto/kIeEH8B9+fFSl6H1B7dF4qBraUzbELqbFLUiDMB5Q2orhbfGVCT7DFsnCB0X1wQkhlxRg6ySQuVqWd9MGcSwEi9cgQX9JAZz6Poik+NfK3mYY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1678702484; 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=Um3n+CTQRxL3PnrARU7ObOzyxLsrZaGrEUDVOetGQuo=; b=ZI2ZlYHL8PPhcSJQFEp5u86mCxza9h+sj6NM8aIMbMZe5LSvXf0pAPeEXRhLD42YmYhzOhM9heKJvFlj9ifBuji8Wu8sPy9AldO/w2PZiXYQYCWs8AfT2UQK8gI8HnZ/GQSmn9eTkha6zg2hWufOZhppiDIzQS/KOG/kwU7ccpo= 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 167870248467688.86284689256922; Mon, 13 Mar 2023 03:14:44 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pbfAZ-0002al-Kb; Mon, 13 Mar 2023 06:12:43 -0400 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 1pbfAX-0002Yc-R8 for qemu-devel@nongnu.org; Mon, 13 Mar 2023 06:12:41 -0400 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 1pbfAW-0004EP-4i for qemu-devel@nongnu.org; Mon, 13 Mar 2023 06:12:41 -0400 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-482-k_yfAqvSPkC9-IDnN_peGg-1; Mon, 13 Mar 2023 06:12:28 -0400 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 1899B811E9C; Mon, 13 Mar 2023 10:12:28 +0000 (UTC) Received: from localhost (unknown [10.39.208.8]) by smtp.corp.redhat.com (Postfix) with ESMTP id 51AEDC15A0B; Mon, 13 Mar 2023 10:12:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1678702359; 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=Um3n+CTQRxL3PnrARU7ObOzyxLsrZaGrEUDVOetGQuo=; b=QbbWaOK55sxdvOFfGZfRc3s2NpbHAFuqO5a5ZMSwIMNlbliTDqlUvZldFhLtCjsg32UW0P yiK/vE/khDJf8/QCRIw8G27mANK2szrISAx4wAdqismnTyiTwx6BDgr8qCpMDs/ZkEIOW7 DMvGX8dcrG960BY7QtrCfkIhM2QP/hk= X-MC-Unique: k_yfAqvSPkC9-IDnN_peGg-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: Gerd Hoffmann , Paolo Bonzini , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Laurent Vivier , Thomas Huth Subject: [PATCH v3 04/18] ui/dbus: set mouse is-absolute during console creation Date: Mon, 13 Mar 2023 14:11:53 +0400 Message-Id: <20230313101207.375125-5-marcandre.lureau@redhat.com> In-Reply-To: <20230313101207.375125-1-marcandre.lureau@redhat.com> References: <20230313101207.375125-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.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: 1678702485726100005 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 Thu May 2 23:55:35 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=1678702397; cv=none; d=zohomail.com; s=zohoarc; b=Jd0xdvt95/L3XWQ1vzZ5wYwhC4TIyy+mtS5sHgqCEAuAadB6PtPluDoihg27XkqhopYbR9VWh8LGEnnQ5bD7ibmGguXUeRjO5CkXNln0XMCti4/hLhNZZ4520YJTvXWgWEKkcz/gEpO0YKso59/idm4e1q391gUgc/PQ0fFzEqM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1678702397; 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=vxQQ/DryfYO5Hfit4DRbxI3FRh1OF59gFMlc22PQCvs=; b=NRl5kKm50Txpzwv0kYRDCudLRkLYxcD+ydUKFFCHAEI7IblP+EfFJXvxxh1NOiq933uFhkiZbX6e8fx19X0FCPKrY4DjRuchG849WFDF4l2tUuT3vqcexgmNMbPF30miwXlc6p9kr1Zq0a5bpOQUT77PIGxh3/HYQJJM25/CvDg= 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 1678702397696203.6165002781221; Mon, 13 Mar 2023 03:13:17 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pbfAT-0002YM-J6; Mon, 13 Mar 2023 06:12:37 -0400 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 1pbfAS-0002Vu-6n for qemu-devel@nongnu.org; Mon, 13 Mar 2023 06:12:36 -0400 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 1pbfAQ-0004CO-RH for qemu-devel@nongnu.org; Mon, 13 Mar 2023 06:12:35 -0400 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-458-c-LlcqowNqicSHZmAe8FxA-1; Mon, 13 Mar 2023 06:12:32 -0400 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 5D0D118483B3; Mon, 13 Mar 2023 10:12:32 +0000 (UTC) Received: from localhost (unknown [10.39.208.8]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8FD1D2166B26; Mon, 13 Mar 2023 10:12:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1678702354; 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=vxQQ/DryfYO5Hfit4DRbxI3FRh1OF59gFMlc22PQCvs=; b=fLJykPp2RVDNkChcHrZ09kYUw5izn79kqpDRVw+DhRaAafEu0aBqQ0t3nhnbJ/a79KLFWg /kWcyIOb1ztKPXkefLzpr7BooB9P1/f+8Gbj+VvyiVRcxiEMB9o2fx5tDgukYre0PpWIes GQHkLX2d57h8uemGYiD0Rl2pGCHbHa4= X-MC-Unique: c-LlcqowNqicSHZmAe8FxA-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: Gerd Hoffmann , Paolo Bonzini , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Laurent Vivier , Thomas Huth Subject: [PATCH v3 05/18] meson: ensure dbus-display generated code is built before other units Date: Mon, 13 Mar 2023 14:11:54 +0400 Message-Id: <20230313101207.375125-6-marcandre.lureau@redhat.com> In-Reply-To: <20230313101207.375125-1-marcandre.lureau@redhat.com> References: <20230313101207.375125-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: 1678702399413100001 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 Thu May 2 23:55:35 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=1678702499; cv=none; d=zohomail.com; s=zohoarc; b=G1LT93Ia9YCAZq6brXPSjVtgk5nSdCXiGVPOOgxZp1UhcwnOw/150aXRca10DIPxKkKjCQTmSo7qMzWi7QWw3aAbvKUpxMhb+JmRQ24nO6Lf6VUVPN3JpnTR3fwzEKBbjBtn5D9OJJfpEP4ZsF4EFXU8+FpAwP91OUQtRvfreeo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1678702499; 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=vFXqQK7YuyY7XLdJ4DfeXGeAXqG61JsTk3/5DSEwDeM=; b=HFCBSDgw5YeDYB9bUIwvHtXi5JQJ5ftUFnxbachvO93KNf4T9/1RruLzwhBN56cjEMDqkdsrPWdTWmPcKHAwFC1j648XLjdyw6tBpAI4U5SxjrWFecZv21BIpVOpwiucqdiyeiWhNZ8ue/GvcUKB4sU7J/cJW13WhCno+3AjAwM= 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 1678702499580809.5088154080195; Mon, 13 Mar 2023 03:14:59 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pbfAd-0002be-Fu; Mon, 13 Mar 2023 06:12:47 -0400 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 1pbfAb-0002az-Ll for qemu-devel@nongnu.org; Mon, 13 Mar 2023 06:12:45 -0400 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 1pbfAa-0004Ek-53 for qemu-devel@nongnu.org; Mon, 13 Mar 2023 06:12:45 -0400 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-517-bQJDK4-qOPu9Pr7lB3Mu0Q-1; Mon, 13 Mar 2023 06:12:40 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 1B0C61C05141; Mon, 13 Mar 2023 10:12:40 +0000 (UTC) Received: from localhost (unknown [10.39.208.8]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8FD15202701E; Mon, 13 Mar 2023 10:12:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1678702363; 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=vFXqQK7YuyY7XLdJ4DfeXGeAXqG61JsTk3/5DSEwDeM=; b=VpXO4RUy9CzEuHreW+O8RYaAEUhkMT1mxRkOkH6O8f0Va24bC0lY4FXi5xEDMfUg6lualw WNB/E7HWb9c0B8AgjwOxbqxPuVJ7yn09mW7VpIXd8UyGSxX1DcHRLlJvRcx6VBEILM6xK/ z89I9nH73EXOzA/nXJ7y/eZPZlpYGEE= X-MC-Unique: bQJDK4-qOPu9Pr7lB3Mu0Q-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: Gerd Hoffmann , Paolo Bonzini , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Laurent Vivier , Thomas Huth Subject: [PATCH v3 06/18] ui: rename cursor_{put->unref} Date: Mon, 13 Mar 2023 14:11:55 +0400 Message-Id: <20230313101207.375125-7-marcandre.lureau@redhat.com> In-Reply-To: <20230313101207.375125-1-marcandre.lureau@redhat.com> References: <20230313101207.375125-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.4 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: 1678702500018100001 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 Thu May 2 23:55:35 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=1678702484; cv=none; d=zohomail.com; s=zohoarc; b=NKL+8GoGCbn5N8LQJ0xJ0lYvT+2lpTeK3+nWHTGI5GUDiTPdu5riovjCeSY7WWfIWACHw7d/XtFrSxCflxn6YbnZtT69dPHEMHkRv7a0PVXmNk3ILrda7vBAIsOzF8Kn7eJbDzeezfrTY6e9QAkJ128/g+kF8QBpUM2P+mevN3I= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1678702484; 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=DYo2xsJrv7p52Pp7Pfb/+4CcUL5ojeeADVJxY55Rqmk=; b=QkMQqZvkx0CnIJJfs5xIrgTeG8YjyP+Z1r3y8oDWaW+eo7FnpwX0brtXSLmk7U4lITBXHX3lYZpWcjsVdMTUsMz+f53cMly2OM3omka4rQNLyFDZIM9oh7LbhfREyiTWhdVhzODCNfQ54u25FEryS3vY+AXGFiCmCNKi3H+z8cU= 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 1678702484309823.7948089617424; Mon, 13 Mar 2023 03:14:44 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pbfAh-0002cF-5e; Mon, 13 Mar 2023 06:12:51 -0400 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 1pbfAf-0002c0-Mh for qemu-devel@nongnu.org; Mon, 13 Mar 2023 06:12:49 -0400 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 1pbfAe-0004F4-4v for qemu-devel@nongnu.org; Mon, 13 Mar 2023 06:12:49 -0400 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-180-6bxYXIzBOa2dPgTyOYc3Cg-1; Mon, 13 Mar 2023 06:12:44 -0400 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 E39BD3806629; Mon, 13 Mar 2023 10:12:43 +0000 (UTC) Received: from localhost (unknown [10.39.208.8]) by smtp.corp.redhat.com (Postfix) with ESMTP id 16EF52A68; Mon, 13 Mar 2023 10:12:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1678702367; 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=DYo2xsJrv7p52Pp7Pfb/+4CcUL5ojeeADVJxY55Rqmk=; b=M/7I94XnZLL2EagOjtjqyGe8bFOZ8qukDwzSdKt5jNfBEXwTTwezb2ef4P6spL0jTsWXk7 UcXgWA1DazAogTkpwd/liHWRRM+BYYh0MctGwqsYD73RqgpA5fyFUuEjPJtGCLqrco8FB+ Jp/N8jFsZwoHPyWpOm9wRmaK8LKHXrk= X-MC-Unique: 6bxYXIzBOa2dPgTyOYc3Cg-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: Gerd Hoffmann , Paolo Bonzini , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Laurent Vivier , Thomas Huth Subject: [PATCH v3 07/18] ui: rename cursor_{get->ref}, return it Date: Mon, 13 Mar 2023 14:11:56 +0400 Message-Id: <20230313101207.375125-8-marcandre.lureau@redhat.com> In-Reply-To: <20230313101207.375125-1-marcandre.lureau@redhat.com> References: <20230313101207.375125-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: 1678702485749100006 From: Marc-Andr=C3=A9 Lureau The naming is more conventional in QEMU code, and allows to simplify some code by changing the API design, so it returns the input parameter, instead of void. 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 Thu May 2 23:55:35 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=1678702468; cv=none; d=zohomail.com; s=zohoarc; b=DCWSIHVGzBKqDWgUHv4+GJvVBJuW+RyNBBZsZVvOrVaKEaODoiz2s1n38cA6XwQTmMYTrFno5oOzoGHaIhMZwsaLM7t42BsrdLEaYof9HvNVJWMH2iYXfUtMp0ZTD7/6qDziKrICojVYK4eel+mNpGcHlcDGoqlzDMxSXSapiaE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1678702468; 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=VDcbfDpFhk7vTcrdV+w1gSVlA/CJycSO0gXTIPyrtZM=; b=jOD9lo4b4c2ewbSksFwZSq37WzXCBxicbWWmqqeCVaMtq9UnRdOSvnUqMLnaPtUXlx5I87JpGduNYD99qScNkngYlALCVfyBTPzo48H6fM5FQtihphR58PfEIiL2FDNAI0J3J8IKYNF3bLcSCt76nPkARc07/yi0zHcY87fmjpE= 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 1678702468262517.2059898504501; Mon, 13 Mar 2023 03:14:28 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pbfAv-0002w7-5b; Mon, 13 Mar 2023 06:13:05 -0400 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 1pbfAk-0002cj-7e for qemu-devel@nongnu.org; Mon, 13 Mar 2023 06:12:55 -0400 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 1pbfAi-0004Fd-Mb for qemu-devel@nongnu.org; Mon, 13 Mar 2023 06:12:53 -0400 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-635-eHufdTsnN7q4zhnjKJyvfQ-1; Mon, 13 Mar 2023 06:12:48 -0400 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 628AB85D062; Mon, 13 Mar 2023 10:12:48 +0000 (UTC) Received: from localhost (unknown [10.39.208.8]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5E140C164E7; Mon, 13 Mar 2023 10:12:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1678702372; 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=VDcbfDpFhk7vTcrdV+w1gSVlA/CJycSO0gXTIPyrtZM=; b=B3J4ZTDczuvufqKEMqSU+ZdeH9i7PSYg6dipct5ASk5H892quNhqcO0eljAxxTcpKhqe1R n48KJV7269zWA3X6zPsCrqNe2RyVOhtv3tMSakbf9KHT1vO+zRxX6vBuOTwzMyoJGYA5FJ cnE9Do+5tX3Ima1U134iFEeuJvDqQuY= X-MC-Unique: eHufdTsnN7q4zhnjKJyvfQ-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: Gerd Hoffmann , Paolo Bonzini , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Laurent Vivier , Thomas Huth Subject: [PATCH v3 08/18] ui: keep current cursor with QemuConsole Date: Mon, 13 Mar 2023 14:11:57 +0400 Message-Id: <20230313101207.375125-9-marcandre.lureau@redhat.com> In-Reply-To: <20230313101207.375125-1-marcandre.lureau@redhat.com> References: <20230313101207.375125-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: 1678702469704100001 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 Thu May 2 23:55:35 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=1678702410; cv=none; d=zohomail.com; s=zohoarc; b=j3HCuM0JxXkbJLcJMvo3sWYM6bHQaXfZjJzEHutRCZ6cPScd3ECbqzmjTYg1jb6a/wm0uzPi9qf7YKZU49BhpXcNxDaVcItzKlCszMbioPSFQoZJ6f/xuMemF34GSJG+OCyuyrD97e6HPckt3cOCFhg/t/0QaazIECvEqqBJA9s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1678702410; 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=pKLp1NF6vXd2FTLRKzlGQVEHmQOr4Nz1N5JZ7I4wYQg=; b=nN4HZMItuGyfMla5+i2/WNIWoP4QIoVAKMSwtaWQvUXzjh4VSjgnPNthwktrz4aw7H5ezkm1hB47FeI6k5PEotAJDQVoYCkazCWH0CFotxjx7a3NKwnTOcj89Ca0weT0War3kj081BOYTvShpT0xLl1JKwg6fVzqhMttpBqFadk= 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 1678702409991443.25596686087306; Mon, 13 Mar 2023 03:13:29 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pbfB9-0003Mj-TJ; Mon, 13 Mar 2023 06:13:21 -0400 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 1pbfAy-0003AW-5A for qemu-devel@nongnu.org; Mon, 13 Mar 2023 06:13:09 -0400 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 1pbfAr-0004I4-Qz for qemu-devel@nongnu.org; Mon, 13 Mar 2023 06:13:07 -0400 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-629-SxU3xNYsOGyuqaxS18zF7Q-1; Mon, 13 Mar 2023 06:12:53 -0400 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 AC2C480D0E3; Mon, 13 Mar 2023 10:12:52 +0000 (UTC) Received: from localhost (unknown [10.39.208.8]) by smtp.corp.redhat.com (Postfix) with ESMTP id B56A62A68; Mon, 13 Mar 2023 10:12:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1678702376; 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=pKLp1NF6vXd2FTLRKzlGQVEHmQOr4Nz1N5JZ7I4wYQg=; b=KwhksAmQpeT8+txMoTMPYmbrAxSfh2a3qrzcK+l2tEPhh+hOQs81dCFAXTNDvi7R03DRVx J0FRhjHftQk+qw8ApIO6oHfhbMO38cNSZgkn4sLuQIjUkvpRy6GAnKrLOUdDEAOUQ8YhfW nD3R25QmdYDqEOQz3xVTSyPorIKDhv0= X-MC-Unique: SxU3xNYsOGyuqaxS18zF7Q-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: Gerd Hoffmann , Paolo Bonzini , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Laurent Vivier , Thomas Huth Subject: [PATCH v3 09/18] ui: set cursor upon listener registration Date: Mon, 13 Mar 2023 14:11:58 +0400 Message-Id: <20230313101207.375125-10-marcandre.lureau@redhat.com> In-Reply-To: <20230313101207.375125-1-marcandre.lureau@redhat.com> References: <20230313101207.375125-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.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: 1678702411435100001 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 Thu May 2 23:55:35 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=1678702439; cv=none; d=zohomail.com; s=zohoarc; b=Q+sdW5aF+MXrPTfUMT2JNYsS7wsmFkDASS1RlYuyod5MKSac/lwGuwQy2C8hFJOhz/cqYiy5xU55Z44CZOyJ43StSbDpc6eSNBMi/EKU2bI0B1LvHfKSJKTGN6mL4Lat6GoYQeUVq+84mOHQPrzmzu5JlNLGufVGG9lDl3iZEdM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1678702439; 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=IPQsyKRbO4btBdnZazBC9mS721ul3H3jza4mXs2qvCc=; b=FO1l3aAUdORwr/4jqB38TUjcXLtVsDmpRgA5xFytctjpUPx8OZLn2Fx9Ek9GIRJ6ktqUnnXIWQB4pB7t9TlcaITBoJT2ZygIzCTu6R+TW2VVkNnSf0sTue0UsiXKky5xFhq2r2QzWlZdNXDSWROGfLLF7Bvm0Ae0mZ+6xV6yRjE= 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 1678702439575822.0220307639419; Mon, 13 Mar 2023 03:13:59 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pbfBB-0003Ra-8R; Mon, 13 Mar 2023 06:13:21 -0400 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 1pbfAy-0003Ap-BM for qemu-devel@nongnu.org; Mon, 13 Mar 2023 06:13:10 -0400 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 1pbfAt-0004KL-Ny for qemu-devel@nongnu.org; Mon, 13 Mar 2023 06:13:08 -0400 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-197-o7oqBWbQPaaOkoAk-wTWoQ-1; Mon, 13 Mar 2023 06:12:57 -0400 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 A5D2A101A55E; Mon, 13 Mar 2023 10:12:56 +0000 (UTC) Received: from localhost (unknown [10.39.208.8]) by smtp.corp.redhat.com (Postfix) with ESMTP id D24D940C6E67; Mon, 13 Mar 2023 10:12:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1678702380; 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=IPQsyKRbO4btBdnZazBC9mS721ul3H3jza4mXs2qvCc=; b=iTnIF0Xvk1f62U6HKzAgViKUGsgMUVbogqEd8Ku+RfRDM09AQYhZZUWeubtzgIkli9WF8t x+nZ7NQM1TlZ8+IRPF2N0qtfzirkBr2MHKoNsIFAD3lgPypPknfoHkqqE9j0Wy/Uyh6EN+ GEH5rIlpdJHFeBYbnmTrnxQdRGMAIow= X-MC-Unique: o7oqBWbQPaaOkoAk-wTWoQ-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: Gerd Hoffmann , Paolo Bonzini , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Laurent Vivier , Thomas Huth Subject: [PATCH v3 10/18] ui: set cursor position upon listener registration Date: Mon, 13 Mar 2023 14:11:59 +0400 Message-Id: <20230313101207.375125-11-marcandre.lureau@redhat.com> In-Reply-To: <20230313101207.375125-1-marcandre.lureau@redhat.com> References: <20230313101207.375125-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: 1678702441617100003 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 Thu May 2 23:55:36 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=1678702423; cv=none; d=zohomail.com; s=zohoarc; b=djOS3JicZwwfCzYGI7huQ0H2rgXwbQzLBW7PIcugQXwtg+Sgz/W2huLt5G2tPtCbSE1HRwuv31O/eRo6shlD9juCMKfoErHQX85OgOmODe7BgDd0yFSUdmZ3ETXc+YF2tNxlR7I7ETpA7186EmdHgWX58PxsKHJz0Ll3yhSB/uA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1678702423; 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=tNRm4hA44NhwZhX/j70InGgs7Ee47UrlVNMceHDhSeo=; b=deMbfUEt0OtgbuGF/7oDHl1R73CiUUK0HlCNgZjCyJEWXpjC8acEXMZ1QEgSO5NFAU6HIgb7rrdz01Bju7COkBbo5+zF0ceYvImFSL5WbJSBAsAhN0Il0C56DEfvHRrTB9RpfxCE38qwGVOZPI0T9nnIZle5GSrkNCh9tuUf/UM= 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 1678702423580407.4849301384319; Mon, 13 Mar 2023 03:13:43 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pbfBB-0003Uh-Re; Mon, 13 Mar 2023 06:13:23 -0400 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 1pbfAy-0003Ao-B3 for qemu-devel@nongnu.org; Mon, 13 Mar 2023 06:13:10 -0400 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 1pbfAt-0004LT-OI for qemu-devel@nongnu.org; Mon, 13 Mar 2023 06:13:08 -0400 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-438-GRVBU5xFP7yaI5yVERBrvg-1; Mon, 13 Mar 2023 06:13:00 -0400 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 5145A18483B4; Mon, 13 Mar 2023 10:13:00 +0000 (UTC) Received: from localhost (unknown [10.39.208.8]) by smtp.corp.redhat.com (Postfix) with ESMTP id 89FB7140E95F; Mon, 13 Mar 2023 10:12:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1678702381; 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=tNRm4hA44NhwZhX/j70InGgs7Ee47UrlVNMceHDhSeo=; b=eFpks42Uu0zkZiTBKAbOxybfScaS9/jaHdUAUTceONsQoXMRNjwXDV8AE1O1C0Ub2gpwRC rQlN7wcWIvxa33Vl9NQgm9DoXj2UDyQUBXWZi43fvjaqdKGVkQGaCsglwiflkdtQVfqfSs z9mUdr46fjz+kndQOD03xYCJKE4t+/k= X-MC-Unique: GRVBU5xFP7yaI5yVERBrvg-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: Gerd Hoffmann , Paolo Bonzini , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Laurent Vivier , Thomas Huth Subject: [PATCH v3 11/18] ui/sdl: get the GL context from the window Date: Mon, 13 Mar 2023 14:12:00 +0400 Message-Id: <20230313101207.375125-12-marcandre.lureau@redhat.com> In-Reply-To: <20230313101207.375125-1-marcandre.lureau@redhat.com> References: <20230313101207.375125-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: 1678702425509100001 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 Reviewed-by: Daniel P. Berrang=C3=A9 --- ui/sdl2.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ui/sdl2.c b/ui/sdl2.c index 8cb77416af..137f7ab57f 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); } @@ -112,6 +112,8 @@ void sdl2_window_destroy(struct sdl2_console *scon) return; } =20 + SDL_GL_DeleteContext(scon->winctx); + scon->winctx =3D NULL; SDL_DestroyRenderer(scon->real_renderer); scon->real_renderer =3D NULL; SDL_DestroyWindow(scon->real_window); --=20 2.39.2 From nobody Thu May 2 23:55:36 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=1678702485; cv=none; d=zohomail.com; s=zohoarc; b=ioweI3xQoVP16gpiAE1mgjYb5EBqq2ia11eA1qe79fVGQDG+hyExaBxEyAXfbnYfSitomFyL2hqZQDSSnfeu/QGB3JCtJygv8WHKphehQ/iGtmDxCp7c4+oCRhfd5XIyY3c98wRJcgHr2uWzZ72tprS0iBVRY4CBgAVBrXb+1b8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1678702485; 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=ZGbDQQUC9o48TybP+tmq1USntKA5OfzCZKVe6QxmWy0=; b=aIqlmVeAF40siroQR1GldTwUTRsqMjG7yuADZ581vziDp3WVD+vSQu312GMavQFHLv5NpSpvEKdmpyE2sHuo+ZmwBfDVV6eBW9qLMG7S8Ennvse0DZ9qTtK/SDNxr5WhVSfCxUB/magkVYfGgjvCY3LivLz3ea8VsZCmGN/8AFY= 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 1678702485741816.9224550937931; Mon, 13 Mar 2023 03:14:45 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pbfBI-0003jR-8F; Mon, 13 Mar 2023 06:13:28 -0400 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 1pbfB1-0003Gx-8U for qemu-devel@nongnu.org; Mon, 13 Mar 2023 06:13:12 -0400 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 1pbfAw-0004MR-U0 for qemu-devel@nongnu.org; Mon, 13 Mar 2023 06:13:10 -0400 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-297-AS1syhP8OlS1OUHGM5db1Q-1; Mon, 13 Mar 2023 06:13:04 -0400 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 4B094802D2E; Mon, 13 Mar 2023 10:13:04 +0000 (UTC) Received: from localhost (unknown [10.39.208.8]) by smtp.corp.redhat.com (Postfix) with ESMTP id 83C85C158C2; Mon, 13 Mar 2023 10:13:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1678702386; 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=ZGbDQQUC9o48TybP+tmq1USntKA5OfzCZKVe6QxmWy0=; b=NYvLPpFvaj0piKhMLMqB1+zvBa9rskwsmWF3sURPGhDItXFE1B1Mfgph1RAD5PiNWwx9Ny a1z0yowtlpKdUr8towM1d7u40/zjX5rlXhBf15gXRu4eSNsec1+HDbYB6LLxaL1C5Lu9y4 bvIBjl0oWPLiHlEsM2fyvD6tGO+MJLs= X-MC-Unique: AS1syhP8OlS1OUHGM5db1Q-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: Gerd Hoffmann , Paolo Bonzini , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Laurent Vivier , Thomas Huth Subject: [PATCH v3 12/18] ui/shader: fix #version directive must occur on first line Date: Mon, 13 Mar 2023 14:12:01 +0400 Message-Id: <20230313101207.375125-13-marcandre.lureau@redhat.com> In-Reply-To: <20230313101207.375125-1-marcandre.lureau@redhat.com> References: <20230313101207.375125-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: 1678702487752100009 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 Thu May 2 23:55:36 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=1678702513; cv=none; d=zohomail.com; s=zohoarc; b=cDR17rE0bHQdu2xHS6f4vsH3avZ0JfbTrSoqnJ3r/nf0iHCsvFZ9QwOTcag9OihSWrQUVizO6PK3W4lFINfcZooT595Gm+uBup8uQ85cw+wTbOApyaqEZMI77MxzLnKMBa/p5+tZV+QpqQTdCNeQ0U3+nhLGhVmMAJnstCIJ6UM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1678702513; 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=gkcGnHyU88dL/DJ/DCBWfdfD7yj/1G/BStzkw90e7v4=; b=KuFwWwMNTjIkXrpne40Sd+cNz+TyjrgEPKEDVqRMjsl43JU4J3dLXE+4uj3E8Efx4N4ia97KsaTTIuj6UCHcq9+fq+ABh7apag029jlb4ADDMDn3ecX2y2JW5PzjefMfDeUls03Z8rqSmCZVWdrFx8fkAcrRTKixhFuiKZzok5Y= 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 1678702512919610.3120795454432; Mon, 13 Mar 2023 03:15:12 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pbfBI-0003hn-0d; Mon, 13 Mar 2023 06:13:28 -0400 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 1pbfB2-0003K1-PU for qemu-devel@nongnu.org; Mon, 13 Mar 2023 06:13:14 -0400 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 1pbfB1-0004NH-2i for qemu-devel@nongnu.org; Mon, 13 Mar 2023 06:13:12 -0400 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-659-yZLxgz-lPNmxfwqkdVyWnw-1; Mon, 13 Mar 2023 06:13:09 -0400 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 AFA59185A7A4; Mon, 13 Mar 2023 10:13:08 +0000 (UTC) Received: from localhost (unknown [10.39.208.8]) by smtp.corp.redhat.com (Postfix) with ESMTP id 83200140E95F; Mon, 13 Mar 2023 10:13:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1678702390; 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=gkcGnHyU88dL/DJ/DCBWfdfD7yj/1G/BStzkw90e7v4=; b=TD4qepiI0s5UTxoGLDgJDgfdXwY2FTlSzAiNTlWjOZnHfyXpIBnIOJcS56ZK6c7kgQgrDC PHZwMdyHJuyLJGXbqsHcjMDkyinuumncpD1n9sN1hPAUP9Nv6jPPyV5iOTFFrIs3WtbvhK AkxtxdxYd16MBMS5JzzgGdEHTCxpkdc= X-MC-Unique: yZLxgz-lPNmxfwqkdVyWnw-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: Gerd Hoffmann , Paolo Bonzini , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Laurent Vivier , Thomas Huth Subject: [PATCH v3 13/18] ui/egl: print EGL error, helping debugging Date: Mon, 13 Mar 2023 14:12:02 +0400 Message-Id: <20230313101207.375125-14-marcandre.lureau@redhat.com> In-Reply-To: <20230313101207.375125-1-marcandre.lureau@redhat.com> References: <20230313101207.375125-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: 1678702514116100003 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..b11837415b 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 Thu May 2 23:55:36 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=1678702431; cv=none; d=zohomail.com; s=zohoarc; b=QJk5fUBhl2SZKrD8x2g4rU6ue1CIbtjr10Ir7Pmr9No8I4oyoBEULQ0e+kzbn6fmBorJHTLhdhdoCmwZvr3UZxF7OZAa20Qiq9wx2bljhPaj9LJIcW0uFDlKicFnHbwNEOZrXL69WKh+ft4uepwLDUZZOj7wiPGVl0xJ8ykFBaA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1678702431; 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=m2ey6Me3RzhUnLl6Ogy7OrIpD9dgOkdSTYWhTPkqQR8=; b=F+DIEZKvJBLAnEjQXOCfYEvV+6nZROBYgQMfzq7Es6YNTf2ObdGM7Gk1d9jSI52DTiekWaZHzyETk3OQQAqVhwYNl+fQ1RJ0i8DQSMOItyYUL0smQK3FxaLPOyylA5VOYbEJWLghQGpTvU06Hsd2g/ZZInaiLshA3t8XfuJabr0= 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 1678702431551407.73320923267215; Mon, 13 Mar 2023 03:13:51 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pbfBJ-0003qj-2b; Mon, 13 Mar 2023 06:13:29 -0400 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 1pbfB6-0003SJ-UY for qemu-devel@nongnu.org; Mon, 13 Mar 2023 06:13:19 -0400 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 1pbfB5-0004OM-Jk for qemu-devel@nongnu.org; Mon, 13 Mar 2023 06:13:16 -0400 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-411-w2juYfhuMoi9F31ZU74Uaw-1; Mon, 13 Mar 2023 06:13:13 -0400 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 50EC81C05141; Mon, 13 Mar 2023 10:13:13 +0000 (UTC) Received: from localhost (unknown [10.39.208.8]) by smtp.corp.redhat.com (Postfix) with ESMTP id 898E940C83A9; Mon, 13 Mar 2023 10:13:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1678702395; 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=m2ey6Me3RzhUnLl6Ogy7OrIpD9dgOkdSTYWhTPkqQR8=; b=bbb1zQ0SqLwF6v8k06qkX/sYaY9mEgduBIZRwiF1uJhUMV6DH6FCtI23pGbFQ8wwIRiPDh ipfX4oSt/0cnReTJZxg1l92t8dPh6OVQDCu97vifFDRzI0wyQLZtsCEGUuZA9Gm0F80PxJ 0HKRAhguuw2T5pTgr7qYrgIJgqWf6go= X-MC-Unique: w2juYfhuMoi9F31ZU74Uaw-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: Gerd Hoffmann , Paolo Bonzini , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Laurent Vivier , Thomas Huth Subject: [PATCH v3 14/18] ui/sdl: add QEMU_ENABLE_SDL_LOGGING setting/environment Date: Mon, 13 Mar 2023 14:12:03 +0400 Message-Id: <20230313101207.375125-15-marcandre.lureau@redhat.com> In-Reply-To: <20230313101207.375125-1-marcandre.lureau@redhat.com> References: <20230313101207.375125-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.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: 1678702433553100009 From: Marc-Andr=C3=A9 Lureau Enable SDL logging when QEMU_ENABLE_SDL_LOGGING variable is set, as suggested by Sam Lantinga, upstream SDL maintainer. Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Daniel P. Berrang=C3=A9 --- ui/sdl2.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ui/sdl2.c b/ui/sdl2.c index 137f7ab57f..221cdced60 100644 --- a/ui/sdl2.c +++ b/ui/sdl2.c @@ -843,6 +843,10 @@ static void sdl2_display_init(DisplayState *ds, Displa= yOptions *o) } #endif =20 + if (SDL_GetHintBoolean("QEMU_ENABLE_SDL_LOGGING", SDL_FALSE)) { + SDL_LogSetAllPriority(SDL_LOG_PRIORITY_VERBOSE); + } + if (SDL_Init(SDL_INIT_VIDEO)) { fprintf(stderr, "Could not initialize SDL(%s) - exiting\n", SDL_GetError()); --=20 2.39.2 From nobody Thu May 2 23:55:36 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=1678702445; cv=none; d=zohomail.com; s=zohoarc; b=LlCjQuu4pOHHd5Gn2ZzetxDj+AcXvo1G4NtTH2ZYyD1LuLifFWozjcE5JSw9jgniEyBfL1Ee+rSihppJve+SlkzJy630jIOxZ2icM8rNiQ2g6y3nKCfxffBz6jqJ7akVypTiyxXS0S2lGcW4R6Kb9Hrfo7HEWKb5gYkVdGJDKUA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1678702445; 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=w3LL2Utc8DveH1ja8P2pWS7/E7RdJaNYiBkLmCG8WC4=; b=aSlS2rC/GNk5LGqvD/23gJ5OWn/+rF7PklVwEs2K/4L9uxykxx8/hGkuGoTdBhyCiVpdG/NuDANLn7Fyl4iBWnn5GshmOA4rMB6iH5vbljOM4pH5tnS4jGSnsUXWTHLcloGWbf9GDlb7t2vRf+LX3bI/rVZyyKlkrHY3atqr28Q= 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 16787024450841011.2558847640341; Mon, 13 Mar 2023 03:14:05 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pbfBK-00043n-8O; Mon, 13 Mar 2023 06:13:30 -0400 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 1pbfBD-0003Yf-Sf for qemu-devel@nongnu.org; Mon, 13 Mar 2023 06:13:25 -0400 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 1pbfBB-0004P2-IM for qemu-devel@nongnu.org; Mon, 13 Mar 2023 06:13:23 -0400 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-147-HZ6af2faN1mexuWf2PRRVA-1; Mon, 13 Mar 2023 06:13:17 -0400 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 2169385D066; Mon, 13 Mar 2023 10:13:17 +0000 (UTC) Received: from localhost (unknown [10.39.208.8]) by smtp.corp.redhat.com (Postfix) with ESMTP id 567DB1121315; Mon, 13 Mar 2023 10:13:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1678702400; 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=w3LL2Utc8DveH1ja8P2pWS7/E7RdJaNYiBkLmCG8WC4=; b=XaE+R3eX4JWU5fc0UKHmIZmc2LKUa/om5UwYLhMcQjN1CIMRL9Q3T2QU5wymP0Cy2BnLrD TsVWBBhhKBEItZsIv4O5dptg2f19H9Nvq/onraQlnj7XTviQC2PUhsqRst4O4b0mgD+KuF /hgnYi/UZykGkME7vsy0KS3g2zkrRVY= X-MC-Unique: HZ6af2faN1mexuWf2PRRVA-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: Gerd Hoffmann , Paolo Bonzini , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Laurent Vivier , Thomas Huth Subject: [PATCH v3 15/18] ui/sdl: try to instantiate the matching opengl renderer Date: Mon, 13 Mar 2023 14:12:04 +0400 Message-Id: <20230313101207.375125-16-marcandre.lureau@redhat.com> In-Reply-To: <20230313101207.375125-1-marcandre.lureau@redhat.com> References: <20230313101207.375125-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: 1678702445593100001 From: Marc-Andr=C3=A9 Lureau -display sdl,gl=3Des didn't actually use OpenGL ES. Using OpenGL ES allows to use ANGLE, which works generally better than Windows/OEM OpenGL driver. (note: users can still bypass the QEMU choice with SDL_RENDER_DRIVER environment variable) (note: for some reason, specifying a driver disables batching and breaks rendering, so enable it explicitly) Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Daniel P. Berrang=C3=A9 --- ui/sdl2.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/ui/sdl2.c b/ui/sdl2.c index 221cdced60..35c58c1104 100644 --- a/ui/sdl2.c +++ b/ui/sdl2.c @@ -58,6 +58,11 @@ static Notifier mouse_mode_notifier; #define SDL2_MAX_IDLE_COUNT (2 * GUI_REFRESH_INTERVAL_DEFAULT \ / SDL2_REFRESH_INTERVAL_BUSY + 1) =20 +/* introduced in SDL 2.0.10 */ +#ifndef SDL_HINT_RENDER_BATCHING +#define SDL_HINT_RENDER_BATCHING "SDL_RENDER_BATCHING" +#endif + static void sdl_update_caption(struct sdl2_console *scon); =20 static struct sdl2_console *get_scon_from_window(uint32_t window_id) @@ -99,7 +104,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 Thu May 2 23:55:36 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=1678702492; cv=none; d=zohomail.com; s=zohoarc; b=DRyk8OHoeHrbb5H8wjnz6TauA8DbkmLmsDrDcrULaHvPAjls70+uuKl2sZLM0QluRLgtJITw2eu8vS/BlXesZKrX6edAVDneokBJjbZX397SONwKE1hUXO/UnMFIHjDpeL0LlEn9URKMOnPHfeMaSbrQgQCAZc6i5Tk/2qPGdOo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1678702492; 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=H4EbJLffk0sI3CSZDaD1th2c03OA9Jj8yPbGauPMJ6s=; b=gJAINb6k04ONfdYZEw16g2u1lG+vOMkYwFtdZMt6/yByQpS1CqlihpS1BcrsFCNSTN0sVBRMieYNqllTuZJ9aimbQji/hMcUy1y+JN5GXOT8IWxY2Fl9jhYqfVch5bSlttgKT0e55i+o0zBIMFmzmu4Q5QZiDVlmHr6lHiyyaFo= 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 1678702492744834.593433848392; Mon, 13 Mar 2023 03:14:52 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pbfBL-0004DG-7h; Mon, 13 Mar 2023 06:13:31 -0400 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 1pbfBI-0003iJ-6y for qemu-devel@nongnu.org; Mon, 13 Mar 2023 06:13:28 -0400 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 1pbfBG-0004PO-6Z for qemu-devel@nongnu.org; Mon, 13 Mar 2023 06:13:27 -0400 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-671-ChhtIcacMYabmqBeH4UQRw-1; Mon, 13 Mar 2023 06:13:22 -0400 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 A69C71C07543; Mon, 13 Mar 2023 10:13:21 +0000 (UTC) Received: from localhost (unknown [10.39.208.8]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9CBF8492C13; Mon, 13 Mar 2023 10:13:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1678702405; 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=H4EbJLffk0sI3CSZDaD1th2c03OA9Jj8yPbGauPMJ6s=; b=Enu8cQ96FjJyfk6at2NvS2P/3sfzU8YPiQUczycIbcp+0u7PbMyW8/pfnK2xmoqNVXvzpG QJXi432kUjKkOQSU/kpSiJkBcZBTjl3arRrjD6WH0FmqeoErwvkrWQGJujABNARoHathCt 2hI0oTtR/Ks1H+eSWlW2JcoM33hBD8M= X-MC-Unique: ChhtIcacMYabmqBeH4UQRw-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: Gerd Hoffmann , Paolo Bonzini , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Laurent Vivier , Thomas Huth Subject: [PATCH v3 16/18] ui: introduce egl_init() Date: Mon, 13 Mar 2023 14:12:05 +0400 Message-Id: <20230313101207.375125-17-marcandre.lureau@redhat.com> In-Reply-To: <20230313101207.375125-1-marcandre.lureau@redhat.com> References: <20230313101207.375125-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: 1678702494132100003 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 Reviewed-by: Daniel P. Berrang=C3=A9 --- include/ui/egl-helpers.h | 2 ++ ui/dbus.c | 7 +------ ui/egl-headless.c | 16 ++++++++-------- ui/egl-helpers.c | 24 ++++++++++++++++++++++++ ui/spice-core.c | 7 +------ 5 files changed, 36 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 b11837415b..4203163ace 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,25 @@ 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; + } + display_opengl =3D 1; + return true; +#else + error_setg(errp, "egl: not available on this platform"); + return false; +#endif +} 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 Thu May 2 23:55:36 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=1678702483; cv=none; d=zohomail.com; s=zohoarc; b=djwCtSozaDvI0PEC+5gE6aIqrHOA8SUTf7eDUDVe6KoUa1TiyzGNJrYLdBUja895o7AALcxCZ9s+ikiXZ3jsJjZeYiLsbCFetLaeFX9/Lkoppla3owR6rcrwbQgM0rRpX8BTYyffLvPPEDqiUR/cW6BzpnHiNu+B/KXQPVs7sNc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1678702483; 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=H/PdDlusUV8JCJwhq04cZCZTyf3LkL8CcCXM7AjRJRU=; b=ClvRukrC8jru7oWE59nKjQGRoRoI+8i8ZyjLDCTn22HgYsbdm5qydMyY9lsK9SxO6gNAXb70XW/nbdNlKYzmW+afeSMSf62PSHWhJjqYlBzyHoDFE1Eupagacfoc36pJmvZvUtuuN9mqRyKUlclxCrtQR5nQRnNaTxZNq52Ed1I= 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 1678702483249718.7574257476634; Mon, 13 Mar 2023 03:14:43 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pbfBQ-0004ld-PF; Mon, 13 Mar 2023 06:13:36 -0400 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 1pbfBN-0004dd-Ls for qemu-devel@nongnu.org; Mon, 13 Mar 2023 06:13:33 -0400 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 1pbfBL-0004Pm-JX for qemu-devel@nongnu.org; Mon, 13 Mar 2023 06:13:33 -0400 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-460-LtVnHf7SN1iCJK82YnrvHg-1; Mon, 13 Mar 2023 06:13:26 -0400 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 7A38129ABA0C; Mon, 13 Mar 2023 10:13:26 +0000 (UTC) Received: from localhost (unknown [10.39.208.8]) by smtp.corp.redhat.com (Postfix) with ESMTP id 223AA400F52; Mon, 13 Mar 2023 10:13:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1678702410; 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=H/PdDlusUV8JCJwhq04cZCZTyf3LkL8CcCXM7AjRJRU=; b=Dy3WtwKogdYqTrl4hUKBPTuJrTJsVhI+3lxMbT+jGt2S+T3a2IWzFMYP+7YxuEOBVQpdCf 7Yk9YGTBV9t4NWntcrJk3mT4t9NRW3UNiZgAC0wFjBeaVQCOwB1Ud1J7iRBsZd7JJEcXGc WX0zNa3skIULZbf7VLn7NxlfY/e6Ar8= X-MC-Unique: LtVnHf7SN1iCJK82YnrvHg-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: Gerd Hoffmann , Paolo Bonzini , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Laurent Vivier , Thomas Huth Subject: [PATCH v3 17/18] ui/dbus: do not require opengl & gbm Date: Mon, 13 Mar 2023 14:12:06 +0400 Message-Id: <20230313101207.375125-18-marcandre.lureau@redhat.com> In-Reply-To: <20230313101207.375125-1-marcandre.lureau@redhat.com> References: <20230313101207.375125-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.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: 1678702483759100001 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 Reviewed-by: Daniel P. Berrang=C3=A9 --- meson.build | 4 ++-- ui/dbus-listener.c | 15 +++++++++++++-- ui/dbus.c | 8 ++++++++ tests/qtest/meson.build | 2 +- ui/meson.build | 4 ++-- 5 files changed, 26 insertions(+), 7 deletions(-) diff --git a/meson.build b/meson.build index 6bcab8bf0d..29f8644d6d 100644 --- a/meson.build +++ b/meson.build @@ -1746,8 +1746,8 @@ 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') \ + .require(targetos !=3D 'windows', + error_message: '-display dbus is not available on Windows') \ .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 c9292b64fb..85ea4e8d99 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 Thu May 2 23:55:36 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=1678702429; cv=none; d=zohomail.com; s=zohoarc; b=HzHBwqCFQH+6HSONb+P8dgMtf7EAtSPfFheyFgxA31+EivdbnJgsZUafJcf5f7Ck0zwos/tFuwJxVPt+4WjUns2hEdLMzPZOZrTikATc9j03wW9WwErGAneK+spdxnRdBUnONNVOZSdvMgJ6Ngc3Vt2sc/GfPdT2pitP0J55Iac= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1678702429; 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=iftSvK72EvXJlazcjjBiRTYm/5mtU4yyjtvGb3ubdCeaUP5PxW2LE9mfOO7/DnjEWxZkyYld/viR7U5HgNr0IY6pnha3uMcqG7U9WocyhG9BdvBBoX+T3OyK1DOvdnHzVjD9lxZGAyt9XjbkXlQKKIHBjE4Z6b6otAOoLUjKRhY= 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 1678702429409147.01132618044096; Mon, 13 Mar 2023 03:13:49 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pbfBU-00059P-5e; Mon, 13 Mar 2023 06:13:42 -0400 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 1pbfBR-0004st-5z for qemu-devel@nongnu.org; Mon, 13 Mar 2023 06:13:37 -0400 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 1pbfBP-0004RF-9O for qemu-devel@nongnu.org; Mon, 13 Mar 2023 06:13:36 -0400 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-170-qYqltaxpNsiEznBRRxCOpg-1; Mon, 13 Mar 2023 06:13:31 -0400 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 3119F3C0F180; Mon, 13 Mar 2023 10:13:31 +0000 (UTC) Received: from localhost (unknown [10.39.208.8]) by smtp.corp.redhat.com (Postfix) with ESMTP id 262FD2A68; Mon, 13 Mar 2023 10:13:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1678702414; 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=G7jJsYvez1WOfXQaKDd/ar46WDXeeJxHkz15m2RZ76IJ8Pr0g/ZZgez8BtnEu2faS7eNij Q3LHI9FuiQCNrDYlWJEt4C3oQpaoiVQkhWR5qtizCmTVNzPEiceFIFvMFqubfLalSuhhNK VeZBvR0N1A1wRxUWdFUITitrpTsWd98= X-MC-Unique: qYqltaxpNsiEznBRRxCOpg-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: Gerd Hoffmann , Paolo Bonzini , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Laurent Vivier , Thomas Huth Subject: [PATCH v3 18/18] ui/dbus: restrict opengl to gbm-enabled config Date: Mon, 13 Mar 2023 14:12:07 +0400 Message-Id: <20230313101207.375125-19-marcandre.lureau@redhat.com> In-Reply-To: <20230313101207.375125-1-marcandre.lureau@redhat.com> References: <20230313101207.375125-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: 1678702431622100004 From: Marc-Andr=C3=A9 Lureau We can enable EGL later for non-GBM hosts. Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Daniel P. Berrang=C3=A9 --- 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