From: Dave Airlie <airlied@gmail.com>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH 5/6] VMware VGA: Only enable dirty log tracking when fifo is disabled
Date: Fri, 18 Dec 2009 08:08:10 +1000 [thread overview]
Message-ID: <1261087691-8319-6-git-send-email-airlied@gmail.com> (raw)
In-Reply-To: <1261087691-8319-5-git-send-email-airlied@gmail.com>
From: Anthony Liguori <aliguori@us.ibm.com>
This patch enables dirty log tracking whenever it's needed and disables it
when it is not.
We unconditionally enable dirty log tracking on reset, restart dirty log
tracking when PCI IO regions are remapped, and disable/enable it based on
commands from the guest.
Rebased-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
---
hw/vga.c | 22 ++++++++++++++++++++++
hw/vga_int.h | 2 ++
hw/vmware_vga.c | 16 ++++++++++++----
3 files changed, 36 insertions(+), 4 deletions(-)
diff --git a/hw/vga.c b/hw/vga.c
index 5b0c55e..d05f1f9 100644
--- a/hw/vga.c
+++ b/hw/vga.c
@@ -1606,7 +1606,29 @@ void vga_dirty_log_start(VGACommonState *s)
kvm_log_start(VBE_DISPI_LFB_PHYSICAL_ADDRESS, s->vram_size);
}
#endif
+}
+
+void vga_dirty_log_stop(VGACommonState *s)
+{
+ if (kvm_enabled() && s->map_addr)
+ kvm_log_stop(s->map_addr, s->map_end - s->map_addr);
+
+ if (kvm_enabled() && s->lfb_vram_mapped) {
+ kvm_log_stop(isa_mem_base + 0xa0000, 0x80000);
+ kvm_log_stop(isa_mem_base + 0xa8000, 0x80000);
+ }
+#ifdef CONFIG_BOCHS_VBE
+ if (kvm_enabled() && s->vbe_mapped) {
+ kvm_log_stop(VBE_DISPI_LFB_PHYSICAL_ADDRESS, s->vram_size);
+ }
+#endif
+}
+
+void vga_dirty_log_restart(VGACommonState *s)
+{
+ vga_dirty_log_stop(s);
+ vga_dirty_log_start(s);
}
/*
diff --git a/hw/vga_int.h b/hw/vga_int.h
index b5302c1..23a42ef 100644
--- a/hw/vga_int.h
+++ b/hw/vga_int.h
@@ -194,6 +194,8 @@ void vga_init(VGACommonState *s);
void vga_common_reset(VGACommonState *s);
void vga_dirty_log_start(VGACommonState *s);
+void vga_dirty_log_stop(VGACommonState *s);
+void vga_dirty_log_restart(VGACommonState *s);
extern const VMStateDescription vmstate_vga_common;
uint32_t vga_ioport_read(void *opaque, uint32_t addr);
diff --git a/hw/vmware_vga.c b/hw/vmware_vga.c
index ae91327..e3d5706 100644
--- a/hw/vmware_vga.c
+++ b/hw/vmware_vga.c
@@ -771,8 +771,12 @@ static void vmsvga_value_write(void *opaque, uint32_t address, uint32_t value)
s->height = -1;
s->invalidated = 1;
s->vga.invalidate(&s->vga);
- if (s->enable)
- s->fb_size = ((s->depth + 7) >> 3) * s->new_width * s->new_height;
+ 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);
+ }
break;
case SVGA_REG_WIDTH:
@@ -948,6 +952,8 @@ static void vmsvga_reset(struct vmsvga_state_s *s)
break;
}
s->syncing = 0;
+
+ vga_dirty_log_start(&s->vga);
}
static void vmsvga_invalidate_display(void *opaque)
@@ -1119,7 +1125,6 @@ static void vmsvga_init(struct vmsvga_state_s *s, int vga_ram_size)
vmsvga_screen_dump,
vmsvga_text_update, s);
- vmsvga_reset(s);
s->fifo_size = SVGA_FIFO_SIZE;
s->fifo_offset = qemu_ram_alloc(s->fifo_size);
@@ -1130,7 +1135,10 @@ static void vmsvga_init(struct vmsvga_state_s *s, int vga_ram_size)
vmstate_register(0, &vmstate_vga_common, &s->vga);
vga_init_vbe(&s->vga);
+
rom_add_vga(VGABIOS_FILENAME);
+
+ vmsvga_reset(s);
}
static void pci_vmsvga_map_ioport(PCIDevice *pci_dev, int region_num,
@@ -1172,7 +1180,7 @@ static void pci_vmsvga_map_mem(PCIDevice *pci_dev, int region_num,
s->vga.map_addr = addr;
s->vga.map_end = addr + s->vga.vram_size;
- vga_dirty_log_start(&s->vga);
+ vga_dirty_log_restart(&s->vga);
}
static void pci_vmsvga_map_fifo(PCIDevice *pci_dev, int region_num,
--
1.6.5.2
next prev parent reply other threads:[~2009-12-17 22:10 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-12-17 22:08 [Qemu-devel] qemu fixup patch sequence Dave Airlie
2009-12-17 22:08 ` [Qemu-devel] [PATCH 1/6] vmware: setup PCI BAR 2 for FIFO as per vmware spec Dave Airlie
2009-12-17 22:08 ` [Qemu-devel] [PATCH 2/6] Make sure to enable dirty tracking of VBE vram mapping Dave Airlie
2009-12-17 22:08 ` [Qemu-devel] [PATCH 3/6] Make sure to enable dirty log tracking for VMware VGA Dave Airlie
2009-12-17 22:08 ` [Qemu-devel] [PATCH 4/6] Fix VMware VGA depth computation Dave Airlie
2009-12-17 22:08 ` Dave Airlie [this message]
2009-12-17 22:08 ` [Qemu-devel] [PATCH 6/6] vmware: increase cursor buffer size Dave Airlie
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1261087691-8319-6-git-send-email-airlied@gmail.com \
--to=airlied@gmail.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).