[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 08/13] framebuffer: make display updates thread safe
From: |
Gerd Hoffmann |
Subject: |
[Qemu-devel] [PULL 08/13] framebuffer: make display updates thread safe |
Date: |
Mon, 24 Apr 2017 14:17:03 +0200 |
Signed-off-by: Gerd Hoffmann <address@hidden>
Message-id: address@hidden
Signed-off-by: Gerd Hoffmann <address@hidden>
---
hw/display/framebuffer.c | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/hw/display/framebuffer.c b/hw/display/framebuffer.c
index 25aa46c8c7..d7310d25f2 100644
--- a/hw/display/framebuffer.c
+++ b/hw/display/framebuffer.c
@@ -67,7 +67,7 @@ void framebuffer_update_display(
int *first_row, /* Input and output. */
int *last_row /* Output only */)
{
- hwaddr src_len;
+ DirtyBitmapSnapshot *snap;
uint8_t *dest;
uint8_t *src;
int first, last = 0;
@@ -78,7 +78,6 @@ void framebuffer_update_display(
i = *first_row;
*first_row = -1;
- src_len = (hwaddr)src_width * rows;
mem = mem_section->mr;
if (!mem) {
@@ -102,9 +101,10 @@ void framebuffer_update_display(
src += i * src_width;
dest += i * dest_row_pitch;
+ snap = memory_region_snapshot_and_clear_dirty(mem, addr, src_width * rows,
+ DIRTY_MEMORY_VGA);
for (; i < rows; i++) {
- dirty = memory_region_get_dirty(mem, addr, src_width,
- DIRTY_MEMORY_VGA);
+ dirty = memory_region_snapshot_get_dirty(mem, snap, addr, src_width);
if (dirty || invalidate) {
fn(opaque, dest, src, cols, dest_col_pitch);
if (first == -1)
@@ -115,11 +115,10 @@ void framebuffer_update_display(
src += src_width;
dest += dest_row_pitch;
}
+ g_free(snap);
if (first < 0) {
return;
}
- memory_region_reset_dirty(mem, mem_section->offset_within_region, src_len,
- DIRTY_MEMORY_VGA);
*first_row = first;
*last_row = last;
}
--
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, 2017/04/24
- [Qemu-devel] [PULL 08/13] framebuffer: make display updates thread safe,
Gerd Hoffmann <=
- [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