Revision 2bec46dc hw/vga.c

b/hw/vga.c
28 28
#include "vga_int.h"
29 29
#include "pixel_ops.h"
30 30
#include "qemu-timer.h"
31
#include "kvm.h"
31 32

  
32 33
//#define DEBUG_VGA
33 34
//#define DEBUG_VGA_MEM
......
1243 1244
    vga_draw_glyph8_func *vga_draw_glyph8;
1244 1245
    vga_draw_glyph9_func *vga_draw_glyph9;
1245 1246

  
1247
    vga_dirty_log_stop(s);
1248

  
1246 1249
    full_update |= update_palette16(s);
1247 1250
    palette = s->last_palette;
1248 1251

  
......
1556 1559
    }
1557 1560
}
1558 1561

  
1562
static void vga_sync_dirty_bitmap(VGAState *s)
1563
{
1564
    if (s->map_addr)
1565
        cpu_physical_sync_dirty_bitmap(s->map_addr, s->map_end);
1566

  
1567
    if (s->lfb_vram_mapped) {
1568
        cpu_physical_sync_dirty_bitmap(isa_mem_base + 0xa0000, 0xa8000);
1569
        cpu_physical_sync_dirty_bitmap(isa_mem_base + 0xa8000, 0xb0000);
1570
    }
1571
    vga_dirty_log_start(s);
1572
}
1573

  
1559 1574
/*
1560 1575
 * graphic modes
1561 1576
 */
......
1570 1585

  
1571 1586
    full_update |= update_basic_params(s);
1572 1587

  
1588
    if (!full_update)
1589
        vga_sync_dirty_bitmap(s);
1590

  
1573 1591
    s->get_resolution(s, &width, &height);
1574 1592
    disp_width = width;
1575 1593

  
......
1743 1761
        return;
1744 1762
    if (s->last_scr_width <= 0 || s->last_scr_height <= 0)
1745 1763
        return;
1764
    vga_dirty_log_stop(s);
1765

  
1746 1766
    if (ds_get_bits_per_pixel(s->ds) == 8)
1747 1767
        val = s->rgb_to_pixel(0, 0, 0);
1748 1768
    else
......
2092 2112
    VGAState vga_state;
2093 2113
} PCIVGAState;
2094 2114

  
2115
void vga_dirty_log_start(VGAState *s)
2116
{
2117
    if (kvm_enabled() && s->map_addr)
2118
        kvm_log_start(s->map_addr, s->map_end - s->map_addr);
2119

  
2120
    if (kvm_enabled() && s->lfb_vram_mapped) {
2121
        kvm_log_start(isa_mem_base + 0xa0000, 0x8000);
2122
        kvm_log_start(isa_mem_base + 0xa8000, 0x8000);
2123
    }
2124
}
2125

  
2126
void vga_dirty_log_stop(VGAState *s)
2127
{
2128
    if (kvm_enabled() && s->map_addr)
2129
        kvm_log_stop(s->map_addr, s->map_end - s->map_addr);
2130

  
2131
    if (kvm_enabled() && s->lfb_vram_mapped) {
2132
        kvm_log_stop(isa_mem_base + 0xa0000, 0x8000);
2133
        kvm_log_stop(isa_mem_base + 0xa8000, 0x8000);
2134
    }
2135
}
2136

  
2095 2137
static void vga_map(PCIDevice *pci_dev, int region_num,
2096 2138
                    uint32_t addr, uint32_t size, int type)
2097 2139
{
......
2102 2144
    } else {
2103 2145
        cpu_register_physical_memory(addr, s->vram_size, s->vram_offset);
2104 2146
    }
2147

  
2148
    s->map_addr = addr;
2149
    s->map_end = addr + VGA_RAM_SIZE;
2150

  
2151
    vga_dirty_log_start(s);
2105 2152
}
2106 2153

  
2107 2154
void vga_common_init(VGAState *s, DisplayState *ds, uint8_t *vga_ram_base,

Also available in: Unified diff