From nobody Sat Apr 11 13:59:03 2026 Delivered-To: importer@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+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1775849271; cv=none; d=zohomail.com; s=zohoarc; b=HXGFNMxlzHUzK9qzqK0+pVwEJ1V25sKbiYc4Hrwv6GbGu1TBHTTeckY2+yQ/G8esNSKK4huInpcnLQMOEkrs0FH75r4ZHim+HnpSpsKJlbybM8v5MYwB4h3UZqqldbcM7C0Sl3bgvRMEQYE2LLaN0NZW+jwSPuQ7iKqosJAbfnI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1775849271; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=47nHfE6Dd9pBt6quFAl/2E1llNWDswiln4ygrouj+gg=; b=UeIkY/gYHePUHPn4ToiJV8Pb9flTi4QSfx11ZS6knBk5+TfbASMyc7j5yszWU7Znf/8huj61FsbVv34NXfq3zisDoIQfIfx56cwTxKn1WP09hxplGX16Ka48399M64l1IYr9WaM5nFhQDYOq7NafFIgkXc/uWDgxwl13Za9dOL8= 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+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1775849271108287.45831830348425; Fri, 10 Apr 2026 12:27:51 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wBHTD-0006wa-5e; Fri, 10 Apr 2026 15:24:47 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wBHT9-0006uw-BC for qemu-devel@nongnu.org; Fri, 10 Apr 2026 15:24:43 -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 1wBHT3-0002Wq-01 for qemu-devel@nongnu.org; Fri, 10 Apr 2026 15:24:41 -0400 Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-102-_D5yo8MAN4e06JH3MR72uA-1; Fri, 10 Apr 2026 15:24:30 -0400 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 9154C1956054 for ; Fri, 10 Apr 2026 19:24:29 +0000 (UTC) Received: from localhost (unknown [10.44.22.4]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 3A5EF1800B7F; Fri, 10 Apr 2026 19:24:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1775849071; 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=47nHfE6Dd9pBt6quFAl/2E1llNWDswiln4ygrouj+gg=; b=ZOoaJZMB9Th8UqsDkQW2qLc/oXA2Pnq0ly2VA0Pyaj/dGbgNVab997JyJHU31WgSYZh5aU L7eW0Z7f9KHtpIIJd7gnbY4LbT/uI//Oy3wlFmBier1GSugvaLqRGZnNSmvb8k3RbbzfKX AD77fyFcNcmoYrftHbXuS/U14/7Zeyo= X-MC-Unique: _D5yo8MAN4e06JH3MR72uA-1 X-Mimecast-MFC-AGG-ID: _D5yo8MAN4e06JH3MR72uA_1775849069 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Fri, 10 Apr 2026 23:19:18 +0400 Subject: [PATCH v2 56/67] ui/console: remove qemu_console_is_visible() MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260410-qemu-vnc-v2-56-231416f76dc3@redhat.com> References: <20260410-qemu-vnc-v2-0-231416f76dc3@redhat.com> In-Reply-To: <20260410-qemu-vnc-v2-0-231416f76dc3@redhat.com> To: qemu-devel@nongnu.org Cc: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= X-Developer-Signature: v=1; a=openpgp-sha256; l=4788; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=bhOtDgVb1DVTenfIM+HhCL9wwiQsu901e9ovryHDGss=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBp2U0WKugkNcO1CV/g75fF1+WLsZe8xJrL04bPc 3TW1FYBHCKJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCadlNFgAKCRDa6OEJdZac 5ZBqEACBp2I4fJr0Qhn8DKAjRPEF/BAumW7Q4SwO5Tmt8ZEmq2MbsjoiE9QfaVQXnFY80j4MhZi 2ltqmjQPzOnSmywsNqEKaeL3FNu6qtzvc8t1ncQXsTe65zzp5D30632OmBlO+sSPOKT/ml8gj5H K+2UAWim4XG4lVR7hHHfklj3hNN07q9zW1lv6gT6x21wdnWT9v4Zwwi6XsFD5KzAcTuOLbqBKDR sa1mur0jLsL5hnXvzSBqzNKJKundjvECeHXP2Zs3KDJK8ShjiOnXsFiB8ZTNZT7vPBd6RAgGUYY BcJnoyM8XjEpWs2V8d0yAzgvisJ1fmiBN4cKLRsQjzo7qAFWc0kc0OvHD1Wz1XqPwPYDT86Au3G Qv2tSTGq6TCW4pj+q8vkrcJYB6imoZ8F7KV1E9l0eBbIHhgE1ZqDORC3Mb5SftVZq5UBBclATXP seJ572Im2LkYkqwM/Jc7pc5ULChjB4K7NbJJUAJj6ytU81vWVDBp+DMoRIrxN5sQXfCrRHlhr2A IQQEuLWTNATtxdWGyjigoYGBGj83ETKqexgediHspoznTUo5AWbhUuAl4GyrtIA3jQuWKCSQbvd hUQdvW+pDdtUIaQ5Siom2iZt2ukDJJABfKTYFrW+OZLrsAmWrjd5ApAHV5pF3Ml/sJSskdDp89q NH9jYmcKFtw4H3g== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 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+importer=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: 7 X-Spam_score: 0.7 X-Spam_bar: / X-Spam_report: (0.7 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.54, 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, RCVD_IN_SBL_CSS=3.335, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1775849272624154100 Drop the bookkeeping, we can simply afford an empty "foreach". Notice that dpy_gfx_update_texture() is now called even when there are no listeners. This is more correct, as the texture is not fully refreshed when a listener connects, so it may be outdated/garbaged. Reviewed-by: Daniel P. Berrang=C3=A9 Signed-off-by: Marc-Andr=C3=A9 Lureau --- include/ui/console.h | 1 - ui/console-priv.h | 1 - ui/console.c | 29 ----------------------------- 3 files changed, 31 deletions(-) diff --git a/include/ui/console.h b/include/ui/console.h index b3aaf3ff12b..472c188a727 100644 --- a/include/ui/console.h +++ b/include/ui/console.h @@ -392,7 +392,6 @@ 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); 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); bool qemu_console_is_gl_blocked(QemuConsole *con); diff --git a/ui/console-priv.h b/ui/console-priv.h index f8855753e30..4f731b4f9ce 100644 --- a/ui/console-priv.h +++ b/ui/console-priv.h @@ -16,7 +16,6 @@ struct QemuConsole { DisplayState *ds; DisplaySurface *surface; DisplayScanout scanout; - int dcls; DisplayGLCtx *gl; int gl_block; QEMUTimer *gl_unblock_timer; diff --git a/ui/console.c b/ui/console.c index a9132e09eac..baffdeb22b1 100644 --- a/ui/console.c +++ b/ui/console.c @@ -650,9 +650,6 @@ void register_displaychangelistener(DisplayChangeListen= er *dcl) dcl->ds =3D get_alloc_displaystate(); QLIST_INSERT_HEAD(&dcl->ds->listeners, dcl, next); gui_setup_refresh(dcl->ds); - if (dcl->con) { - dcl->con->dcls++; - } displaychangelistener_display_console(dcl, &error_fatal); if (QEMU_IS_GRAPHIC_CONSOLE(dcl->con)) { dcl_set_graphic_cursor(dcl, QEMU_GRAPHIC_CONSOLE(dcl->con)); @@ -680,9 +677,6 @@ void unregister_displaychangelistener(DisplayChangeList= ener *dcl) if (!ds) { return; } - if (dcl->con) { - dcl->con->dcls--; - } QLIST_REMOVE(dcl, next); dcl->ds =3D NULL; gui_setup_refresh(ds); @@ -747,9 +741,6 @@ void dpy_gfx_update(QemuConsole *con, int x, int y, int= w, int h) w =3D MIN(w, width - x); h =3D MIN(h, height - y); =20 - if (!qemu_console_is_visible(con)) { - return; - } dpy_gfx_update_texture(con, con->surface, x, y, w, h); QLIST_FOREACH(dcl, &s->listeners, next) { if (con !=3D dcl->con) { @@ -848,9 +839,6 @@ void dpy_text_cursor(QemuConsole *con, int x, int y) DisplayState *s =3D con->ds; DisplayChangeListener *dcl; =20 - if (!qemu_console_is_visible(con)) { - return; - } QLIST_FOREACH(dcl, &s->listeners, next) { if (con !=3D dcl->con) { continue; @@ -866,9 +854,6 @@ void dpy_text_update(QemuConsole *con, int x, int y, in= t w, int h) DisplayState *s =3D con->ds; DisplayChangeListener *dcl; =20 - if (!qemu_console_is_visible(con)) { - return; - } QLIST_FOREACH(dcl, &s->listeners, next) { if (con !=3D dcl->con) { continue; @@ -884,9 +869,6 @@ void dpy_text_resize(QemuConsole *con, int w, int h) DisplayState *s =3D con->ds; DisplayChangeListener *dcl; =20 - if (!qemu_console_is_visible(con)) { - return; - } QLIST_FOREACH(dcl, &s->listeners, next) { if (con !=3D dcl->con) { continue; @@ -906,9 +888,6 @@ void dpy_mouse_set(QemuConsole *c, int x, int y, bool o= n) con->cursor_x =3D x; con->cursor_y =3D y; con->cursor_on =3D on; - if (!qemu_console_is_visible(c)) { - return; - } QLIST_FOREACH(dcl, &s->listeners, next) { if (c !=3D dcl->con) { continue; @@ -927,9 +906,6 @@ void dpy_cursor_define(QemuConsole *c, QEMUCursor *curs= or) =20 cursor_unref(con->cursor); con->cursor =3D cursor_ref(cursor); - if (!qemu_console_is_visible(c)) { - return; - } QLIST_FOREACH(dcl, &s->listeners, next) { if (c !=3D dcl->con) { continue; @@ -1287,11 +1263,6 @@ QEMUCursor *qemu_console_get_cursor(QemuConsole *con) return QEMU_IS_GRAPHIC_CONSOLE(con) ? QEMU_GRAPHIC_CONSOLE(con)->curso= r : NULL; } =20 -bool qemu_console_is_visible(QemuConsole *con) -{ - return con->dcls > 0; -} - bool qemu_console_is_graphic(QemuConsole *con) { return con && QEMU_IS_GRAPHIC_CONSOLE(con); --=20 2.53.0