[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 10/13] g364fb: make display updates thread safe
From: |
Gerd Hoffmann |
Subject: |
[Qemu-devel] [PULL 10/13] g364fb: make display updates thread safe |
Date: |
Mon, 24 Apr 2017 14:17:05 +0200 |
Signed-off-by: Gerd Hoffmann <address@hidden>
Message-id: address@hidden
Signed-off-by: Gerd Hoffmann <address@hidden>
---
hw/display/g364fb.c | 28 +++++-----------------------
1 file changed, 5 insertions(+), 23 deletions(-)
diff --git a/hw/display/g364fb.c b/hw/display/g364fb.c
index 8cdc205dd9..86557d14a9 100644
--- a/hw/display/g364fb.c
+++ b/hw/display/g364fb.c
@@ -64,17 +64,8 @@ typedef struct G364State {
static inline int check_dirty(G364State *s, ram_addr_t page)
{
- return memory_region_get_dirty(&s->mem_vram, page, G364_PAGE_SIZE,
- DIRTY_MEMORY_VGA);
-}
-
-static inline void reset_dirty(G364State *s,
- ram_addr_t page_min, ram_addr_t page_max)
-{
- memory_region_reset_dirty(&s->mem_vram,
- page_min,
- page_max + G364_PAGE_SIZE - page_min - 1,
- DIRTY_MEMORY_VGA);
+ return memory_region_test_and_clear_dirty(&s->mem_vram, page,
G364_PAGE_SIZE,
+ DIRTY_MEMORY_VGA);
}
static void g364fb_draw_graphic8(G364State *s)
@@ -83,7 +74,7 @@ static void g364fb_draw_graphic8(G364State *s)
int i, w;
uint8_t *vram;
uint8_t *data_display, *dd;
- ram_addr_t page, page_min, page_max;
+ ram_addr_t page;
int x, y;
int xmin, xmax;
int ymin, ymax;
@@ -114,8 +105,6 @@ static void g364fb_draw_graphic8(G364State *s)
}
page = 0;
- page_min = (ram_addr_t)-1;
- page_max = 0;
x = y = 0;
xmin = s->width;
@@ -137,9 +126,6 @@ static void g364fb_draw_graphic8(G364State *s)
if (check_dirty(s, page)) {
if (y < ymin)
ymin = ymax = y;
- if (page_min == (ram_addr_t)-1)
- page_min = page;
- page_max = page;
if (x < xmin)
xmin = x;
for (i = 0; i < G364_PAGE_SIZE; i++) {
@@ -196,10 +182,7 @@ static void g364fb_draw_graphic8(G364State *s)
ymax = y;
} else {
int dy;
- if (page_min != (ram_addr_t)-1) {
- reset_dirty(s, page_min, page_max);
- page_min = (ram_addr_t)-1;
- page_max = 0;
+ if (xmax || ymax) {
dpy_gfx_update(s->con, xmin, ymin,
xmax - xmin + 1, ymax - ymin + 1);
xmin = s->width;
@@ -219,9 +202,8 @@ static void g364fb_draw_graphic8(G364State *s)
}
done:
- if (page_min != (ram_addr_t)-1) {
+ if (xmax || ymax) {
dpy_gfx_update(s->con, xmin, ymin, xmax - xmin + 1, ymax - ymin + 1);
- reset_dirty(s, page_min, page_max);
}
}
--
2.9.3
- [Qemu-devel] [PULL 00/13] vga patch queue, Gerd Hoffmann, 2017/04/24
- [Qemu-devel] [PULL 11/13] vmsvga: fix vmsvga_update_display, Gerd Hoffmann, 2017/04/24
- [Qemu-devel] [PULL 01/13] console: add same surface replace pre-condition, Gerd Hoffmann, 2017/04/24
- [Qemu-devel] [PULL 03/13] virtio-gpu: replace PIXMAN_* by PIXMAN_BE_*, Gerd Hoffmann, 2017/04/24
- [Qemu-devel] [PULL 12/13] qxl: add xres and yres properties, Gerd Hoffmann, 2017/04/24
- [Qemu-devel] [PULL 06/13] vga: add vga_scanline_invalidated helper, Gerd Hoffmann, 2017/04/24
- [Qemu-devel] [PULL 13/13] virtio-gpu: add xres and yres properties, Gerd Hoffmann, 2017/04/24
- [Qemu-devel] [PULL 10/13] g364fb: make display updates thread safe,
Gerd Hoffmann <=
- [Qemu-devel] [PULL 08/13] framebuffer: make display updates thread safe, Gerd Hoffmann, 2017/04/24
- [Qemu-devel] [PULL 04/13] bitmap: add bitmap_copy_and_clear_atomic, Gerd Hoffmann, 2017/04/24
- [Qemu-devel] [PULL 02/13] console: add same displaychangelistener registration pre-condition, Gerd Hoffmann, 2017/04/24
- [Qemu-devel] [PULL 05/13] memory: add support getting and using a dirty bitmap copy., Gerd Hoffmann, 2017/04/24
- [Qemu-devel] [PULL 07/13] vga: make display updates thread safe., Gerd Hoffmann, 2017/04/24
- [Qemu-devel] [PULL 09/13] exynos: make display updates thread safe, Gerd Hoffmann, 2017/04/24
- Re: [Qemu-devel] [PULL 00/13] vga patch queue, Peter Maydell, 2017/04/24