From mboxrd@z Thu Jan 1 00:00:00 1970 From: Anthony Liguori Subject: Re: [PATCH] Don't explicitly set BAR values for VMware VGA Date: Sat, 23 Feb 2008 16:59:27 -0600 Message-ID: <47C0A54F.80504@codemonkey.ws> References: <1203709210-23314-1-git-send-email-aliguori@us.ibm.com> <47BF62DF.3090400@us.ibm.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------000908090403010702040205" Cc: kvm-devel@lists.sourceforge.net, qemu-devel@nongnu.org, Avi Kivity To: andrzej zaborowski Return-path: In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: kvm-devel-bounces@lists.sourceforge.net Errors-To: kvm-devel-bounces@lists.sourceforge.net List-Id: kvm.vger.kernel.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 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ --------------000908090403010702040205 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ kvm-devel mailing list kvm-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/kvm-devel --------------000908090403010702040205--