[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 11/14] tcx: remove TARGET_PAGE_SIZE from tcx24_updat
From: |
Mark Cave-Ayland |
Subject: |
[Qemu-devel] [PATCH 11/14] tcx: remove TARGET_PAGE_SIZE from tcx24_update_display() |
Date: |
Wed, 5 Apr 2017 09:35:26 +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).
Finally we have now removed all traces of TARGET_PAGE_SIZE.
Signed-off-by: Mark Cave-Ayland <address@hidden>
---
hw/display/tcx.c | 46 ++++++----------------------------------------
1 file changed, 6 insertions(+), 40 deletions(-)
diff --git a/hw/display/tcx.c b/hw/display/tcx.c
index 14a17fe..0dd007e 100644
--- a/hw/display/tcx.c
+++ b/hw/display/tcx.c
@@ -25,7 +25,6 @@
#include "qemu/osdep.h"
#include "qapi/error.h"
#include "qemu-common.h"
-#include "cpu.h" /* FIXME shouldn't use TARGET_PAGE_SIZE */
#include "ui/console.h"
#include "ui/pixel_ops.h"
#include "hw/loader.h"
@@ -423,8 +422,8 @@ static void tcx24_update_display(void *opaque)
ds = 1024;
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)
@@ -435,38 +434,6 @@ static void tcx24_update_display(void *opaque)
if (y >= ts->cursy && y < ts->cursy+32 && ts->cursx < ts->width) {
tcx_draw_cursor32(ts, d, y, ts->width);
}
- d += dd;
- s += ds;
- cptr += ds;
- s24 += ds;
- y++;
- tcx24_draw_line32(ts, d, s, ts->width, cptr, s24);
- if (y >= ts->cursy && y < ts->cursy+32 && ts->cursx < ts->width) {
- tcx_draw_cursor32(ts, d, y, ts->width);
- }
- d += dd;
- s += ds;
- cptr += ds;
- s24 += ds;
- y++;
- tcx24_draw_line32(ts, d, s, ts->width, cptr, s24);
- if (y >= ts->cursy && y < ts->cursy+32 && ts->cursx < ts->width) {
- tcx_draw_cursor32(ts, d, y, ts->width);
- }
- d += dd;
- s += ds;
- cptr += ds;
- s24 += ds;
- y++;
- tcx24_draw_line32(ts, d, s, ts->width, cptr, s24);
- if (y >= ts->cursy && y < ts->cursy+32 && ts->cursx < ts->width) {
- tcx_draw_cursor32(ts, d, y, ts->width);
- }
- d += dd;
- s += ds;
- cptr += ds;
- s24 += ds;
- y++;
} else {
if (y_start >= 0) {
/* flush to display */
@@ -474,12 +441,11 @@ static void tcx24_update_display(void *opaque)
ts->width, y - y_start);
y_start = -1;
}
- d += dd * 4;
- s += ds * 4;
- cptr += ds * 4;
- s24 += ds * 4;
- y += 4;
}
+ d += dd;
+ s += ds;
+ cptr += ds;
+ s24 += ds;
}
if (y_start >= 0) {
/* flush to display */
--
1.7.10.4
- Re: [Qemu-devel] [PATCH 05/14] tcx: alter tcx_set_dirty() to accept address and length parameters, (continued)
- [Qemu-devel] [PATCH 01/14] cg3: remove TARGET_PAGE_SIZE rounding on dirty page detection, Mark Cave-Ayland, 2017/04/05
- [Qemu-devel] [PATCH 07/14] tcx: alter tcx24_check_dirty() to accept address and length parameters, Mark Cave-Ayland, 2017/04/05
- [Qemu-devel] [PATCH 08/14] tcx: alter tcx24_reset_dirty() to accept address and length parameters, Mark Cave-Ayland, 2017/04/05
- [Qemu-devel] [PATCH 09/14] tcx: remove page24 and cpage from tcx24_update_display(), Mark Cave-Ayland, 2017/04/05
- [Qemu-devel] [PATCH 06/14] tcx: ensure tcx_set_dirty() also invalidates the 24-bit plane and cplane, Mark Cave-Ayland, 2017/04/05
- [Qemu-devel] [PATCH 14/14] tcx: switch to load_image_mr() and remove prom_addr hack, Mark Cave-Ayland, 2017/04/05
- [Qemu-devel] [PATCH 13/14] tcx: use tcx_set_dirty() for accelerated ops, Mark Cave-Ayland, 2017/04/05
- [Qemu-devel] [PATCH 10/14] tcx: remove TARGET_PAGE_SIZE from tcx_update_display(), Mark Cave-Ayland, 2017/04/05
- [Qemu-devel] [PATCH 11/14] tcx: remove TARGET_PAGE_SIZE from tcx24_update_display(),
Mark Cave-Ayland <=
- [Qemu-devel] [PATCH 12/14] tcx: remove primitives for non-32-bit surfaces, Mark Cave-Ayland, 2017/04/05
- Re: [Qemu-devel] [PATCH 00/14] TCX/CG3 adapter cleanups, Gerd Hoffmann, 2017/04/07