@@ -28,7 +28,6 @@
#include "vga_int.h"
#include "pixel_ops.h"
#include "qemu-timer.h"
-#include "kvm.h"
typedef struct PCIVGAState {
PCIDevice dev;
@@ -59,48 +58,6 @@ static int pci_vga_load(QEMUFile *f, void *opaque, int version_id)
return vga_common_load(f, &s->vga, version_id);
}
-static int s1, s2;
-
-static void mark_dirty(target_phys_addr_t start, target_phys_addr_t len)
-{
- target_phys_addr_t end = start + len;
-
- while (start < end) {
- cpu_physical_memory_set_dirty(cpu_get_physical_page_desc(start));
- start += TARGET_PAGE_SIZE;
- }
-}
-
-void vga_dirty_log_start(VGACommonState *s)
-{
- if (kvm_enabled() && s->map_addr)
- if (!s1) {
- kvm_log_start(s->map_addr, s->map_end - s->map_addr);
- mark_dirty(s->map_addr, s->map_end - s->map_addr);
- s1 = 1;
- }
- if (kvm_enabled() && s->lfb_vram_mapped) {
- if (!s2) {
- kvm_log_start(isa_mem_base + 0xa0000, 0x8000);
- kvm_log_start(isa_mem_base + 0xa8000, 0x8000);
- mark_dirty(isa_mem_base + 0xa0000, 0x10000);
- }
- s2 = 1;
- }
-}
-
-void vga_dirty_log_stop(VGACommonState *s)
-{
- if (kvm_enabled() && s->map_addr && s1)
- kvm_log_stop(s->map_addr, s->map_end - s->map_addr);
-
- if (kvm_enabled() && s->lfb_vram_mapped && s2) {
- kvm_log_stop(isa_mem_base + 0xa0000, 0x8000);
- kvm_log_stop(isa_mem_base + 0xa8000, 0x8000);
- }
- s1 = s2 = 0;
-}
-
static void vga_map(PCIDevice *pci_dev, int region_num,
uint32_t addr, uint32_t size, int type)
{
@@ -28,6 +28,7 @@
#include "vga_int.h"
#include "pixel_ops.h"
#include "qemu-timer.h"
+#include "kvm.h"
//#define DEBUG_VGA
//#define DEBUG_VGA_MEM
@@ -1579,6 +1580,48 @@ static void vga_sync_dirty_bitmap(VGACommonState *s)
vga_dirty_log_start(s);
}
+static int s1, s2;
+
+static void mark_dirty(target_phys_addr_t start, target_phys_addr_t len)
+{
+ target_phys_addr_t end = start + len;
+
+ while (start < end) {
+ cpu_physical_memory_set_dirty(cpu_get_physical_page_desc(start));
+ start += TARGET_PAGE_SIZE;
+ }
+}
+
+void vga_dirty_log_start(VGACommonState *s)
+{
+ if (kvm_enabled() && s->map_addr)
+ if (!s1) {
+ kvm_log_start(s->map_addr, s->map_end - s->map_addr);
+ mark_dirty(s->map_addr, s->map_end - s->map_addr);
+ s1 = 1;
+ }
+ if (kvm_enabled() && s->lfb_vram_mapped) {
+ if (!s2) {
+ kvm_log_start(isa_mem_base + 0xa0000, 0x8000);
+ kvm_log_start(isa_mem_base + 0xa8000, 0x8000);
+ mark_dirty(isa_mem_base + 0xa0000, 0x10000);
+ }
+ s2 = 1;
+ }
+}
+
+void vga_dirty_log_stop(VGACommonState *s)
+{
+ if (kvm_enabled() && s->map_addr && s1)
+ kvm_log_stop(s->map_addr, s->map_end - s->map_addr);
+
+ if (kvm_enabled() && s->lfb_vram_mapped && s2) {
+ kvm_log_stop(isa_mem_base + 0xa0000, 0x8000);
+ kvm_log_stop(isa_mem_base + 0xa8000, 0x8000);
+ }
+ s1 = s2 = 0;
+}
+
/*
* graphic modes
*/
Signed-off-by: Juan Quintela <quintela@redhat.com> --- hw/vga-pci.c | 43 ------------------------------------------- hw/vga.c | 43 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+), 43 deletions(-)