From nobody Mon Nov 17 23:49:51 2025 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=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1606994471; cv=none; d=zohomail.com; s=zohoarc; b=S7jqIZVXreMCytY5wUIM0Gr3No6n9ar28SKVlEdNWuWFzK2v+iCNY2AJeJcA7XUYWFqveGjq5mD+KDj1XGtzL9rS8rpNeScgiZUKscup7kQ1JQyuQIIYSAcenQJuNeIihihSguTUOeop4TD+wIyFrRCieDDktFH6AP9kfz9I8dU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606994471; 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=zdFb8vObo36jbpyMLYFdy97m3VFRm+fPrpMC6UrJYwQ=; b=UJz3R6TFhGo9DJyYtWxlw1PxOd1w5D3iNg4mvCR1bvGOS1zblNuJc5+UhdJmOcYCh73S8rN7WocCJ6kYVIMYq+zh9fqSGN5ypZSPD3OiGI7C5YiwABlcI/iG+5XchAD49s0ei67CSPFUorm6wBa1OKrfG9yz5poizQnr9kRaW+0= 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=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1606994471725304.25947386881376; Thu, 3 Dec 2020 03:21:11 -0800 (PST) Received: from localhost ([::1]:35752 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kkmfe-0000t6-MS for importer@patchew.org; Thu, 03 Dec 2020 06:21:10 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:50666) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kkmTE-00039d-3b for qemu-devel@nongnu.org; Thu, 03 Dec 2020 06:08:20 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:22238) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kkmT8-0006dD-MN for qemu-devel@nongnu.org; Thu, 03 Dec 2020 06:08:19 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-509-gZWjGa3uP-W6_zmLAUZ9gg-1; Thu, 03 Dec 2020 06:08:11 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id D10973E747 for ; Thu, 3 Dec 2020 11:08:10 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-112-94.ams2.redhat.com [10.36.112.94]) by smtp.corp.redhat.com (Postfix) with ESMTP id DA8BC18A60; Thu, 3 Dec 2020 11:08:06 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 0D41D9D92; Thu, 3 Dec 2020 12:08:06 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606993693; 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=zdFb8vObo36jbpyMLYFdy97m3VFRm+fPrpMC6UrJYwQ=; b=XfjNk1brnM1kj/A1/N0m72xU45kZnBjvL0BQ92O7qVkT7gcX9dG3ST89ZuaLd+eVDTIf2p Y65yi2XaThYkA+uEHUSK0dTzIIapO3OJAZHVLh8jcLhQi/FS5kvdW4UOyoocivETcrZyb9 M5OXPjFBy4Lj2BVYS9ZEpuoRk9y0de0= X-MC-Unique: gZWjGa3uP-W6_zmLAUZ9gg-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PATCH 1/9] console: allow con==NULL in dpy_set_ui_info Date: Thu, 3 Dec 2020 12:07:57 +0100 Message-Id: <20201203110806.13556-2-kraxel@redhat.com> In-Reply-To: <20201203110806.13556-1-kraxel@redhat.com> References: <20201203110806.13556-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kraxel@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable 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=216.205.24.124; envelope-from=kraxel@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.495, 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_H3=0.001, RCVD_IN_MSPIKE_WL=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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Gerd Hoffmann Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Use active_console in that case like we do in many other places. Signed-off-by: Gerd Hoffmann --- ui/console.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ui/console.c b/ui/console.c index 53dee8e26b17..16b326854080 100644 --- a/ui/console.c +++ b/ui/console.c @@ -1556,7 +1556,9 @@ const QemuUIInfo *dpy_get_ui_info(const QemuConsole *= con) =20 int dpy_set_ui_info(QemuConsole *con, QemuUIInfo *info) { - assert(con !=3D NULL); + if (con =3D=3D NULL) { + con =3D active_console; + } =20 if (!dpy_ui_info_supported(con)) { return -1; --=20 2.27.0 From nobody Mon Nov 17 23:49:51 2025 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=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1606996174; cv=none; d=zohomail.com; s=zohoarc; b=AXw3ebwA53yTkdZdygVKjfJ1VIpV+DlKbb+asp6OG0t355+GWEM9vrjxffQFWi/yUqljL9l2l2yxFwJuuJ0Hxk8kZ4mGZWur4UsOWSu/ZE0Y7uL2k6BBhvMpyqNun3feRzbaKBCUSl5u1zLMWVm86wBQJut+n6a/5xcCQi5Ms10= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606996174; 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=m+8n2MMAKDUhkWx/cgfOhRJfN/bIIYVRnw9ZPuOIHuA=; b=dlMo1408cmqu0VTFrBmmVI8IXCHV2J/rjaOkNmhs/aRGv+zGAYYrDZ/xcQ1aRSzsr2xbkqiGoKMLjy8699zRSVIhRa4aXT7sBPvFu7P+kMqHsbu+0KYGBAQlf/GSYwKhq1vTCDWQbA7qZ0bK6Rnp210Tum+Vrp0J2PmOHeUZ9tM= 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=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1606996174737730.3808269100198; Thu, 3 Dec 2020 03:49:34 -0800 (PST) Received: from localhost ([::1]:35502 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kkmUt-0004qW-3Q for importer@patchew.org; Thu, 03 Dec 2020 06:10:03 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:50618) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kkmTA-00038K-Od for qemu-devel@nongnu.org; Thu, 03 Dec 2020 06:08:16 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:25048) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kkmT7-0006c6-Hi for qemu-devel@nongnu.org; Thu, 03 Dec 2020 06:08:16 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-2-d3ajYMByOWuj0c7Eixl-jw-1; Thu, 03 Dec 2020 06:08:11 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 318428049C3 for ; Thu, 3 Dec 2020 11:08:10 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-112-94.ams2.redhat.com [10.36.112.94]) by smtp.corp.redhat.com (Postfix) with ESMTP id ED3215C1B4; Thu, 3 Dec 2020 11:08:06 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 1657C9D99; Thu, 3 Dec 2020 12:08:06 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606993692; 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=m+8n2MMAKDUhkWx/cgfOhRJfN/bIIYVRnw9ZPuOIHuA=; b=Hhfz3g7nCv+Bf5a56WxlzHF6Vs7NIPTv69ISBgAGi+A8HwtJvNldYIk0rNGkK6zTYmbBsO fY4J8L+2PvYxX4ypk2Bn9dx2M01zRMEC60sQtH6pFZaSvBKJCHe+YeDDjqzu8k1SZzzqA3 Aywl6sahGjsQ4z4EXFiwlc2q4GjphDw= X-MC-Unique: d3ajYMByOWuj0c7Eixl-jw-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PATCH 2/9] console: add check for ui_info pointer Date: Thu, 3 Dec 2020 12:07:58 +0100 Message-Id: <20201203110806.13556-3-kraxel@redhat.com> In-Reply-To: <20201203110806.13556-1-kraxel@redhat.com> References: <20201203110806.13556-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kraxel@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable 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=kraxel@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.495, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, 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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Gerd Hoffmann Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Verify the hw_ops->ui_info function pointer is non-zero before calling it. Can be triggered by qxl which changes hw_ops when switching between qxl-native and vga-compat modes. Signed-off-by: Gerd Hoffmann --- ui/console.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ui/console.c b/ui/console.c index 16b326854080..8930808d0b6d 100644 --- a/ui/console.c +++ b/ui/console.c @@ -1539,7 +1539,9 @@ static void dpy_set_ui_info_timer(void *opaque) { QemuConsole *con =3D opaque; =20 - con->hw_ops->ui_info(con->hw, con->head, &con->ui_info); + if (con->hw_ops->ui_info) { + con->hw_ops->ui_info(con->hw, con->head, &con->ui_info); + } } =20 bool dpy_ui_info_supported(QemuConsole *con) --=20 2.27.0 From nobody Mon Nov 17 23:49:51 2025 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=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1606996448; cv=none; d=zohomail.com; s=zohoarc; b=Pv+FlR5RRrVRJ4ZAqTIqPt0FHGjwfQ9Rki45Whgdezm/ijrfBM2eMd0BOPdc4Z7Csz0LiBL8gjw6MqtvXKRw5XShGM9YMplF3RyKLhVvhnFrqIfCMQ27OBZcO/170Gl/TPeWbXBj1wAJGqz/QcmfzVv+ukSXFa4SAGj4liDIJHc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606996448; 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=wATdUT3jb3LYaMMaChvSsGlqtjpYUxvVyTQueya0Zyg=; b=ElTeXcp+9znnwQOw/ZjE2fAZPJMTh5RMSjefsQ60IlI95xwFhkaEixB0Y7FxcAHDf7Yslzhqvw3iXGNIf6KOFESw5XzlvIO7SeYwwy4gnbuVNpsv6YZi5Con09h6p+bEz8Syukcpt370j0sBql3n414TDvypPTnnt4uxzHd9rrQ= 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=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1606996448466245.43756603979512; Thu, 3 Dec 2020 03:54:08 -0800 (PST) Received: from localhost ([::1]:35806 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kkmUw-0004zG-7o for importer@patchew.org; Thu, 03 Dec 2020 06:10:06 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:50658) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kkmTD-00039Z-86 for qemu-devel@nongnu.org; Thu, 03 Dec 2020 06:08:20 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:28208) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kkmT8-0006cG-JM for qemu-devel@nongnu.org; Thu, 03 Dec 2020 06:08:19 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-590-G0SjXDsMNcq-oP4MBVhnSg-1; Thu, 03 Dec 2020 06:08:11 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 8E904107AD94 for ; Thu, 3 Dec 2020 11:08:10 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-112-94.ams2.redhat.com [10.36.112.94]) by smtp.corp.redhat.com (Postfix) with ESMTP id ED40E1A838; Thu, 3 Dec 2020 11:08:06 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 249099D9B; Thu, 3 Dec 2020 12:08:06 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606993693; 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=wATdUT3jb3LYaMMaChvSsGlqtjpYUxvVyTQueya0Zyg=; b=J+mQk9xQi35lg8u7uM69pArC0BDiKD9YOdWwfJro1RXDJNVLA9/+gGgSxscAXdq40oLVWz 3dY+qf9F+yseHoOjEul6GvL1bQzGH3c/NoxGGjSgf2S1Lh7mHU4ufUo+HpVfbSU3G5UcIG sLL3huHPNjb8r0J1KyH8rqvpiPHWyPw= X-MC-Unique: G0SjXDsMNcq-oP4MBVhnSg-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PATCH 3/9] vnc: use enum for features Date: Thu, 3 Dec 2020 12:07:59 +0100 Message-Id: <20201203110806.13556-4-kraxel@redhat.com> In-Reply-To: <20201203110806.13556-1-kraxel@redhat.com> References: <20201203110806.13556-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kraxel@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable 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=63.128.21.124; envelope-from=kraxel@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.495, 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_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, UPPERCASE_50_75=0.008 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Gerd Hoffmann Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Use an enum for the vnc feature bits. That way they are enumerated automatically and we don't have to do that manually when adding or removing features. Signed-off-by: Gerd Hoffmann Reviewed-by: Marc-Andr=C3=A9 Lureau --- ui/vnc.h | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/ui/vnc.h b/ui/vnc.h index 4e2637ce6c5c..262fcf179b44 100644 --- a/ui/vnc.h +++ b/ui/vnc.h @@ -438,18 +438,20 @@ enum { * *************************************************************************= ****/ =20 -#define VNC_FEATURE_RESIZE 0 -#define VNC_FEATURE_HEXTILE 1 -#define VNC_FEATURE_POINTER_TYPE_CHANGE 2 -#define VNC_FEATURE_WMVI 3 -#define VNC_FEATURE_TIGHT 4 -#define VNC_FEATURE_ZLIB 5 -#define VNC_FEATURE_COPYRECT 6 -#define VNC_FEATURE_RICH_CURSOR 7 -#define VNC_FEATURE_TIGHT_PNG 8 -#define VNC_FEATURE_ZRLE 9 -#define VNC_FEATURE_ZYWRLE 10 -#define VNC_FEATURE_LED_STATE 11 +enum VncFeatures { + VNC_FEATURE_RESIZE, + VNC_FEATURE_HEXTILE, + VNC_FEATURE_POINTER_TYPE_CHANGE, + VNC_FEATURE_WMVI, + VNC_FEATURE_TIGHT, + VNC_FEATURE_ZLIB, + VNC_FEATURE_COPYRECT, + VNC_FEATURE_RICH_CURSOR, + VNC_FEATURE_TIGHT_PNG, + VNC_FEATURE_ZRLE, + VNC_FEATURE_ZYWRLE, + VNC_FEATURE_LED_STATE, +}; =20 #define VNC_FEATURE_RESIZE_MASK (1 << VNC_FEATURE_RESIZE) #define VNC_FEATURE_HEXTILE_MASK (1 << VNC_FEATURE_HEXTILE) --=20 2.27.0 From nobody Mon Nov 17 23:49:51 2025 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=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1606994478; cv=none; d=zohomail.com; s=zohoarc; b=TTo4JcQTi8cJ2m3lUW847xe47MfdcgpTz2qXp+O7f0j4P8yLCxlmaW/zV+FEBdQ0KmdOsrvdgUgLeLKVc0rK2z2ynCwGQEy9AB3quexIY+mAQrn3HZfKiRKDNWyHDCm9S7Ns00KLf7W0RLqWAWsEAKk3NhD5WstDy7j3K8M4Tw4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606994478; 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=z2rAMvJaEpmgH5hlnaGVQ4GwKIYO5cThsshz4AHj+pY=; b=ikAIMuJD8CM3x5axKvBJ6h5vdSpBdqk7bqJesf6W2sPKNwED+Lv9B9LCBMbA+nDgDTbNG0tFOThIIt1WN+PnoOedgM+eqiL6Pc/tLakTCFN/PNPYTCRT/ojsksNExFmY5gEiwdgw2qJPO/OrB7AyNpFjoi+NRIs7uA0a/K2pGKw= 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=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1606994478138298.2153562769512; Thu, 3 Dec 2020 03:21:18 -0800 (PST) Received: from localhost ([::1]:59622 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kkmcf-0007GN-Ea for importer@patchew.org; Thu, 03 Dec 2020 06:18:05 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:50630) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kkmTB-00038h-0N for qemu-devel@nongnu.org; Thu, 03 Dec 2020 06:08:17 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:21723) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kkmT8-0006c8-JC for qemu-devel@nongnu.org; Thu, 03 Dec 2020 06:08:16 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-180-qa5Tsoy-OaOYmcID-8LwcA-1; Thu, 03 Dec 2020 06:08:11 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 25E448049C0 for ; Thu, 3 Dec 2020 11:08:10 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-112-94.ams2.redhat.com [10.36.112.94]) by smtp.corp.redhat.com (Postfix) with ESMTP id E21025D6AC; Thu, 3 Dec 2020 11:08:06 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 2FB949D9C; Thu, 3 Dec 2020 12:08:06 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606993692; 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=z2rAMvJaEpmgH5hlnaGVQ4GwKIYO5cThsshz4AHj+pY=; b=bh08kBJbLmGX6aStcXDu0M36DgAKn8zFMn/SuwRI5in8kosX3+GFkSt8lncOHmWT1Q3uRw jCQpQ6Ov5XyW7RZo5jqN1vTNPevCb/UaybOVnO/V0cGQztpbOzWmSFpwJRS25rCoul28qr oowrVFIi7JpYzVd0EqWlOpiIqbYFdao= X-MC-Unique: qa5Tsoy-OaOYmcID-8LwcA-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PATCH 4/9] vnc: drop unused copyrect feature Date: Thu, 3 Dec 2020 12:08:00 +0100 Message-Id: <20201203110806.13556-5-kraxel@redhat.com> In-Reply-To: <20201203110806.13556-1-kraxel@redhat.com> References: <20201203110806.13556-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kraxel@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable 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=63.128.21.124; envelope-from=kraxel@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.495, 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_H4=0.001, RCVD_IN_MSPIKE_WL=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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Gerd Hoffmann Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" vnc stopped using the copyrect pseudo encoding in 2017, in commit 50628d3479e4 ("cirrus/vnc: zap bitblit support from console code.") So we can drop the now unused copyrect feature bit. Signed-off-by: Gerd Hoffmann Reviewed-by: Marc-Andr=C3=A9 Lureau --- ui/vnc.h | 2 -- ui/vnc.c | 3 --- 2 files changed, 5 deletions(-) diff --git a/ui/vnc.h b/ui/vnc.h index 262fcf179b44..a7fd38a82075 100644 --- a/ui/vnc.h +++ b/ui/vnc.h @@ -445,7 +445,6 @@ enum VncFeatures { VNC_FEATURE_WMVI, VNC_FEATURE_TIGHT, VNC_FEATURE_ZLIB, - VNC_FEATURE_COPYRECT, VNC_FEATURE_RICH_CURSOR, VNC_FEATURE_TIGHT_PNG, VNC_FEATURE_ZRLE, @@ -459,7 +458,6 @@ enum VncFeatures { #define VNC_FEATURE_WMVI_MASK (1 << VNC_FEATURE_WMVI) #define VNC_FEATURE_TIGHT_MASK (1 << VNC_FEATURE_TIGHT) #define VNC_FEATURE_ZLIB_MASK (1 << VNC_FEATURE_ZLIB) -#define VNC_FEATURE_COPYRECT_MASK (1 << VNC_FEATURE_COPYRECT) #define VNC_FEATURE_RICH_CURSOR_MASK (1 << VNC_FEATURE_RICH_CURSOR) #define VNC_FEATURE_TIGHT_PNG_MASK (1 << VNC_FEATURE_TIGHT_PNG) #define VNC_FEATURE_ZRLE_MASK (1 << VNC_FEATURE_ZRLE) diff --git a/ui/vnc.c b/ui/vnc.c index 49235056f7a8..8c2771c1ce3b 100644 --- a/ui/vnc.c +++ b/ui/vnc.c @@ -2061,9 +2061,6 @@ static void set_encodings(VncState *vs, int32_t *enco= dings, size_t n_encodings) case VNC_ENCODING_RAW: vs->vnc_encoding =3D enc; break; - case VNC_ENCODING_COPYRECT: - vs->features |=3D VNC_FEATURE_COPYRECT_MASK; - break; case VNC_ENCODING_HEXTILE: vs->features |=3D VNC_FEATURE_HEXTILE_MASK; vs->vnc_encoding =3D enc; --=20 2.27.0 From nobody Mon Nov 17 23:49:51 2025 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=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1606994925; cv=none; d=zohomail.com; s=zohoarc; b=Lzxf+WOmq/ML0yu3095JTskGkKrLDgWJWFvravb0vH7OKDyxw7iDNl8QC4fZPeor98lHF28yWRDf/CYJT6deLSYdR3Hx7LZBKAjpk8kIUSICVV30t1up31oA7uB2xRFdoLgXsA5WgphZ/P/NmU+2iFkT6/XJTuf+S+taB9CCqtM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606994925; 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=gys/23n4pIXi5Aux/Cqj55XONYqharfxB6pEHFwvkEk=; b=Z3F8xblYq4JUrW1VH4C4BxoA+dPnYnilsK4uMwl6aigQUKFrEoi81RX1ypoMzBbrj5bbxXuaCtkfmuG6VBP1g4Q57MonSCGnorkIq8ZUSjjFyX3mE9KoR+0foNLCaDuviT5ohrZ/7j6jgu3HXwDLj0mBNI8ZtGeU8NQpA+T9fag= 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=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1606994925741417.2428786606948; Thu, 3 Dec 2020 03:28:45 -0800 (PST) Received: from localhost ([::1]:55042 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kkmad-0004zB-Hj for importer@patchew.org; Thu, 03 Dec 2020 06:15:59 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:50712) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kkmTG-0003Da-MW for qemu-devel@nongnu.org; Thu, 03 Dec 2020 06:08:22 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:31577) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kkmTC-0006dm-Uz for qemu-devel@nongnu.org; Thu, 03 Dec 2020 06:08:22 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-64-iqv87BSdP8GeRjERdv18AA-1; Thu, 03 Dec 2020 06:08:14 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 13EA2185E496 for ; Thu, 3 Dec 2020 11:08:14 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-112-94.ams2.redhat.com [10.36.112.94]) by smtp.corp.redhat.com (Postfix) with ESMTP id E983F60BFA; Thu, 3 Dec 2020 11:08:10 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 388C59D9D; Thu, 3 Dec 2020 12:08:06 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606993696; 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=gys/23n4pIXi5Aux/Cqj55XONYqharfxB6pEHFwvkEk=; b=TlQOtyl0CVNkaqQOddlfm5uy7KDU/R5EVMQCeMDWo4M21yh8iHIg067JixLEhNDaLLI2q/ FEyCWXA9J2cOWnenDiyejBzAIb1EPTUdtZhfy1IA1OuyS1XYHWayV3VhX+QmKRD2L9ch0t cFQLnJ74w7oV2PnCN8/2KKTI+8BFw2A= X-MC-Unique: iqv87BSdP8GeRjERdv18AA-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PATCH 5/9] vnc: add pseudo encodings Date: Thu, 3 Dec 2020 12:08:01 +0100 Message-Id: <20201203110806.13556-6-kraxel@redhat.com> In-Reply-To: <20201203110806.13556-1-kraxel@redhat.com> References: <20201203110806.13556-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kraxel@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable 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=63.128.21.124; envelope-from=kraxel@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.495, 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_H4=0.001, RCVD_IN_MSPIKE_WL=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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Gerd Hoffmann Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Add #defines for two new pseudo encodings: * cursor with alpha channel. * extended desktop resize. Signed-off-by: Gerd Hoffmann Reviewed-by: Marc-Andr=C3=A9 Lureau --- ui/vnc.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ui/vnc.h b/ui/vnc.h index a7fd38a82075..6f5006da3593 100644 --- a/ui/vnc.h +++ b/ui/vnc.h @@ -411,6 +411,8 @@ enum { #define VNC_ENCODING_AUDIO 0XFFFFFEFD /* -259 */ #define VNC_ENCODING_TIGHT_PNG 0xFFFFFEFC /* -260 */ #define VNC_ENCODING_LED_STATE 0XFFFFFEFB /* -261 */ +#define VNC_ENCODING_DESKTOP_RESIZE_EXT 0XFFFFFECC /* -308 */ +#define VNC_ENCODING_ALPHA_CURSOR 0XFFFFFEC6 /* -314 */ #define VNC_ENCODING_WMVi 0x574D5669 =20 /*************************************************************************= **** --=20 2.27.0 From nobody Mon Nov 17 23:49:51 2025 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=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1606996169; cv=none; d=zohomail.com; s=zohoarc; b=ixGt5KKZ3gPFLr+3r5Hpbr7+aB+vPVEhaI/EcSZ/29g1LErc7WIuAtLXGISAmwzKkVzIHOgjFpJ9AkW6DMIn9uPKUTZvpU97zhFdFB3HDEusHYYeFaxbHtX7WIHILpSTcBmgL9FzcqpnsQ4NpKfYKcrDaNHVI8W+64SW4iyEmck= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606996169; 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=2WTxpHnWs+oqSEw8f5c2PR+I/NQ62rxuDq+0XaHTRQM=; b=mm4XxqyKzFChckxhKZoXhXppqM3Rckr1V1bMA22nTBvQbBLOn+BWRQ51VcbxCu4XknlJ9Z0A1syPtwoQWOIBYB073TvPA8GMtd1qZH3TsYu3vj5WU9Wbz8H677wIzr1GqdstQlwMWZskDOT8Wn/RwpuORuq/oOW5NLQgvZ8+IJw= 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=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1606996169160682.7464090052082; Thu, 3 Dec 2020 03:49:29 -0800 (PST) Received: from localhost ([::1]:44122 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kkmX4-0000CN-M8 for importer@patchew.org; Thu, 03 Dec 2020 06:12:18 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:50716) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kkmTG-0003E1-SU for qemu-devel@nongnu.org; Thu, 03 Dec 2020 06:08:22 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:35012) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kkmTC-0006e6-VG for qemu-devel@nongnu.org; Thu, 03 Dec 2020 06:08:22 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-272-QHVhDNDrMPq7gqHtBuDNcQ-1; Thu, 03 Dec 2020 06:08:15 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id AF7521005E56 for ; Thu, 3 Dec 2020 11:08:14 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-112-94.ams2.redhat.com [10.36.112.94]) by smtp.corp.redhat.com (Postfix) with ESMTP id E8E8D60855; Thu, 3 Dec 2020 11:08:10 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 430789D9E; Thu, 3 Dec 2020 12:08:06 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606993698; 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=2WTxpHnWs+oqSEw8f5c2PR+I/NQ62rxuDq+0XaHTRQM=; b=A7LjrXuNqcNhZlHStmXTnm7UlhJIxrDmKOJ7jEjnNKSwFUAzfoRMzq87zhj4m1KcvLa9gq 5zX09T9mwfF14sBZPyd0vZL6dN/ZmVxboZAbf29/iCOSSqMSODhAPV9uVvD7WalxoEWj7K 0fL0evct5jNjfBw69glIn2gYio7iwfQ= X-MC-Unique: QHVhDNDrMPq7gqHtBuDNcQ-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PATCH 6/9] vnc: add alpha cursor support Date: Thu, 3 Dec 2020 12:08:02 +0100 Message-Id: <20201203110806.13556-7-kraxel@redhat.com> In-Reply-To: <20201203110806.13556-1-kraxel@redhat.com> References: <20201203110806.13556-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kraxel@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable 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=63.128.21.124; envelope-from=kraxel@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.495, 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_H4=0.001, RCVD_IN_MSPIKE_WL=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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Gerd Hoffmann Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" There is a new vnc extension for cursors with an alpha channel. Use it if supported by the vnc client, prefer it over the "rich cursor" extension which supports only a bitmask for transparency. This is a visible improvement especially on modern desktops which actually use the alpha channel when defining cursors. https://github.com/rfbproto/rfbproto/blob/master/rfbproto.rst#cursor-with-a= lpha-pseudo-encoding Signed-off-by: Gerd Hoffmann Reviewed-by: Marc-Andr=C3=A9 Lureau --- ui/vnc.h | 2 ++ ui/vnc.c | 21 ++++++++++++++++++--- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/ui/vnc.h b/ui/vnc.h index 6f5006da3593..c8d3ad9ec496 100644 --- a/ui/vnc.h +++ b/ui/vnc.h @@ -448,6 +448,7 @@ enum VncFeatures { VNC_FEATURE_TIGHT, VNC_FEATURE_ZLIB, VNC_FEATURE_RICH_CURSOR, + VNC_FEATURE_ALPHA_CURSOR, VNC_FEATURE_TIGHT_PNG, VNC_FEATURE_ZRLE, VNC_FEATURE_ZYWRLE, @@ -461,6 +462,7 @@ enum VncFeatures { #define VNC_FEATURE_TIGHT_MASK (1 << VNC_FEATURE_TIGHT) #define VNC_FEATURE_ZLIB_MASK (1 << VNC_FEATURE_ZLIB) #define VNC_FEATURE_RICH_CURSOR_MASK (1 << VNC_FEATURE_RICH_CURSOR) +#define VNC_FEATURE_ALPHA_CURSOR_MASK (1 << VNC_FEATURE_ALPHA_CURSO= R) #define VNC_FEATURE_TIGHT_PNG_MASK (1 << VNC_FEATURE_TIGHT_PNG) #define VNC_FEATURE_ZRLE_MASK (1 << VNC_FEATURE_ZRLE) #define VNC_FEATURE_ZYWRLE_MASK (1 << VNC_FEATURE_ZYWRLE) diff --git a/ui/vnc.c b/ui/vnc.c index 8c2771c1ce3b..247e80d8f5c8 100644 --- a/ui/vnc.c +++ b/ui/vnc.c @@ -937,6 +937,18 @@ static int vnc_cursor_define(VncState *vs) QEMUCursor *c =3D vs->vd->cursor; int isize; =20 + if (vnc_has_feature(vs, VNC_FEATURE_ALPHA_CURSOR)) { + vnc_lock_output(vs); + vnc_write_u8(vs, VNC_MSG_SERVER_FRAMEBUFFER_UPDATE); + vnc_write_u8(vs, 0); /* padding */ + vnc_write_u16(vs, 1); /* # of rects */ + vnc_framebuffer_update(vs, c->hot_x, c->hot_y, c->width, c->height, + VNC_ENCODING_ALPHA_CURSOR); + vnc_write_s32(vs, VNC_ENCODING_RAW); + vnc_write(vs, c->data, c->width * c->height * 4); + vnc_unlock_output(vs); + return 0; + } if (vnc_has_feature(vs, VNC_FEATURE_RICH_CURSOR)) { vnc_lock_output(vs); vnc_write_u8(vs, VNC_MSG_SERVER_FRAMEBUFFER_UPDATE); @@ -2102,9 +2114,9 @@ static void set_encodings(VncState *vs, int32_t *enco= dings, size_t n_encodings) break; case VNC_ENCODING_RICH_CURSOR: vs->features |=3D VNC_FEATURE_RICH_CURSOR_MASK; - if (vs->vd->cursor) { - vnc_cursor_define(vs); - } + break; + case VNC_ENCODING_ALPHA_CURSOR: + vs->features |=3D VNC_FEATURE_ALPHA_CURSOR_MASK; break; case VNC_ENCODING_EXT_KEY_EVENT: send_ext_key_event_ack(vs); @@ -2134,6 +2146,9 @@ static void set_encodings(VncState *vs, int32_t *enco= dings, size_t n_encodings) vnc_desktop_resize(vs); check_pointer_type_change(&vs->mouse_mode_notifier, NULL); vnc_led_state_change(vs); + if (vs->vd->cursor) { + vnc_cursor_define(vs); + } } =20 static void set_pixel_conversion(VncState *vs) --=20 2.27.0 From nobody Mon Nov 17 23:49:51 2025 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=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1606996171; cv=none; d=zohomail.com; s=zohoarc; b=nKuhC6sNyCBTuruygUTOFwadM1WpL55H+bOqg2JFV/DGA7I8R4J558niH46BZavEkbXNzKxypLf10Jd37jziklcdF5w7dqkThe6s89xojXCpBsXuSZR18CMHEXZCgQpbs3SAjxutiP/NEEdqog+Drdpif76vzKYqE6rJ7H9MltM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606996171; 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=FfDnnqZhMg8ve3HQG0wHiEoFXbDMSDaubQU0AousCJA=; b=fZWH+s+6B/yseRxeJJlSAFrkmvHdeA+WNdQHZvzu/a7CUSvIj9npkuYaRFEC/Ubu9yUL/UNndcK1IOu7qmbZel5GobWKoV1ieTle+6U0DkGxmyHv7NiU2EXy8AexJCiuUW9X6/uSaY43x2vIteltitgjC6DvKb86a/47WqWSYI8= 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=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1606996171612551.6805520086523; Thu, 3 Dec 2020 03:49:31 -0800 (PST) Received: from localhost ([::1]:43148 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kkmWt-0008DT-Jk for importer@patchew.org; Thu, 03 Dec 2020 06:12:07 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:50678) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kkmTF-00039x-7W for qemu-devel@nongnu.org; Thu, 03 Dec 2020 06:08:21 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:50176) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kkmT8-0006dA-Jj for qemu-devel@nongnu.org; Thu, 03 Dec 2020 06:08:20 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-218-J_n4vCdwNe2Z71Q2ZzTtfA-1; Thu, 03 Dec 2020 06:08:12 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 2CA521005E70 for ; Thu, 3 Dec 2020 11:08:11 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-112-94.ams2.redhat.com [10.36.112.94]) by smtp.corp.redhat.com (Postfix) with ESMTP id E9D7E18A2F; Thu, 3 Dec 2020 11:08:10 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 4BD329D9F; Thu, 3 Dec 2020 12:08:06 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606993693; 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=FfDnnqZhMg8ve3HQG0wHiEoFXbDMSDaubQU0AousCJA=; b=Fq4oQXa4Vbqcmqhd1sNsOfpvEK7B9MnujKDYg1+4r41sOxm0gwl2uPNYeVAIv5wI9lgl5R /Z/eacoJseTWIt+oNT2qTETSg/VHhqqbN5KWvKWZWb0OqIzAqUv6VL/MIFnczgtULiTSXv h+P08JEgLnR3PFD42UiBvb7X6H+yuA4= X-MC-Unique: J_n4vCdwNe2Z71Q2ZzTtfA-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PATCH 7/9] vnc: force initial resize message Date: Thu, 3 Dec 2020 12:08:03 +0100 Message-Id: <20201203110806.13556-8-kraxel@redhat.com> In-Reply-To: <20201203110806.13556-1-kraxel@redhat.com> References: <20201203110806.13556-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kraxel@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable 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=63.128.21.124; envelope-from=kraxel@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.495, 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_H4=0.001, RCVD_IN_MSPIKE_WL=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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Gerd Hoffmann Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" The vnc server should send desktop resize notifications unconditionally on a new client connect, for feature negotiation reasons. Add a bool flag to vnc_desktop_resize() to force sending the message even in case there is no size change. Signed-off-by: Gerd Hoffmann --- ui/vnc.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/ui/vnc.c b/ui/vnc.c index 247e80d8f5c8..bdaf384f71a4 100644 --- a/ui/vnc.c +++ b/ui/vnc.c @@ -664,13 +664,14 @@ void vnc_framebuffer_update(VncState *vs, int x, int = y, int w, int h, } =20 =20 -static void vnc_desktop_resize(VncState *vs) +static void vnc_desktop_resize(VncState *vs, bool force) { if (vs->ioc =3D=3D NULL || !vnc_has_feature(vs, VNC_FEATURE_RESIZE)) { return; } if (vs->client_width =3D=3D pixman_image_get_width(vs->vd->server) && - vs->client_height =3D=3D pixman_image_get_height(vs->vd->server)) { + vs->client_height =3D=3D pixman_image_get_height(vs->vd->server) && + !force) { return; } =20 @@ -800,7 +801,7 @@ static void vnc_dpy_switch(DisplayChangeListener *dcl, =20 QTAILQ_FOREACH(vs, &vd->clients, next) { vnc_colordepth(vs); - vnc_desktop_resize(vs); + vnc_desktop_resize(vs, false); if (vs->vd->cursor) { vnc_cursor_define(vs); } @@ -2143,7 +2144,7 @@ static void set_encodings(VncState *vs, int32_t *enco= dings, size_t n_encodings) break; } } - vnc_desktop_resize(vs); + vnc_desktop_resize(vs, true); check_pointer_type_change(&vs->mouse_mode_notifier, NULL); vnc_led_state_change(vs); if (vs->vd->cursor) { --=20 2.27.0 From nobody Mon Nov 17 23:49:51 2025 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=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1606994526; cv=none; d=zohomail.com; s=zohoarc; b=eInWRYZlF/Wj2wy1d9kyi3OByp/shSHQ9j0uG4hB934bpc8492YnuvhJqhOWpPUtLa64VKR0BY/MjYKcanzH4qKI5w1VbJEz5G1Jw17WP29tCe8azkfp5a+PbqH4PkE2IDDgV1uiHw42DGy7N8VuyvUYlFc5PN0E1hCSIKpfYzE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606994526; 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=fUcqX1+xwhtrDI47EC2Ns9GPCwXdBfst/FQ68qYcyTc=; b=iZxT6czd/QTz36CBI+zLkCZU7ns4/qcTxRXqx8IIgS2pbCnnlzxspFB26/mWjYv68e3GGjdZ0E6E5mX0A9/6RUoYxCuXiPDOemWbD9Wzjxs/ftjB3S+jmdcqksNmhiQFZOSyoJsxU56Kzm6HNg47URIE1Wag+9py6mQOv/DnEMU= 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=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1606994526441171.82089824646198; Thu, 3 Dec 2020 03:22:06 -0800 (PST) Received: from localhost ([::1]:49366 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kkmYn-0002R5-Ds for importer@patchew.org; Thu, 03 Dec 2020 06:14:05 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:50682) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kkmTF-0003Ap-JL for qemu-devel@nongnu.org; Thu, 03 Dec 2020 06:08:21 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:26286) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kkmT9-0006dW-MW for qemu-devel@nongnu.org; Thu, 03 Dec 2020 06:08:21 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-213-j8NN9ZIoMg6cDB-eyq1D3w-1; Thu, 03 Dec 2020 06:08:12 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 5D3A78049EF for ; Thu, 3 Dec 2020 11:08:11 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-112-94.ams2.redhat.com [10.36.112.94]) by smtp.corp.redhat.com (Postfix) with ESMTP id EA93C5C1BD; Thu, 3 Dec 2020 11:08:10 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 56C379DA0; Thu, 3 Dec 2020 12:08:06 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606993695; 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=fUcqX1+xwhtrDI47EC2Ns9GPCwXdBfst/FQ68qYcyTc=; b=QZWmuFgKLh9YyHluPJ9RtGUk/UUyQvzjXlGoBrAc16oPAF6qWoLaMsARXozaRL6jjXsuUJ UNn7SGtmdSdTYqRL3ngr/erBxs0XXhB9UMcKA9n7+ncFjYAplmmpvgCmtYA3r7DTbeE+Lb BJfh6CEhcppvqib0OO316T900SreBdM= X-MC-Unique: j8NN9ZIoMg6cDB-eyq1D3w-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PATCH 8/9] vnc: add support for extended desktop resize Date: Thu, 3 Dec 2020 12:08:04 +0100 Message-Id: <20201203110806.13556-9-kraxel@redhat.com> In-Reply-To: <20201203110806.13556-1-kraxel@redhat.com> References: <20201203110806.13556-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kraxel@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable 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=216.205.24.124; envelope-from=kraxel@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.495, 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_H3=0.001, RCVD_IN_MSPIKE_WL=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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Gerd Hoffmann Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" The extended desktop resize encoding adds support for (a) clients sending resize requests to the server, and (b) multihead support. This patch implements (a). All resize requests are rejected by qemu. Qemu can't resize the framebuffer on its own, this is in the hands of the guest, so all qemu can do is forward the request to the guest. Should the guest actually resize the framebuffer we can notify the vnc client later with a separate message. This requires support in the display device. Works with virtio-gpu. https://github.com/rfbproto/rfbproto/blob/master/rfbproto.rst#extendeddeskt= opsize-pseudo-encoding Signed-off-by: Gerd Hoffmann Reviewed-by: Marc-Andr=C3=A9 Lureau --- ui/vnc.h | 2 ++ ui/vnc.c | 64 +++++++++++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 65 insertions(+), 1 deletion(-) diff --git a/ui/vnc.h b/ui/vnc.h index c8d3ad9ec496..77a310947bd6 100644 --- a/ui/vnc.h +++ b/ui/vnc.h @@ -442,6 +442,7 @@ enum { =20 enum VncFeatures { VNC_FEATURE_RESIZE, + VNC_FEATURE_RESIZE_EXT, VNC_FEATURE_HEXTILE, VNC_FEATURE_POINTER_TYPE_CHANGE, VNC_FEATURE_WMVI, @@ -456,6 +457,7 @@ enum VncFeatures { }; =20 #define VNC_FEATURE_RESIZE_MASK (1 << VNC_FEATURE_RESIZE) +#define VNC_FEATURE_RESIZE_EXT_MASK (1 << VNC_FEATURE_RESIZE_EXT) #define VNC_FEATURE_HEXTILE_MASK (1 << VNC_FEATURE_HEXTILE) #define VNC_FEATURE_POINTER_TYPE_CHANGE_MASK (1 << VNC_FEATURE_POINTER_TYP= E_CHANGE) #define VNC_FEATURE_WMVI_MASK (1 << VNC_FEATURE_WMVI) diff --git a/ui/vnc.c b/ui/vnc.c index bdaf384f71a4..a15132faa96f 100644 --- a/ui/vnc.c +++ b/ui/vnc.c @@ -663,10 +663,35 @@ void vnc_framebuffer_update(VncState *vs, int x, int = y, int w, int h, vnc_write_s32(vs, encoding); } =20 +static void vnc_desktop_resize_ext(VncState *vs, bool reject) +{ + vnc_lock_output(vs); + vnc_write_u8(vs, VNC_MSG_SERVER_FRAMEBUFFER_UPDATE); + vnc_write_u8(vs, 0); + vnc_write_u16(vs, 1); /* number of rects */ + vnc_framebuffer_update(vs, + reject ? 1 : 0, + reject ? 3 : 0, + vs->client_width, vs->client_height, + VNC_ENCODING_DESKTOP_RESIZE_EXT); + vnc_write_u8(vs, 1); /* number of screens */ + vnc_write_u8(vs, 0); /* padding */ + vnc_write_u8(vs, 0); /* padding */ + vnc_write_u8(vs, 0); /* padding */ + vnc_write_u32(vs, 0); /* screen id */ + vnc_write_u16(vs, 0); /* screen x-pos */ + vnc_write_u16(vs, 0); /* screen y-pos */ + vnc_write_u16(vs, vs->client_width); + vnc_write_u16(vs, vs->client_height); + vnc_write_u32(vs, 0); /* screen flags */ + vnc_unlock_output(vs); + vnc_flush(vs); +} =20 static void vnc_desktop_resize(VncState *vs, bool force) { - if (vs->ioc =3D=3D NULL || !vnc_has_feature(vs, VNC_FEATURE_RESIZE)) { + if (vs->ioc =3D=3D NULL || (!vnc_has_feature(vs, VNC_FEATURE_RESIZE) && + !vnc_has_feature(vs, VNC_FEATURE_RESIZE_EXT)))= { return; } if (vs->client_width =3D=3D pixman_image_get_width(vs->vd->server) && @@ -681,6 +706,12 @@ static void vnc_desktop_resize(VncState *vs, bool forc= e) pixman_image_get_height(vs->vd->server) >=3D 0); vs->client_width =3D pixman_image_get_width(vs->vd->server); vs->client_height =3D pixman_image_get_height(vs->vd->server); + + if (vnc_has_feature(vs, VNC_FEATURE_RESIZE_EXT)) { + vnc_desktop_resize_ext(vs, false); + return; + } + vnc_lock_output(vs); vnc_write_u8(vs, VNC_MSG_SERVER_FRAMEBUFFER_UPDATE); vnc_write_u8(vs, 0); @@ -2110,6 +2141,9 @@ static void set_encodings(VncState *vs, int32_t *enco= dings, size_t n_encodings) case VNC_ENCODING_DESKTOPRESIZE: vs->features |=3D VNC_FEATURE_RESIZE_MASK; break; + case VNC_ENCODING_DESKTOP_RESIZE_EXT: + vs->features |=3D VNC_FEATURE_RESIZE_EXT_MASK; + break; case VNC_ENCODING_POINTER_TYPE_CHANGE: vs->features |=3D VNC_FEATURE_POINTER_TYPE_CHANGE_MASK; break; @@ -2431,6 +2465,34 @@ static int protocol_client_msg(VncState *vs, uint8_t= *data, size_t len) break; } break; + case VNC_MSG_CLIENT_SET_DESKTOP_SIZE: + { + size_t size; + uint8_t screens; + uint16_t width; + uint16_t height; + QemuUIInfo info; + + if (len < 8) { + return 8; + } + + screens =3D read_u8(data, 6); + size =3D 8 + screens * 16; + if (len < size) { + return size; + } + + width =3D read_u16(data, 2); + height =3D read_u16(data, 4); + vnc_desktop_resize_ext(vs, true); + + memset(&info, 0, sizeof(info)); + info.width =3D width; + info.height =3D height; + dpy_set_ui_info(vs->vd->dcl.con, &info); + break; + } default: VNC_DEBUG("Msg: %d\n", data[0]); vnc_client_error(vs); --=20 2.27.0 From nobody Mon Nov 17 23:49:51 2025 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=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1606994379; cv=none; d=zohomail.com; s=zohoarc; b=aVJEYF8oJaOryAgBaHcdv/1F/K+bv9bdqz1ay7kuR3QV32kKq9kUn009ieofY3Uu0h9qIOcGfsISWsgTXkI6p+nW2YHID3TayJ0EvR3HGdapKLkXOIp8Cx5kRk4aLup6F/rnRt49LFrnrs5yRdIXgBnOG4oD8dBY9CAn6R9dTDQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606994379; 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=0Eb/zbQs9oz6VWwiiAaAR/ROTotDtA67JLxituG/22w=; b=NL7rJ1V0+FoHUp639NaTVZrmlPk/2bzAhSuirDQKMBV2QgPESR7aECrbolbPgqJAva+PBtbeNfw1O8HTGPprTlJ67r4SnrYTAvPP2GNHDuMHFzjuFv6W8/wgEL6uuvPfRy0ny2X7SsltFFuxvz4ARZu0lpamsa+iuVZmzzxTckI= 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=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1606994379183653.7390917264852; Thu, 3 Dec 2020 03:19:39 -0800 (PST) Received: from localhost ([::1]:33536 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kkme9-0008HO-Oe for importer@patchew.org; Thu, 03 Dec 2020 06:19:37 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:50634) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kkmTB-00039F-94 for qemu-devel@nongnu.org; Thu, 03 Dec 2020 06:08:18 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:37591) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kkmT8-0006d8-Jl for qemu-devel@nongnu.org; Thu, 03 Dec 2020 06:08:17 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-5-rIT1fhQrNKmVrV4s5bqm9w-1; Thu, 03 Dec 2020 06:08:12 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 53A5F107AD9A for ; Thu, 3 Dec 2020 11:08:11 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-112-94.ams2.redhat.com [10.36.112.94]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1B8931A838; Thu, 3 Dec 2020 11:08:11 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 5FA119DA1; Thu, 3 Dec 2020 12:08:06 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606993693; 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=0Eb/zbQs9oz6VWwiiAaAR/ROTotDtA67JLxituG/22w=; b=EudDcGeCyaaVkZlVZC3oqbsbXkdBIaPbHG8NBcelINi8/7i6dEgpXPwgcVjWIYvM3m/2K3 DYbeC2tyqyaN6Mb2GJYlt9PAfTTS+NmYBccmdxzSUBI/mvDPuzOFqmKp2JWetCkYyaGSiz aHZDyw5iczpcHErYl3TX+26O3hcLvAU= X-MC-Unique: rIT1fhQrNKmVrV4s5bqm9w-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PATCH 9/9] qxl: add ui_info callback Date: Thu, 3 Dec 2020 12:08:05 +0100 Message-Id: <20201203110806.13556-10-kraxel@redhat.com> In-Reply-To: <20201203110806.13556-1-kraxel@redhat.com> References: <20201203110806.13556-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kraxel@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable 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=216.205.24.124; envelope-from=kraxel@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.495, 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_H3=0.001, RCVD_IN_MSPIKE_WL=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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Gerd Hoffmann Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" This makes qxl respond to user interface window resizes when not using spice, so it works with gtk and vnc too. Signed-off-by: Gerd Hoffmann --- hw/display/qxl.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/hw/display/qxl.c b/hw/display/qxl.c index 431c1070967a..e1df95c3e8a9 100644 --- a/hw/display/qxl.c +++ b/hw/display/qxl.c @@ -1177,8 +1177,35 @@ static const QXLInterface qxl_interface =3D { .client_monitors_config =3D interface_client_monitors_config, }; =20 +static int qxl_ui_info(void *opaque, uint32_t idx, QemuUIInfo *info) +{ + PCIQXLDevice *qxl =3D opaque; + VDAgentMonitorsConfig *cfg; + size_t size; + + if (using_spice) { + /* spice agent will handle display resize */ + return -1; + } + if (idx > 0) { + /* supporting only single head for now */ + return -1; + } + + /* go fake a spice agent message */ + size =3D sizeof(VDAgentMonitorsConfig) + sizeof(VDAgentMonConfig); + cfg =3D g_malloc0(size); + cfg->num_of_monitors =3D 1; + cfg->monitors[0].width =3D info->width; + cfg->monitors[0].height =3D info->height; + interface_client_monitors_config(&qxl->ssd.qxl, cfg); + g_free(cfg); + return 0; +} + static const GraphicHwOps qxl_ops =3D { .gfx_update =3D qxl_hw_update, + .ui_info =3D qxl_ui_info, .gfx_update_async =3D true, }; =20 --=20 2.27.0