Patchwork [13/24] cirrus: wrap memory update in a transaction

login
register
mail settings
Submitter Avi Kivity
Date Aug. 24, 2011, 10:11 a.m.
Message ID <1314180683-8227-14-git-send-email-avi@redhat.com>
Download mbox | patch
Permalink /patch/111292/
State New
Headers show

Comments

Avi Kivity - Aug. 24, 2011, 10:11 a.m.
This prevents spurious unmapping and remapping of the vga windows,
which reduces performance.

Signed-off-by: Avi Kivity <avi@redhat.com>
---
 hw/cirrus_vga.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

Patch

diff --git a/hw/cirrus_vga.c b/hw/cirrus_vga.c
index 4d0ef0d..ec7ea82 100644
--- a/hw/cirrus_vga.c
+++ b/hw/cirrus_vga.c
@@ -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();
 }