From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=37628 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Psri8-0004WE-QQ for qemu-devel@nongnu.org; Fri, 25 Feb 2011 02:03:34 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Psri6-0003mZ-Rm for qemu-devel@nongnu.org; Fri, 25 Feb 2011 02:03:32 -0500 Received: from mail-ew0-f45.google.com ([209.85.215.45]:52960) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Psri6-0003mR-Kf for qemu-devel@nongnu.org; Fri, 25 Feb 2011 02:03:30 -0500 Received: by ewy24 with SMTP id 24so513602ewy.4 for ; Thu, 24 Feb 2011 23:03:29 -0800 (PST) MIME-Version: 1.0 In-Reply-To: <4D674B83.9030902@cn.fujitsu.com> References: <4D674B83.9030902@cn.fujitsu.com> Date: Fri, 25 Feb 2011 08:03:28 +0100 Message-ID: From: Corentin Chary Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] Re: [PATCH] fix vnc regression List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Wen Congyang Cc: Anthony Liguori , qemu-devel On Fri, Feb 25, 2011 at 7:26 AM, Wen Congyang wrote: > This patch fix the following two regressions: > 1. we should use bitmap_set() and bitmap_clear() to replace vnc_set_bits(= ). > 2. The unit of bitmap_intersects()'third parameter is bit, not words. > =C2=A0 But we pass the num of words to bitmap_intersects(). > > Signed-off-by: Wen Congyang > > --- > =C2=A0ui/vnc.c | =C2=A0 =C2=A08 ++++++-- > =C2=A01 files changed, 6 insertions(+), 2 deletions(-) > > diff --git a/ui/vnc.c b/ui/vnc.c > index 610f884..fff34af 100644 > --- a/ui/vnc.c > +++ b/ui/vnc.c > @@ -1655,7 +1655,10 @@ static void framebuffer_update_request(VncState *v= s, int incremental, > =C2=A0 =C2=A0 if (!incremental) { > =C2=A0 =C2=A0 =C2=A0 =C2=A0 vs->force_update =3D 1; > =C2=A0 =C2=A0 =C2=A0 =C2=A0 for (i =3D 0; i < h; i++) { > - =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0bitmap_set(vs->dirty[y_positio= n + i], x_position / 16, w / 16); > + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0bitmap_set(vs->dirty[y_positio= n + i], 0, > + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 (ds_get_width(vs->ds) / 16)); > + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0bitmap_clear(vs->dirty[y_posit= ion + i], (ds_get_width(vs->ds) / 16), > + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 VNC_DIRTY_WORDS * BITS_PER_LONG); > =C2=A0 =C2=A0 =C2=A0 =C2=A0 } > =C2=A0 =C2=A0 } > =C2=A0} Oh, right, (!incremental) case was broken. > @@ -2406,7 +2409,8 @@ static int vnc_refresh_server_surface(VncDisplay *v= d) > =C2=A0 =C2=A0 guest_row =C2=A0=3D vd->guest.ds->data; > =C2=A0 =C2=A0 server_row =3D vd->server->data; > =C2=A0 =C2=A0 for (y =3D 0; y < vd->guest.ds->height; y++) { > - =C2=A0 =C2=A0 =C2=A0 =C2=A0if (bitmap_intersects(vd->guest.dirty[y], wi= dth_mask, VNC_DIRTY_WORDS)) { > + =C2=A0 =C2=A0 =C2=A0 =C2=A0if (bitmap_intersects(vd->guest.dirty[y], wi= dth_mask, > + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0VNC_DIRTY_WORDS * BITS_PER_LON= G)) { > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 int x; > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 uint8_t *guest_ptr; > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 uint8_t *server_ptr; Good catch, Thanks, Acked-by: Corentin Chary --=20 Corentin Chary http://xf.iksaif.net