Skip to content

Commit

Permalink
tcx: remove TARGET_PAGE_SIZE from tcx_update_display()
Browse files Browse the repository at this point in the history
Now that page alignment is handled by the memory API, there is no need to
duplicate the code 4 times (4 * 1024 == 4096 == TARGET_PAGE_SIZE).

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>
  • Loading branch information
mcayland committed Apr 21, 2017
1 parent 66dcabe commit 0a97c6c
Showing 1 changed file with 4 additions and 32 deletions.
36 changes: 4 additions & 32 deletions hw/display/tcx.c
Expand Up @@ -363,8 +363,8 @@ static void tcx_update_display(void *opaque)
}

memory_region_sync_dirty_bitmap(&ts->vram_mem);
for (y = 0; y < ts->height; page += TARGET_PAGE_SIZE) {
if (tcx_check_dirty(ts, page, TARGET_PAGE_SIZE)) {
for (y = 0; y < ts->height; y++, page += ds) {
if (tcx_check_dirty(ts, page, ds)) {
if (y_start < 0)
y_start = y;
if (page < page_min)
Expand All @@ -376,44 +376,16 @@ static void tcx_update_display(void *opaque)
if (y >= ts->cursy && y < ts->cursy + 32 && ts->cursx < ts->width) {
fc(ts, d, y, ts->width);
}
d += dd;
s += ds;
y++;

f(ts, d, s, ts->width);
if (y >= ts->cursy && y < ts->cursy + 32 && ts->cursx < ts->width) {
fc(ts, d, y, ts->width);
}
d += dd;
s += ds;
y++;

f(ts, d, s, ts->width);
if (y >= ts->cursy && y < ts->cursy + 32 && ts->cursx < ts->width) {
fc(ts, d, y, ts->width);
}
d += dd;
s += ds;
y++;

f(ts, d, s, ts->width);
if (y >= ts->cursy && y < ts->cursy + 32 && ts->cursx < ts->width) {
fc(ts, d, y, ts->width);
}
d += dd;
s += ds;
y++;
} else {
if (y_start >= 0) {
/* flush to display */
dpy_gfx_update(ts->con, 0, y_start,
ts->width, y - y_start);
y_start = -1;
}
d += dd * 4;
s += ds * 4;
y += 4;
}
s += ds;
d += dd;
}
if (y_start >= 0) {
/* flush to display */
Expand Down

0 comments on commit 0a97c6c

Please sign in to comment.