From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stefano Stabellini Subject: Re: [PATCH] vnc linesize Date: Thu, 20 Mar 2008 18:26:25 +0000 Message-ID: <47E2AC51.1030404@eu.citrix.com> References: <47E14C52.3040300@eu.citrix.com> <1206034265.27908.124.camel@bling> <47E2A99B.5070700@eu.citrix.com> <1206037403.27908.129.camel@bling> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------050802040807000102090405" Return-path: In-Reply-To: <1206037403.27908.129.camel@bling> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Alex Williamson Cc: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org This is a multi-part message in MIME format. --------------050802040807000102090405 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Alex Williamson wrote: > Hi Stefano, > > On Thu, 2008-03-20 at 18:14 +0000, Stefano Stabellini wrote: >> Hi Alex, >> I think I have found the bug that causes the strange behaviour you are >> describing, but I have no way to be sure because I cannot test it on a >> ia64 machine. >> Could you please try the patch I am attaching (to be applied on top of >> the other one)? > > Yes, this fixes it. Thanks! great! Sending the patch again more "officially" this time. Signed-off-by: Stefano Stabellini --------------050802040807000102090405 Content-Type: text/x-patch; name="linesize2.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="linesize2.patch" diff -r 491a3b62ae5b tools/ioemu/vnc.c --- a/tools/ioemu/vnc.c Thu Mar 20 17:48:02 2008 +0000 +++ b/tools/ioemu/vnc.c Thu Mar 20 18:03:52 2008 +0000 @@ -370,16 +370,20 @@ static void vnc_dpy_resize(DisplayState int o; if (!ds->shared_buf) { + ds->linesize = w * vs->depth; if (allocated) - ds->data = realloc(ds->data, h * linesize); + ds->data = realloc(ds->data, h * ds->linesize); else - ds->data = malloc(h * linesize); + ds->data = malloc(h * ds->linesize); allocated = 1; - } else if (allocated) { - free(ds->data); - allocated = 0; - } - vs->old_data = realloc(vs->old_data, h * linesize); + } else { + ds->linesize = linesize; + if (allocated) { + free(ds->data); + allocated = 0; + } + } + vs->old_data = realloc(vs->old_data, h * ds->linesize); vs->dirty_row = realloc(vs->dirty_row, h * sizeof(vs->dirty_row[0])); vs->update_row = realloc(vs->update_row, h * sizeof(vs->dirty_row[0])); @@ -396,7 +400,6 @@ static void vnc_dpy_resize(DisplayState size_changed = ds->width != w || ds->height != h; ds->width = w; ds->height = h; - ds->linesize = linesize; if (vs->csock != -1 && vs->has_resize && size_changed) { vs->width = ds->width; vs->height = ds->height; --------------050802040807000102090405 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --------------050802040807000102090405--