From patchwork Mon Mar 17 15:29:12 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Lieven X-Patchwork-Id: 331058 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 247822C00A3 for ; Tue, 18 Mar 2014 02:29:47 +1100 (EST) Received: from localhost ([::1]:58555 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WPZU0-0000Iu-2v for incoming@patchwork.ozlabs.org; Mon, 17 Mar 2014 11:29:44 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43716) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WPZTg-0000Im-2f for qemu-devel@nongnu.org; Mon, 17 Mar 2014 11:29:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WPZTZ-0003SA-3G for qemu-devel@nongnu.org; Mon, 17 Mar 2014 11:29:24 -0400 Received: from mx.ipv6.kamp.de ([2a02:248:0:51::16]:55982 helo=mx01.kamp.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WPZTY-0003Rd-O2 for qemu-devel@nongnu.org; Mon, 17 Mar 2014 11:29:16 -0400 Received: (qmail 18033 invoked by uid 89); 17 Mar 2014 15:29:14 -0000 Received: from [195.62.97.28] by client-16-kamp (envelope-from , uid 89) with qmail-scanner-2010/03/19-MF (clamdscan: 0.98.1/18614. hbedv: 8.3.16.12/7.11.137.124. spamassassin: 3.3.1. Clear:RC:1(195.62.97.28):SA:0(-2.0/5.0):. Processed in 1.440645 secs); 17 Mar 2014 15:29:14 -0000 Received: from smtp.kamp.de (HELO submission.kamp.de) ([195.62.97.28]) by mx01.kamp.de with SMTP; 17 Mar 2014 15:29:12 -0000 X-GL_Whitelist: yes Received: (qmail 19760 invoked from network); 17 Mar 2014 15:29:10 -0000 Received: from lieven-pc.kamp-intra.net (HELO ?172.21.12.60?) (pl@kamp.de@172.21.12.60) by submission.kamp.de with ESMTPS (DHE-RSA-AES128-SHA encrypted) ESMTPA; 17 Mar 2014 15:29:10 -0000 Message-ID: <532714C8.9070204@kamp.de> Date: Mon, 17 Mar 2014 16:29:12 +0100 From: Peter Lieven User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0 MIME-Version: 1.0 To: Serge Hallyn , Peter Lieven References: <20140314160616.GA16438@sergelap> <1395063841.5663.9.camel@nilsson.home.kraxel.org> <53270033.4080100@kamp.de> <20140317141012.GE7725@sergelap> <53270E30.4080400@dlhnet.de> <20140317151933.GA29848@sergelap> In-Reply-To: <20140317151933.GA29848@sergelap> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a02:248:0:51::16 Cc: Doug Smythies , Gerd Hoffmann , qemu-devel@nongnu.org Subject: Re: [Qemu-devel] vnc regression with -vga vmware X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org On 17.03.2014 16:19, Serge Hallyn wrote: > Quoting Peter Lieven (lieven-lists@dlhnet.de): >> I found 2 issues: >> >> - with vmware VGA the server surface and the client desktop size are out of sync for some time >> at a resolution change. the server surface gets updates for x coordinates that are out of bound >> for the client. >> - the max width of the client (2360) is not dividable by 16 (VNC_DIRTY_PIXELS_PER_BIT). >> >> I will try to fix this in ui/vnc but we should definetly look for the root cause. > Thanks, Peter! > > -serge The vmware vga driver seems to do some nasty things. I receive the msg like this (independent of ui/vnc): vmsvga_update_rect: update x was < 0 (-65) Can you try the following patch: Peter diff --git a/hw/display/vmware_vga.c b/hw/display/vmware_vga.c index bd2c108..6ae3348 100644 --- a/hw/display/vmware_vga.c +++ b/hw/display/vmware_vga.c @@ -25,6 +25,7 @@ #include "hw/loader.h" #include "trace.h" #include "ui/console.h" +#include "ui/vnc.h" #include "hw/pci/pci.h" #undef VERBOSE @@ -218,7 +219,7 @@ enum { /* These values can probably be changed arbitrarily. */ #define SVGA_SCRATCH_SIZE 0x8000 -#define SVGA_MAX_WIDTH 2360 +#define SVGA_MAX_WIDTH ROUND_UP(2360, VNC_DIRTY_PIXELS_PER_BIT) #define SVGA_MAX_HEIGHT 1770 #ifdef VERBOSE diff --git a/ui/vnc.c b/ui/vnc.c index 9c84b3e..5925774 100644 --- a/ui/vnc.c +++ b/ui/vnc.c @@ -888,7 +888,7 @@ static int vnc_update_client(VncState *vs, int has_dirty, bool sync) VncDisplay *vd = vs->vd; VncJob *job; int y; - int height; + int height, width; int n = 0; if (vs->output.offset && !vs->audio_cap && !vs->force_update) @@ -907,6 +907,7 @@ static int vnc_update_client(VncState *vs, int has_dirty, bool sync) job = vnc_job_new(vs); height = MIN(pixman_image_get_height(vd->server), vs->client_height); + width = MIN(pixman_image_get_width(vd->server), vs->client_width); y = 0; for (;;) { @@ -925,8 +926,11 @@ static int vnc_update_client(VncState *vs, int has_dirty, bool sync) VNC_DIRTY_BPL(vs), x); bitmap_clear(vs->dirty[y], x, x2 - x); h = find_and_clear_dirty_height(vs, y, x, x2, height); - n += vnc_job_add_rect(job, x * VNC_DIRTY_PIXELS_PER_BIT, y, - (x2 - x) * VNC_DIRTY_PIXELS_PER_BIT, h); + x2 = MIN(x2, width / VNC_DIRTY_PIXELS_PER_BIT); + if (x2 > x) { + n += vnc_job_add_rect(job, x * VNC_DIRTY_PIXELS_PER_BIT, y, + (x2 - x) * VNC_DIRTY_PIXELS_PER_BIT, h); + } } vnc_job_push(job);