cirrus: wrap memory update in a transaction
authorAvi Kivity <avi@redhat.com>
Mon, 1 Aug 2011 08:03:42 +0000 (11:03 +0300)
committerAvi Kivity <avi@redhat.com>
Thu, 25 Aug 2011 07:56:33 +0000 (10:56 +0300)
This prevents spurious unmapping and remapping of the vga windows,
which reduces performance.

Reviewed-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Avi Kivity <avi@redhat.com>
hw/cirrus_vga.c

index 4d0ef0d54cf1d83f1145fdb7fba14f87ed25827d..ec7ea8207b4a7f3c106affab0d4f44b9e695a893 100644 (file)
@@ -2424,6 +2424,7 @@ static void cirrus_update_memory_access(CirrusVGAState *s)
 {
     unsigned mode;
 
+    memory_region_transaction_begin();
     if ((s->vga.sr[0x17] & 0x44) == 0x44) {
         goto generic_io;
     } else if (s->cirrus_srcptr != s->cirrus_srcptr_end) {
@@ -2443,6 +2444,7 @@ static void cirrus_update_memory_access(CirrusVGAState *s)
             unmap_linear_vram(s);
         }
     }
+    memory_region_transaction_commit();
 }