From nobody Sat May 18 18:58:05 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1615488232; cv=none; d=zohomail.com; s=zohoarc; b=I20MqdoJNdivVyerSO3Imh22yu63ZaPdjWYMJ/1idjfrKg+NGAQbRzdoX2zA0zK3Cx1nbVYsLqxGnBLY3Z82+I9q+REPdJB5bnCH7zH3xtkDiczin9PiNWrt/4Z4Rf0kRVh7CYNrIsyjAEPHgW2ZACjTQ75C5oHo1y1BfhKi3tc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1615488232; 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=IsCuMUVxeZbUK1mv/tgKGIYXFIqVMXFcAD00/Y/nfIc=; b=aslmTlf923ELG7gYTY+GmEiaSNNTAB7UxRvY86MR2zfBKvPWCNO5LjQebwt6XFJJS3g8rROQGspn89TmECTvEJAC18QTnrKsaLj572oaXV2MaIxWoCNBC+I4u7hNampcboRLWTDcf038ZVvPC5FZRFJdXqzJKaxFyPKU3KX6kAI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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=fail 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 1615488232919867.6483076192039; Thu, 11 Mar 2021 10:43:52 -0800 (PST) Received: from localhost ([::1]:33212 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lKQHn-0004MG-P6 for importer@patchew.org; Thu, 11 Mar 2021 13:43:51 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:55696) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lKQ4d-0001h3-Je for qemu-devel@nongnu.org; Thu, 11 Mar 2021 13:30:15 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:26102) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1lKQ4Z-0004Z6-UX for qemu-devel@nongnu.org; Thu, 11 Mar 2021 13:30:15 -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-42-fDpQLiCQMrCjXsVu3b3ZBg-1; Thu, 11 Mar 2021 13:30:09 -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 B4579100C661 for ; Thu, 11 Mar 2021 18:30:08 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-115-85.ams2.redhat.com [10.36.115.85]) by smtp.corp.redhat.com (Postfix) with ESMTP id 69C872C15A; Thu, 11 Mar 2021 18:30:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1615487411; 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=IsCuMUVxeZbUK1mv/tgKGIYXFIqVMXFcAD00/Y/nfIc=; b=T8X+XiAY7mQeb6yg/jwMLdd9x6kLChv1PueP8eTJc3VurKgN6Pg8vf7bYMOrYnRQhn2ymF PTe+RZb36dnkCzLDs+pkwx7JXmmCGMZXHEh1jkM7aT/SByeBMDEPI/uO2zp2Pt0exhDQLT NT/vZyz4W2x9YdBfm78zikUBBNy/oCA= X-MC-Unique: fDpQLiCQMrCjXsVu3b3ZBg-1 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH 1/4] ui: add more trace points for VNC client/server messages Date: Thu, 11 Mar 2021 18:29:54 +0000 Message-Id: <20210311182957.486939-2-berrange@redhat.com> In-Reply-To: <20210311182957.486939-1-berrange@redhat.com> References: <20210311182957.486939-1-berrange@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=berrange@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" 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=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -29 X-Spam_score: -3.0 X-Spam_bar: --- X-Spam_report: (-3.0 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.25, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, 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: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Gerd Hoffmann Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) This adds trace points for desktop size and audio related messages. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Marc-Andr=C3=A9 Lureau --- ui/trace-events | 9 +++++++++ ui/vnc.c | 21 +++++++++++++++++++-- 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/ui/trace-events b/ui/trace-events index 0ffcdb4408..bd8f8a9d18 100644 --- a/ui/trace-events +++ b/ui/trace-events @@ -37,6 +37,15 @@ vnc_key_event_ext(bool down, int sym, int keycode, const= char *name) "down %d, s vnc_key_event_map(bool down, int sym, int keycode, const char *name) "down= %d, sym 0x%x -> keycode 0x%x [%s]" vnc_key_sync_numlock(bool on) "%d" vnc_key_sync_capslock(bool on) "%d" +vnc_msg_server_audio_begin(void *state, void *ioc) "VNC server msg audio b= egin state=3D%p ioc=3D%p" +vnc_msg_server_audio_end(void *state, void *ioc) "VNC server msg audio end= state=3D%p ioc=3D%p" +vnc_msg_server_audio_data(void *state, void *ioc, const void *buf, size_t = len) "VNC server msg audio data state=3D%p ioc=3D%p buf=3D%p len=3D%zd" +vnc_msg_server_desktop_resize(void *state, void *ioc, int width, int heigh= t) "VNC server msg ext resize state=3D%p ioc=3D%p size=3D%dx%d" +vnc_msg_server_ext_desktop_resize(void *state, void *ioc, int width, int h= eight, int reason) "VNC server msg ext resize state=3D%p ioc=3D%p size=3D%d= x%d reason=3D%d" +vnc_msg_client_audio_enable(void *state, void *ioc) "VNC client msg audio = enable state=3D%p ioc=3D%p" +vnc_msg_client_audio_disable(void *state, void *ioc) "VNC client msg audio= disable state=3D%p ioc=3D%p" +vnc_msg_client_audio_format(void *state, void *ioc, int fmt, int channels,= int freq) "VNC client msg audio format state=3D%p ioc=3D%p fmt=3D%d channe= ls=3D%d freq=3D%d" +vnc_msg_client_set_desktop_size(void *state, void *ioc, int width, int hei= ght, int screens) "VNC client msg set desktop size state=3D%p ioc=3D%p siz= e=3D%dx%d screens=3D%d" vnc_client_eof(void *state, void *ioc) "VNC client EOF state=3D%p ioc=3D%p" vnc_client_io_error(void *state, void *ioc, const char *msg) "VNC client I= /O error state=3D%p ioc=3D%p errmsg=3D%s" vnc_client_connect(void *state, void *ioc) "VNC client connect state=3D%p = ioc=3D%p" diff --git a/ui/vnc.c b/ui/vnc.c index e8e3426a65..7291429c04 100644 --- a/ui/vnc.c +++ b/ui/vnc.c @@ -659,6 +659,9 @@ void vnc_framebuffer_update(VncState *vs, int x, int y,= int w, int h, =20 static void vnc_desktop_resize_ext(VncState *vs, int reject_reason) { + trace_vnc_msg_server_ext_desktop_resize( + vs, vs->ioc, vs->client_width, vs->client_height, reject_reason); + vnc_lock_output(vs); vnc_write_u8(vs, VNC_MSG_SERVER_FRAMEBUFFER_UPDATE); vnc_write_u8(vs, 0); @@ -705,6 +708,9 @@ static void vnc_desktop_resize(VncState *vs) return; } =20 + trace_vnc_msg_server_desktop_resize( + vs, vs->ioc, vs->client_width, vs->client_height); + vnc_lock_output(vs); vnc_write_u8(vs, VNC_MSG_SERVER_FRAMEBUFFER_UPDATE); vnc_write_u8(vs, 0); @@ -1182,6 +1188,7 @@ static void audio_capture_notify(void *opaque, audcno= tification_e cmd) assert(vs->magic =3D=3D VNC_MAGIC); switch (cmd) { case AUD_CNOTIFY_DISABLE: + trace_vnc_msg_server_audio_end(vs, vs->ioc); vnc_lock_output(vs); vnc_write_u8(vs, VNC_MSG_SERVER_QEMU); vnc_write_u8(vs, VNC_MSG_SERVER_QEMU_AUDIO); @@ -1191,6 +1198,7 @@ static void audio_capture_notify(void *opaque, audcno= tification_e cmd) break; =20 case AUD_CNOTIFY_ENABLE: + trace_vnc_msg_server_audio_begin(vs, vs->ioc); vnc_lock_output(vs); vnc_write_u8(vs, VNC_MSG_SERVER_QEMU); vnc_write_u8(vs, VNC_MSG_SERVER_QEMU_AUDIO); @@ -1210,6 +1218,7 @@ static void audio_capture(void *opaque, const void *b= uf, int size) VncState *vs =3D opaque; =20 assert(vs->magic =3D=3D VNC_MAGIC); + trace_vnc_msg_server_audio_data(vs, vs->ioc, buf, size); vnc_lock_output(vs); if (vs->output.offset < vs->throttle_output_offset) { vnc_write_u8(vs, VNC_MSG_SERVER_QEMU); @@ -2454,9 +2463,11 @@ static int protocol_client_msg(VncState *vs, uint8_t= *data, size_t len) =20 switch (read_u16 (data, 2)) { case VNC_MSG_CLIENT_QEMU_AUDIO_ENABLE: + trace_vnc_msg_client_audio_enable(vs, vs->ioc); audio_add(vs); break; case VNC_MSG_CLIENT_QEMU_AUDIO_DISABLE: + trace_vnc_msg_client_audio_disable(vs, vs->ioc); audio_del(vs); break; case VNC_MSG_CLIENT_QEMU_AUDIO_SET_FORMAT: @@ -2492,6 +2503,8 @@ static int protocol_client_msg(VncState *vs, uint8_t = *data, size_t len) break; } vs->as.freq =3D freq; + trace_vnc_msg_client_audio_format( + vs, vs->ioc, vs->as.fmt, vs->as.nchannels, vs->as.freq= ); break; default: VNC_DEBUG("Invalid audio message %d\n", read_u8(data, 4)); @@ -2510,6 +2523,7 @@ static int protocol_client_msg(VncState *vs, uint8_t = *data, size_t len) { size_t size; uint8_t screens; + int w, h; =20 if (len < 8) { return 8; @@ -2520,12 +2534,15 @@ static int protocol_client_msg(VncState *vs, uint8_= t *data, size_t len) if (len < size) { return size; } + w =3D read_u16(data, 2); + h =3D read_u16(data, 4); =20 + trace_vnc_msg_client_set_desktop_size(vs, vs->ioc, w, h, screens); if (dpy_ui_info_supported(vs->vd->dcl.con)) { QemuUIInfo info; memset(&info, 0, sizeof(info)); - info.width =3D read_u16(data, 2); - info.height =3D read_u16(data, 4); + info.width =3D w; + info.height =3D h; dpy_set_ui_info(vs->vd->dcl.con, &info); vnc_desktop_resize_ext(vs, 4 /* Request forwarded */); } else { --=20 2.29.2 From nobody Sat May 18 18:58:05 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1615487857; cv=none; d=zohomail.com; s=zohoarc; b=ZpxxhmfeGncgekAD+ReS7AtpHu1CLOw6u+3Rd3qrbpJek+9hi360PR8+yj1yf+I1HbCuqUAgRZSYtkQW59cupcUumeOzT76DGdIVjZGp2d9QQm8Ar3LnJ+gSysxj8aVbFTytXX0dmpuUDovSl/Sqh/zXqFqWdI6DlEBKMKPMKgU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1615487857; 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=V0zQ9CvOjvz7updepouModGhp7K4FDxVYQ1m23aXDHk=; b=Wilaje7FcppxElxF/WfA4mNlxTDdMrbR7t6LdSvsGZsH12b4KLvdzfEGJAgtcJqJ8a6yIdPunSFJas7a8W9RuHCUtwKRBHlZ75OGzM5J4/pbqDR8hNv08IW0VC1bL8u6KYia+Qukt92czdFutGOj9zHaIFzrVehvKwS4RzqBheU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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=fail 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 16154878576771013.0227664586648; Thu, 11 Mar 2021 10:37:37 -0800 (PST) Received: from localhost ([::1]:51638 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lKQBj-0007Gl-S0 for importer@patchew.org; Thu, 11 Mar 2021 13:37:35 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:55722) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lKQ4g-0001ih-KV for qemu-devel@nongnu.org; Thu, 11 Mar 2021 13:30:19 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:20052) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1lKQ4b-0004Zn-NE for qemu-devel@nongnu.org; Thu, 11 Mar 2021 13:30:18 -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-7-c5OT4IerMdKU8vj6VlMF2Q-1; Thu, 11 Mar 2021 13:30: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 2CC8110866A0 for ; Thu, 11 Mar 2021 18:30:10 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-115-85.ams2.redhat.com [10.36.115.85]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1D01318A9E; Thu, 11 Mar 2021 18:30:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1615487413; 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=V0zQ9CvOjvz7updepouModGhp7K4FDxVYQ1m23aXDHk=; b=Uno3K8bhxD1pDfRgFwoO/YXy6sef39X5QyiPIfaEe6KQJFacOv03jXFAWXVr9Tpy/e++H4 /nlJe02zYuVZDochvgg9Xecnh9ZEkoutZHNuv0kRIG4btcgHJof9BuZ3gkOKQptILTG1Iz Bi/Ve/7N6IGNRKtCemo1s1tv7Xca2iI= X-MC-Unique: c5OT4IerMdKU8vj6VlMF2Q-1 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH 2/4] ui: avoid sending framebuffer updates outside client desktop bounds Date: Thu, 11 Mar 2021 18:29:55 +0000 Message-Id: <20210311182957.486939-3-berrange@redhat.com> In-Reply-To: <20210311182957.486939-1-berrange@redhat.com> References: <20210311182957.486939-1-berrange@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=berrange@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" 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=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -29 X-Spam_score: -3.0 X-Spam_bar: --- X-Spam_report: (-3.0 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.25, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, 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: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Gerd Hoffmann Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) We plan framebuffer update rects based on the VNC server surface. If the client doesn't support desktop resize, then the client bounds may differ from the server surface bounds. VNC clients may become upset if we then send an update message outside the bounds of the client desktop. This takes the approach of clamping the rectangles from the worker thread immediately before sending them. This may sometimes results in sending a framebuffer update message with zero rectangles. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Marc-Andr=C3=A9 Lureau --- ui/trace-events | 5 +++++ ui/vnc-jobs.c | 44 ++++++++++++++++++++++++++++++++++++++++---- 2 files changed, 45 insertions(+), 4 deletions(-) diff --git a/ui/trace-events b/ui/trace-events index bd8f8a9d18..3838ae2d84 100644 --- a/ui/trace-events +++ b/ui/trace-events @@ -59,6 +59,11 @@ vnc_client_throttle_audio(void *state, void *ioc, size_t= offset) "VNC client thr vnc_client_unthrottle_forced(void *state, void *ioc) "VNC client unthrottl= e forced offset state=3D%p ioc=3D%p" vnc_client_unthrottle_incremental(void *state, void *ioc, size_t offset) "= VNC client unthrottle incremental state=3D%p ioc=3D%p offset=3D%zu" vnc_client_output_limit(void *state, void *ioc, size_t offset, size_t thre= shold) "VNC client output limit state=3D%p ioc=3D%p offset=3D%zu threshold= =3D%zu" +vnc_job_add_rect(void *state, void *job, int x, int y, int w, int h) "VNC = add rect state=3D%p job=3D%p offset=3D%d,%d size=3D%dx%d" +vnc_job_discard_rect(void *state, void *job, int x, int y, int w, int h) "= VNC job discard rect state=3D%p job=3D%p offset=3D%d,%d size=3D%dx%d" +vnc_job_clamp_rect(void *state, void *job, int x, int y, int w, int h) "VN= C job clamp rect state=3D%p job=3D%p offset=3D%d,%d size=3D%dx%d" +vnc_job_clamped_rect(void *state, void *job, int x, int y, int w, int h) "= VNC job clamp rect state=3D%p job=3D%p offset=3D%d,%d size=3D%dx%d" +vnc_job_nrects(void *state, void *job, int nrects) "VNC job state=3D%p job= =3D%p nrects=3D%d" vnc_auth_init(void *display, int websock, int auth, int subauth) "VNC auth= init state=3D%p websock=3D%d auth=3D%d subauth=3D%d" vnc_auth_start(void *state, int method) "VNC client auth start state=3D%p = method=3D%d" vnc_auth_pass(void *state, int method) "VNC client auth passed state=3D%p = method=3D%d" diff --git a/ui/vnc-jobs.c b/ui/vnc-jobs.c index dbbfbefe56..4562bf8928 100644 --- a/ui/vnc-jobs.c +++ b/ui/vnc-jobs.c @@ -32,6 +32,7 @@ #include "qemu/sockets.h" #include "qemu/main-loop.h" #include "block/aio.h" +#include "trace.h" =20 /* * Locking: @@ -94,6 +95,8 @@ int vnc_job_add_rect(VncJob *job, int x, int y, int w, in= t h) { VncRectEntry *entry =3D g_new0(VncRectEntry, 1); =20 + trace_vnc_job_add_rect(job->vs, job, x, y, w, h); + entry->rect.x =3D x; entry->rect.y =3D y; entry->rect.w =3D w; @@ -190,6 +193,8 @@ static void vnc_async_encoding_start(VncState *orig, Vn= cState *local) local->zlib =3D orig->zlib; local->hextile =3D orig->hextile; local->zrle =3D orig->zrle; + local->client_width =3D orig->client_width; + local->client_height =3D orig->client_height; } =20 static void vnc_async_encoding_end(VncState *orig, VncState *local) @@ -202,6 +207,34 @@ static void vnc_async_encoding_end(VncState *orig, Vnc= State *local) orig->lossy_rect =3D local->lossy_rect; } =20 +static bool vnc_worker_clamp_rect(VncState *vs, VncJob *job, VncRect *rect) +{ + trace_vnc_job_clamp_rect(vs, job, rect->x, rect->y, rect->w, rect->h); + + if (rect->x >=3D vs->client_width) { + goto discard; + } + rect->w =3D MIN(vs->client_width - rect->x, rect->w); + if (rect->w =3D=3D 0) { + goto discard; + } + + if (rect->y >=3D vs->client_height) { + goto discard; + } + rect->h =3D MIN(vs->client_height - rect->y, rect->h); + if (rect->h =3D=3D 0) { + goto discard; + } + + trace_vnc_job_clamped_rect(vs, job, rect->x, rect->y, rect->w, rect->h= ); + return true; + + discard: + trace_vnc_job_discard_rect(vs, job, rect->x, rect->y, rect->w, rect->h= ); + return false; +} + static int vnc_worker_thread_loop(VncJobQueue *queue) { VncJob *job; @@ -260,14 +293,17 @@ static int vnc_worker_thread_loop(VncJobQueue *queue) goto disconnected; } =20 - n =3D vnc_send_framebuffer_update(&vs, entry->rect.x, entry->rect.= y, - entry->rect.w, entry->rect.h); + if (vnc_worker_clamp_rect(&vs, job, &entry->rect)) { + n =3D vnc_send_framebuffer_update(&vs, entry->rect.x, entry->r= ect.y, + entry->rect.w, entry->rect.h); =20 - if (n >=3D 0) { - n_rectangles +=3D n; + if (n >=3D 0) { + n_rectangles +=3D n; + } } g_free(entry); } + trace_vnc_job_nrects(&vs, job, n_rectangles); vnc_unlock_display(job->vs->vd); =20 /* Put n_rectangles at the beginning of the message */ --=20 2.29.2 From nobody Sat May 18 18:58:05 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1615488458; cv=none; d=zohomail.com; s=zohoarc; b=CSolD+X+PHsx2xwT2GfNWN/rFSXSi+Pk1SxE1iMlJZ7zFRSzzCiVUhIs/ZtbYkv0joNiHNTH0ibUFU5CvPfFaB4WzPJpy+SXDai075UlFc2jqofgQVMlCRg3OY1fGH+HdnLjcVcNvq9Ujad41/fu9Tk/ZNCjd/ILNYOQE0A+AK0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1615488458; 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=94xKz9rBs80qA3AWXFxKoeefCjGHm9eb9tHdY/+37+8=; b=GWcHAvf5c0CDm93Cs/mgTyFSAzDwL/jvcLWoI8cuKI0lWCMdJl5sBUjAjnFhSJox+tmtcRy27PHl+cFMBCjDL+e3nS5NDiWB8yQXmb/5uY4zaRX1LaEjLzNGuCqc/dMUYkPKh/QxSp8Z2e7rtxBeHNxhiGrzCBzrsfZureu9ud4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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=fail 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 1615488458184529.840384752333; Thu, 11 Mar 2021 10:47:38 -0800 (PST) Received: from localhost ([::1]:40318 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lKQLR-0008HK-1F for importer@patchew.org; Thu, 11 Mar 2021 13:47:37 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:55716) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lKQ4f-0001i1-5c for qemu-devel@nongnu.org; Thu, 11 Mar 2021 13:30:17 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:41610) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1lKQ4d-0004bJ-AE for qemu-devel@nongnu.org; Thu, 11 Mar 2021 13:30: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-335-rrgX_cu3O9qrr8iUCn3PVQ-1; Thu, 11 Mar 2021 13:30: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 C99EF801817 for ; Thu, 11 Mar 2021 18:30:11 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-115-85.ams2.redhat.com [10.36.115.85]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7A19E2C15A; Thu, 11 Mar 2021 18:30:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1615487414; 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=94xKz9rBs80qA3AWXFxKoeefCjGHm9eb9tHdY/+37+8=; b=WuMJ83mjihe+PTbWJc/P6dQwiM0+gPxGGIfnb/GFHW5uoWWfTsK6L/NLqDOmIQSy/PfyC5 kshNPij1ydzcjDjvxORbcltDNCaQC5nf5ZBaS9/rd/LDJQINKz0uW//ir/bOYM8DvKouhl qACwcHyIQ0Z6hpc7Tfi4ps/1s3keFEw= X-MC-Unique: rrgX_cu3O9qrr8iUCn3PVQ-1 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH 3/4] ui: use client width/height in WMVi message Date: Thu, 11 Mar 2021 18:29:56 +0000 Message-Id: <20210311182957.486939-4-berrange@redhat.com> In-Reply-To: <20210311182957.486939-1-berrange@redhat.com> References: <20210311182957.486939-1-berrange@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=berrange@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" 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=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -29 X-Spam_score: -3.0 X-Spam_bar: --- X-Spam_report: (-3.0 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.25, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, 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: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Gerd Hoffmann Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) The WMVi message is supposed to provide the same width/height information as the regular desktop resize and extended desktop resize messages. There can be times where the client width and height are different from the pixman surface dimensions. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Marc-Andr=C3=A9 Lureau --- ui/vnc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ui/vnc.c b/ui/vnc.c index 7291429c04..8c9890b3cd 100644 --- a/ui/vnc.c +++ b/ui/vnc.c @@ -2319,8 +2319,8 @@ static void vnc_colordepth(VncState *vs) vnc_write_u8(vs, 0); vnc_write_u16(vs, 1); /* number of rects */ vnc_framebuffer_update(vs, 0, 0, - pixman_image_get_width(vs->vd->server), - pixman_image_get_height(vs->vd->server), + vs->client_width, + vs->client_height, VNC_ENCODING_WMVi); pixel_format_message(vs); vnc_unlock_output(vs); --=20 2.29.2 From nobody Sat May 18 18:58:05 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1615488138; cv=none; d=zohomail.com; s=zohoarc; b=OW9+wVUrr0hXbVJ//coNh4Br+ME+3PhC0eB+Ec8ps8aShcXF4AR/vctjOEpgvvTyvEiWLSiv4jUPZWnrUlYqhqbd1iyntNMwm84Jy9/LwQ+W1lJBffHRZjPLxObuTgghVGP2IAgdDOCMOoVkFRosrGSO21v01Ob7x8t3i9hVLaE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1615488138; 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=mRT/p6ELNH/p7hvJVggJuIuCoQC1e2wXa23Ov064XUg=; b=Uo+uW2R8MzROPyO3Q2JUsITRXRhb2WwKhWBUoQzicqy2L5U4Zy24atbpxA05D2kiiqpHyonCVsY+t0HeWsW8sxSOfcpwNBTjgaKzaxa3WCndyilBgNwxec9APZRgU2IoE1sysDMxXRs5+DM/8s4DDthwlbAwbFurSPj155YQ0sA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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=fail 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 1615488138950473.6648232936212; Thu, 11 Mar 2021 10:42:18 -0800 (PST) Received: from localhost ([::1]:57740 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lKQGH-0001tQ-UW for importer@patchew.org; Thu, 11 Mar 2021 13:42:17 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:55734) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lKQ4h-0001jI-VG for qemu-devel@nongnu.org; Thu, 11 Mar 2021 13:30:20 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:21192) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1lKQ4f-0004cm-Tb for qemu-devel@nongnu.org; Thu, 11 Mar 2021 13:30: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-580-zZFdPG9pMACT4RXmgmYAeQ-1; Thu, 11 Mar 2021 13:30:15 -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 444461923761 for ; Thu, 11 Mar 2021 18:30:14 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-115-85.ams2.redhat.com [10.36.115.85]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2D70D18A9E; Thu, 11 Mar 2021 18:30:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1615487416; 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=mRT/p6ELNH/p7hvJVggJuIuCoQC1e2wXa23Ov064XUg=; b=RvkWDc8ORonXSuN3ZgewwOh1Tx6ITelRDoLde3MJDEQYYYFW8htOVVKeTo23DG5b49IUed L8CcdC561dOynbredEzURmKoFtM8dMzqz89V5nPgA+9Tuxxb/mnB8tWLedSRuKl8KVvlLJ Gh5nNnbO1X+NcpiybS3uTmuse2ZK8xg= X-MC-Unique: zZFdPG9pMACT4RXmgmYAeQ-1 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH 4/4] ui: honour the actual guest display dimensions without rounding Date: Thu, 11 Mar 2021 18:29:57 +0000 Message-Id: <20210311182957.486939-5-berrange@redhat.com> In-Reply-To: <20210311182957.486939-1-berrange@redhat.com> References: <20210311182957.486939-1-berrange@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=berrange@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" 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=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -29 X-Spam_score: -3.0 X-Spam_bar: --- X-Spam_report: (-3.0 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.25, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, 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: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Gerd Hoffmann Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) A long time ago the VNC server code had some memory corruption fixes done in: commit bea60dd7679364493a0d7f5b54316c767cf894ef Author: Peter Lieven Date: Mon Jun 30 10:57:51 2014 +0200 ui/vnc: fix potential memory corruption issues One of the implications of the fix was that the VNC server would have a thin black bad down the right hand side if the guest desktop width was not a multiple of 16. In practice this was a non-issue since the VNC server was always honouring a guest specified resolution and guests essentially always pick from a small set of sane resolutions likely in real world hardware. We recently introduced support for the extended desktop resize extension and as a result the VNC client has ability to specify an arbitrary desktop size and the guest OS may well honour it exactly. As a result we no longer have any guarantee that the width will be a multiple of 16, and so when resizing the desktop we have a 93% chance of getting the black bar on the right hand size. The VNC server maintains three different desktop dimensions 1. The guest surface 2. The server surface 3. The client desktop The requirement for the width to be a multiple of 16 only applies to item 2, the server surface, for the purpose of doing dirty bitmap tracking. Normally we will set the client desktop size to always match the server surface size, but that's not a strict requirement. In order to cope with clients that don't support the desktop size encoding, we already allow for the client desktop to be a different size that the server surface. Thus we can trivially eliminate the black bar, but setting the client desktop size to be the un-rounded server surface size - the so called "true width". Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Marc-Andr=C3=A9 Lureau --- ui/trace-events | 2 ++ ui/vnc.c | 23 +++++++++++++++++++---- ui/vnc.h | 1 + 3 files changed, 22 insertions(+), 4 deletions(-) diff --git a/ui/trace-events b/ui/trace-events index 3838ae2d84..5d1da6f236 100644 --- a/ui/trace-events +++ b/ui/trace-events @@ -59,6 +59,8 @@ vnc_client_throttle_audio(void *state, void *ioc, size_t = offset) "VNC client thr vnc_client_unthrottle_forced(void *state, void *ioc) "VNC client unthrottl= e forced offset state=3D%p ioc=3D%p" vnc_client_unthrottle_incremental(void *state, void *ioc, size_t offset) "= VNC client unthrottle incremental state=3D%p ioc=3D%p offset=3D%zu" vnc_client_output_limit(void *state, void *ioc, size_t offset, size_t thre= shold) "VNC client output limit state=3D%p ioc=3D%p offset=3D%zu threshold= =3D%zu" +vnc_server_dpy_pageflip(void *dpy, int w, int h, int fmt) "VNC server dpy = pageflip dpy=3D%p size=3D%dx%d fmt=3D%d" +vnc_server_dpy_recreate(void *dpy, int w, int h, int fmt) "VNC server dpy = recreate dpy=3D%p size=3D%dx%d fmt=3D%d" vnc_job_add_rect(void *state, void *job, int x, int y, int w, int h) "VNC = add rect state=3D%p job=3D%p offset=3D%d,%d size=3D%dx%d" vnc_job_discard_rect(void *state, void *job, int x, int y, int w, int h) "= VNC job discard rect state=3D%p job=3D%p offset=3D%d,%d size=3D%dx%d" vnc_job_clamp_rect(void *state, void *job, int x, int y, int w, int h) "VN= C job clamp rect state=3D%p job=3D%p offset=3D%d,%d size=3D%dx%d" diff --git a/ui/vnc.c b/ui/vnc.c index 8c9890b3cd..9c004a11f4 100644 --- a/ui/vnc.c +++ b/ui/vnc.c @@ -608,6 +608,11 @@ static int vnc_width(VncDisplay *vd) VNC_DIRTY_PIXELS_PER_BIT)); } =20 +static int vnc_true_width(VncDisplay *vd) +{ + return MIN(VNC_MAX_WIDTH, surface_width(vd->ds)); +} + static int vnc_height(VncDisplay *vd) { return MIN(VNC_MAX_HEIGHT, surface_height(vd->ds)); @@ -691,16 +696,16 @@ static void vnc_desktop_resize(VncState *vs) !vnc_has_feature(vs, VNC_FEATURE_RESIZE_EXT)))= { return; } - if (vs->client_width =3D=3D pixman_image_get_width(vs->vd->server) && + if (vs->client_width =3D=3D vs->vd->true_width && vs->client_height =3D=3D pixman_image_get_height(vs->vd->server)) { return; } =20 - assert(pixman_image_get_width(vs->vd->server) < 65536 && - pixman_image_get_width(vs->vd->server) >=3D 0); + assert(vs->vd->true_width < 65536 && + vs->vd->true_width >=3D 0); assert(pixman_image_get_height(vs->vd->server) < 65536 && pixman_image_get_height(vs->vd->server) >=3D 0); - vs->client_width =3D pixman_image_get_width(vs->vd->server); + vs->client_width =3D vs->vd->true_width; vs->client_height =3D pixman_image_get_height(vs->vd->server); =20 if (vnc_has_feature(vs, VNC_FEATURE_RESIZE_EXT)) { @@ -774,6 +779,7 @@ static void vnc_update_server_surface(VncDisplay *vd) =20 width =3D vnc_width(vd); height =3D vnc_height(vd); + vd->true_width =3D vnc_true_width(vd); vd->server =3D pixman_image_create_bits(VNC_SERVER_FB_FORMAT, width, height, NULL, 0); @@ -809,13 +815,22 @@ static void vnc_dpy_switch(DisplayChangeListener *dcl, vd->guest.fb =3D pixman_image_ref(surface->image); vd->guest.format =3D surface->format; =20 + if (pageflip) { + trace_vnc_server_dpy_pageflip(vd, + surface_width(surface), + surface_height(surface), + surface_format(surface)); vnc_set_area_dirty(vd->guest.dirty, vd, 0, 0, surface_width(surface), surface_height(surface)); return; } =20 + trace_vnc_server_dpy_recreate(vd, + surface_width(surface), + surface_height(surface), + surface_format(surface)); /* server surface */ vnc_update_server_surface(vd); =20 diff --git a/ui/vnc.h b/ui/vnc.h index 116463d5f0..d4f3e15558 100644 --- a/ui/vnc.h +++ b/ui/vnc.h @@ -164,6 +164,7 @@ struct VncDisplay =20 struct VncSurface guest; /* guest visible surface (aka ds->surface) = */ pixman_image_t *server; /* vnc server surface */ + int true_width; /* server surface width before rounding up */ =20 const char *id; QTAILQ_ENTRY(VncDisplay) next; --=20 2.29.2