Resending, sorry if this is a duplicate

---------- Forwarded message ----------
From: Igor Kovalenko
Date: Aug 3, 2006 12:48 AM
Subject: sparc emulation tcx_update_display fix
To: qemu-devel@nongnu.org

Hi!

Noticed that integer promotion precludes tcx display emulator from resetting VGA_DIRTY_FLAG on pages it scanned, patch attached.
Before this change, ~75% host cpu is busy with drawing display lines, now it is ~1% only.


Index: hw/tcx.c
===================================================================
RCS file: /cvsroot/qemu/qemu/hw/tcx.c,v
retrieving revision 1.7
diff -u -r1.7 tcx.c
--- hw/tcx.c	9 Apr 2006 01:06:34 -0000	1.7
+++ hw/tcx.c	2 Aug 2006 20:36:04 -0000
@@ -86,8 +86,8 @@
 static void tcx_update_display(void *opaque)
 {
     TCXState *ts = opaque;
-    uint32_t page;
-    int y, page_min, page_max, y_start, dd, ds;
+    unsigned long page, page_min, page_max;
+    int y, y_start, dd, ds;
     uint8_t *d, *s;
     void (*f)(TCXState *s1, uint8_t *d, const uint8_t *s, int width);
 
@@ -96,7 +96,7 @@
     page = ts->vram_offset;
     y_start = -1;
     page_min = 0x7fffffff;
-    page_max = -1;
+    page_max = 0;
     d = ts->ds->data;
     s = ts->vram;
     dd = ts->ds->linesize;
@@ -154,7 +154,7 @@
 		   ts->width, y - y_start);
     }
     /* reset modified pages */
-    if (page_max != -1) {
+    if (page_max > 0) {
         cpu_physical_memory_reset_dirty(page_min, page_max + TARGET_PAGE_SIZE,
                                         VGA_DIRTY_FLAG);
     }
_______________________________________________
Qemu-devel mailing list
Qemu-devel@nongnu.org
http://lists.nongnu.org/mailman/listinfo/qemu-devel

Reply via email to