[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v2 09/13] tcx: remove TARGET_PAGE_SIZE from tcx_upda
From: |
Mark Cave-Ayland |
Subject: |
[Qemu-devel] [PATCH v2 09/13] tcx: remove TARGET_PAGE_SIZE from tcx_update_display() |
Date: |
Fri, 21 Apr 2017 09:28:43 +0100 |
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 <address@hidden>
Reviewed-by: Gerd Hoffmann <address@hidden>
---
hw/display/tcx.c | 36 ++++--------------------------------
1 file changed, 4 insertions(+), 32 deletions(-)
diff --git a/hw/display/tcx.c b/hw/display/tcx.c
index 4f4f03f..14a17fe 100644
--- a/hw/display/tcx.c
+++ b/hw/display/tcx.c
@@ -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)
@@ -376,33 +376,6 @@ 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 */
@@ -410,10 +383,9 @@ static void tcx_update_display(void *opaque)
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 */
--
1.7.10.4
- [Qemu-devel] [PATCH v2 00/13] TCX/CG3 adapter cleanups, Mark Cave-Ayland, 2017/04/21
- [Qemu-devel] [PATCH v2 09/13] tcx: remove TARGET_PAGE_SIZE from tcx_update_display(),
Mark Cave-Ayland <=
- [Qemu-devel] [PATCH v2 08/13] tcx: remove page24 and cpage from tcx24_update_display(), Mark Cave-Ayland, 2017/04/21
- [Qemu-devel] [PATCH v2 02/13] cg3: fix up size parameter for memory_region_get_dirty(), Mark Cave-Ayland, 2017/04/21
- [Qemu-devel] [PATCH v2 06/13] tcx: alter tcx24_check_dirty() to accept address and length parameters, Mark Cave-Ayland, 2017/04/21
- [Qemu-devel] [PATCH v2 04/13] tcx: alter tcx_set_dirty() to accept address and length parameters, Mark Cave-Ayland, 2017/04/21
- [Qemu-devel] [PATCH v2 05/13] tcx: ensure tcx_set_dirty() also invalidates the 24-bit plane and cplane, Mark Cave-Ayland, 2017/04/21
- [Qemu-devel] [PATCH v2 07/13] tcx: alter tcx24_reset_dirty() to accept address and length parameters, Mark Cave-Ayland, 2017/04/21
- [Qemu-devel] [PATCH v2 01/13] cg3: remove TARGET_PAGE_SIZE rounding on dirty page detection, Mark Cave-Ayland, 2017/04/21
- [Qemu-devel] [PATCH v2 03/13] cg3: switch to load_image_mr() and remove prom-addr hack, Mark Cave-Ayland, 2017/04/21
- [Qemu-devel] [PATCH v2 11/13] tcx: remove primitives for non-32-bit surfaces, Mark Cave-Ayland, 2017/04/21