Commit 0486e8a71462430438a1ac593db0ffe0fb38b9a8
1 parent
f5fdd0a8
Fix fragments due to incomplete dirty tracking in CGA mode (Anthony Liguori).
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3809 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
1 changed file
with
7 additions
and
0 deletions
vnc.c
@@ -258,6 +258,13 @@ static void vnc_dpy_update(DisplayState *ds, int x, int y, int w, int h) | @@ -258,6 +258,13 @@ static void vnc_dpy_update(DisplayState *ds, int x, int y, int w, int h) | ||
258 | 258 | ||
259 | h += y; | 259 | h += y; |
260 | 260 | ||
261 | + /* round x down to ensure the loop only spans one 16-pixel block per, | ||
262 | + iteration. otherwise, if (x % 16) != 0, the last iteration may span | ||
263 | + two 16-pixel blocks but we only mark the first as dirty | ||
264 | + */ | ||
265 | + w += (x % 16); | ||
266 | + x -= (x % 16); | ||
267 | + | ||
261 | for (; y < h; y++) | 268 | for (; y < h; y++) |
262 | for (i = 0; i < w; i += 16) | 269 | for (i = 0; i < w; i += 16) |
263 | vnc_set_bit(vs->dirty_row[y], (x + i) / 16); | 270 | vnc_set_bit(vs->dirty_row[y], (x + i) / 16); |