From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JT3LH-0007jB-Oo for qemu-devel@nongnu.org; Sat, 23 Feb 2008 17:59:39 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JT3LF-0007ic-V9 for qemu-devel@nongnu.org; Sat, 23 Feb 2008 17:59:39 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JT3LF-0007iY-Po for qemu-devel@nongnu.org; Sat, 23 Feb 2008 17:59:37 -0500 Received: from el-out-1112.google.com ([209.85.162.179]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JT3LF-0007On-Cx for qemu-devel@nongnu.org; Sat, 23 Feb 2008 17:59:37 -0500 Received: by el-out-1112.google.com with SMTP id y26so878718ele.18 for ; Sat, 23 Feb 2008 14:59:35 -0800 (PST) Message-ID: <47C0A54F.80504@codemonkey.ws> Date: Sat, 23 Feb 2008 16:59:27 -0600 From: Anthony Liguori MIME-Version: 1.0 References: <1203709210-23314-1-git-send-email-aliguori@us.ibm.com> <47BF62DF.3090400@us.ibm.com> In-Reply-To: Content-Type: multipart/mixed; boundary="------------000908090403010702040205" Subject: [Qemu-devel] Re: [kvm-devel] [PATCH] Don't explicitly set BAR values for VMware VGA Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: andrzej zaborowski Cc: kvm-devel@lists.sourceforge.net, qemu-devel@nongnu.org This is a multi-part message in MIME format. --------------000908090403010702040205 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit andrzej zaborowski wrote: > Oh, good question, and I think the answer be the reason why it's not > working here (*slaps self*). I'll apply the patch if you can confirm > that it works with some Ms Windows install. > I just tried with Windows XP and I have no problem detecting the card with this patch. FWIW, I needed to use the following patch to avoid SEGVs as it seems there's a bug in the emulation where the update region is larger than the screen. My first impression is that it's related to cursor drawing as it only happens when I click on the start button and the update region height is 36 pixels which looks like a cursor size to me. This is true with or without the BAR patch though. I'll look into it a little more and see what's going on. Regards, Anthony Liguori > I just launched the VM and checked what kind of Ms Windows set up this > is and it's a "Windows XP professional 2002" with VMware Tools > installed, and all the files on it have last modification date in 2004 > or earlier. Apparently I stole the already set up VM from my dad's > computer on which he used VMware, somewhere in 2004. I then converted > the image to raw and always performed my tests with -snapshot on. > This may be why the system is unwilling to use different base > addresses. > --------------000908090403010702040205 Content-Type: text/x-diff; name="qemu-vmware-check-update.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="qemu-vmware-check-update.patch" diff --git a/qemu/hw/vmware_vga.c b/qemu/hw/vmware_vga.c index f2a298e..0204d88 100644 --- a/qemu/hw/vmware_vga.c +++ b/qemu/hw/vmware_vga.c @@ -295,12 +295,31 @@ static inline void vmsvga_update_rect(struct vmsvga_state_s *s, int x, int y, int w, int h) { #ifndef DIRECT_VRAM - int line = h; - int bypl = s->bypp * s->width; - int width = s->bypp * w; - int start = s->bypp * x + bypl * y; - uint8_t *src = s->vram + start; - uint8_t *dst = s->ds->data + start; + int line; + int bypl; + int width; + int start; + uint8_t *src; + uint8_t *dst; + + if ((x + w) > s->ds->width) { + fprintf(stderr, "update width too large x: %d, w: %d\n", x, w); + x = MIN(x, s->ds->width); + w = s->ds->width - x; + } + + if ((y + h) > s->ds->height) { + fprintf(stderr, "update height too large y: %d, h: %d\n", y, h); + y = MIN(y, s->ds->height); + h = s->ds->height - y; + } + + line = h; + bypl = s->bypp * s->width; + width = s->bypp * w; + start = s->bypp * x + bypl * y; + src = s->vram + start; + dst = s->ds->data + start; for (; line > 0; line --, src += bypl, dst += bypl) memcpy(dst, src, width); --------------000908090403010702040205--