aboutsummaryrefslogtreecommitdiff
path: root/hw/display/tcx.c
diff options
context:
space:
mode:
authorMark Cave-Ayland <mark.cave-ayland@ilande.co.uk>2017-04-05 09:02:46 +0100
committerMark Cave-Ayland <mark.cave-ayland@ilande.co.uk>2017-04-21 09:02:04 +0100
commit427ee02bc9a3b8b5d5cb1066f6100a89eba6b201 (patch)
tree46db0ce6073dbc23e25d6b2068e91257da3f7a43 /hw/display/tcx.c
parent4b865c28099ddd365062f46dd1ad83c03b2468eb (diff)
tcx: alter tcx24_check_dirty() to accept address and length parameters
This can now be used by both the 8-bit and 24-bit display code, so rename to tcx_check_dirty(). Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'hw/display/tcx.c')
-rw-r--r--hw/display/tcx.c25
1 files changed, 14 insertions, 11 deletions
diff --git a/hw/display/tcx.c b/hw/display/tcx.c
index 6817bd207d..171236ae93 100644
--- a/hw/display/tcx.c
+++ b/hw/display/tcx.c
@@ -105,17 +105,21 @@ static void tcx_set_dirty(TCXState *s, ram_addr_t addr, int len)
}
}
-static inline int tcx24_check_dirty(TCXState *s, ram_addr_t page,
- ram_addr_t page24, ram_addr_t cpage)
+static int tcx_check_dirty(TCXState *s, ram_addr_t addr, int len)
{
int ret;
- ret = memory_region_get_dirty(&s->vram_mem, page, TARGET_PAGE_SIZE,
- DIRTY_MEMORY_VGA);
- ret |= memory_region_get_dirty(&s->vram_mem, page24, TARGET_PAGE_SIZE * 4,
- DIRTY_MEMORY_VGA);
- ret |= memory_region_get_dirty(&s->vram_mem, cpage, TARGET_PAGE_SIZE * 4,
- DIRTY_MEMORY_VGA);
+ ret = memory_region_get_dirty(&s->vram_mem, addr, len, DIRTY_MEMORY_VGA);
+
+ if (s->depth == 24) {
+ ret |= memory_region_get_dirty(&s->vram_mem,
+ s->vram24_offset + addr * 4, len * 4,
+ DIRTY_MEMORY_VGA);
+ ret |= memory_region_get_dirty(&s->vram_mem,
+ s->cplane_offset + addr * 4, len * 4,
+ DIRTY_MEMORY_VGA);
+ }
+
return ret;
}
@@ -366,8 +370,7 @@ 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 (memory_region_get_dirty(&ts->vram_mem, page, TARGET_PAGE_SIZE,
- DIRTY_MEMORY_VGA)) {
+ if (tcx_check_dirty(ts, page, TARGET_PAGE_SIZE)) {
if (y_start < 0)
y_start = y;
if (page < page_min)
@@ -461,7 +464,7 @@ static void tcx24_update_display(void *opaque)
memory_region_sync_dirty_bitmap(&ts->vram_mem);
for (y = 0; y < ts->height; page += TARGET_PAGE_SIZE,
page24 += TARGET_PAGE_SIZE, cpage += TARGET_PAGE_SIZE) {
- if (tcx24_check_dirty(ts, page, page24, cpage)) {
+ if (tcx_check_dirty(ts, page, TARGET_PAGE_SIZE)) {
if (y_start < 0)
y_start = y;
if (page < page_min)