Received: from eggs.gnu.org ([208.118.235.92]:34622) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T4Kzw-0004Yg-1w for qemu-devel@nongnu.org; Wed, 22 Aug 2012 20:10:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T4Kzs-0007mA-UT for qemu-devel@nongnu.org; Wed, 22 Aug 2012 20:10:07 -0400 Received: from mono.eik.bme.hu ([152.66.115.2]:64393) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T4Kzs-0007jt-O5 for qemu-devel@nongnu.org; Wed, 22 Aug 2012 20:10:04 -0400 Received: from localhost (localhost [127.0.0.1]) by mono.eik.bme.hu (Postfix) with ESMTP id 862BF27E for ; Thu, 23 Aug 2012 02:10:03 +0200 (CEST) Received: from mono.eik.bme.hu ([127.0.0.1]) by localhost (mono.eik.bme.hu [127.0.0.1]) (amavisd-new, port 10024) with LMTP id inGkMd-p6rXL for ; Thu, 23 Aug 2012 02:10:03 +0200 (CEST) Date: Thu, 23 Aug 2012 02:10:03 +0200 (CEST) From: BALATON Zoltan Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Subject: [Qemu-devel] [PATCH 2/3] vmware_vga: Return a value for FB_SIZE before the device is enabled List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org According to the documentation drivers using this device should read FB_SIZE before enabling the device to know what memory to map. This would not work if we return 0 before enabled. Signed-off-by: BALATON Zoltan --- hw/vmware_vga.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) Split up version of previous [PATCH] vmware_vga: Cleanup and allow simple drivers to work without the fifo diff --git a/hw/vmware_vga.c b/hw/vmware_vga.c index 0a73c7a..3c4beb9 100644 --- a/hw/vmware_vga.c +++ b/hw/vmware_vga.c @@ -39,8 +39,12 @@ struct vmsvga_state_s { VGACommonState vga; +/* -*- The members marked are now unused and could be removed but they are + * contained in the VMState thus need special handling. Maybe they could + * be removed the next time a new machine type is added. + */ int invalidated; - int depth; + int depth; /* -*- */ int enable; int config; struct { @@ -58,7 +62,7 @@ struct vmsvga_state_s { uint32_t guest; uint32_t svgaid; int syncing; - int fb_size; + int fb_size; /* -*- */ MemoryRegion fifo_ram; uint8_t *fifo_ptr; @@ -733,10 +737,10 @@ static uint32_t vmsvga_value_read(void *opaque, uint32_t address) return 0x0; case SVGA_REG_VRAM_SIZE: - return s->vga.vram_size; + return s->vga.vram_size; /* No physical VRAM besides the framebuffer */ case SVGA_REG_FB_SIZE: - return s->fb_size; + return s->vga.vram_size; case SVGA_REG_CAPABILITIES: caps = SVGA_CAP_NONE; @@ -821,7 +825,6 @@ static void vmsvga_value_write(void *opaque, uint32_t address, uint32_t value) s->invalidated = 1; s->vga.invalidate(&s->vga); if (s->enable) { - s->fb_size = ((s->depth + 7) >> 3) * s->new_width * s->new_height; vga_dirty_log_stop(&s->vga); } else { vga_dirty_log_start(&s->vga); -- 1.7.10