qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Gerd Hoffmann <kraxel@redhat.com>
To: qemu-devel@nongnu.org
Cc: Gerd Hoffmann <kraxel@redhat.com>,
	Igor Mitsyanko <i.mitsyanko@gmail.com>,
	"open list:Exynos" <qemu-arm@nongnu.org>
Subject: [Qemu-devel] [PATCH 6/9] exynos: make display updates thread safe
Date: Fri, 21 Apr 2017 11:16:29 +0200	[thread overview]
Message-ID: <20170421091632.30900-7-kraxel@redhat.com> (raw)
In-Reply-To: <20170421091632.30900-1-kraxel@redhat.com>

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 hw/display/exynos4210_fimd.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/hw/display/exynos4210_fimd.c b/hw/display/exynos4210_fimd.c
index e5be713406..fd0b2bec65 100644
--- a/hw/display/exynos4210_fimd.c
+++ b/hw/display/exynos4210_fimd.c
@@ -1263,6 +1263,7 @@ static void exynos4210_fimd_update(void *opaque)
     Exynos4210fimdState *s = (Exynos4210fimdState *)opaque;
     DisplaySurface *surface;
     Exynos4210fimdWindow *w;
+    DirtyBitmapSnapshot *snap;
     int i, line;
     hwaddr fb_line_addr, inc_size;
     int scrn_height;
@@ -1291,10 +1292,12 @@ static void exynos4210_fimd_update(void *opaque)
             memory_region_sync_dirty_bitmap(w->mem_section.mr);
             host_fb_addr = w->host_fb_addr;
             fb_line_addr = w->mem_section.offset_within_region;
+            snap = memory_region_snapshot_and_clear_dirty(w->mem_section.mr,
+                    fb_line_addr, inc_size * scrn_height, DIRTY_MEMORY_VGA);
 
             for (line = 0; line < scrn_height; line++) {
-                is_dirty = memory_region_get_dirty(w->mem_section.mr,
-                            fb_line_addr, scrn_width, DIRTY_MEMORY_VGA);
+                is_dirty = memory_region_snapshot_get_dirty(w->mem_section.mr,
+                            snap, fb_line_addr, scrn_width);
 
                 if (s->invalidate || is_dirty) {
                     if (first_line == -1) {
@@ -1309,9 +1312,7 @@ static void exynos4210_fimd_update(void *opaque)
                 fb_line_addr += inc_size;
                 is_dirty = false;
             }
-            memory_region_reset_dirty(w->mem_section.mr,
-                w->mem_section.offset_within_region,
-                w->fb_len, DIRTY_MEMORY_VGA);
+            g_free(snap);
             blend = true;
         }
     }
-- 
2.9.3

  parent reply	other threads:[~2017-04-21  9:16 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-21  9:16 [Qemu-devel] [PATCH 0/9] hw/display: make display updates thread safe, part 1 Gerd Hoffmann
2017-04-21  9:16 ` [Qemu-devel] [PATCH 1/9] bitmap: add bitmap_copy_and_clear_atomic Gerd Hoffmann
2017-04-21  9:16 ` [Qemu-devel] [PATCH 2/9] memory: add support getting and using a dirty bitmap copy Gerd Hoffmann
2017-04-27 14:00   ` Kevin Wolf
2017-04-27 15:01     ` Gerd Hoffmann
2017-04-21  9:16 ` [Qemu-devel] [PATCH 3/9] vga: add vga_scanline_invalidated helper Gerd Hoffmann
2017-04-21  9:16 ` [Qemu-devel] [PATCH 4/9] vga: make display updates thread safe Gerd Hoffmann
2017-05-09 12:57   ` Ladi Prosek
2017-05-09 14:02     ` Gerd Hoffmann
2017-05-09 14:17       ` Ladi Prosek
2017-04-21  9:16 ` [Qemu-devel] [PATCH 5/9] framebuffer: " Gerd Hoffmann
2017-04-21  9:16 ` Gerd Hoffmann [this message]
2017-04-21  9:16 ` [Qemu-devel] [PATCH 7/9] g364fb: " Gerd Hoffmann
2017-04-21  9:16 ` [Qemu-devel] [PATCH 8/9] vmsvga: fix vmsvga_update_display Gerd Hoffmann
2017-04-21  9:16 ` [Qemu-devel] [PATCH 9/9] sm501: make display updates thread safe Gerd Hoffmann
2017-04-21 10:42   ` BALATON Zoltan
2017-04-24 12:09     ` Peter Maydell
2017-04-24 12:30       ` Gerd Hoffmann
2017-04-21 13:44 ` [Qemu-devel] [PATCH 0/9] hw/display: make display updates thread safe, part 1 Mark Cave-Ayland

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170421091632.30900-7-kraxel@redhat.com \
    --to=kraxel@redhat.com \
    --cc=i.mitsyanko@gmail.com \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).