From nobody Fri May 3 20:46:12 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 151811557048554.05664182277087; Thu, 8 Feb 2018 10:46:10 -0800 (PST) Received: from localhost ([::1]:34161 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ejrCz-0001TI-Jn for importer@patchew.org; Thu, 08 Feb 2018 13:46:09 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42182) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ejqqK-0006ak-Fi for qemu-devel@nongnu.org; Thu, 08 Feb 2018 13:22:45 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ejqqG-0007mr-Gt for qemu-devel@nongnu.org; Thu, 08 Feb 2018 13:22:44 -0500 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:40998 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ejqqG-0007mX-CZ for qemu-devel@nongnu.org; Thu, 08 Feb 2018 13:22:40 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C141540FB62E; Thu, 8 Feb 2018 18:22:29 +0000 (UTC) Received: from donizetti.redhat.com (ovpn-116-177.ams2.redhat.com [10.36.116.177]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7D0482166BAE; Thu, 8 Feb 2018 18:22:24 +0000 (UTC) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Thu, 8 Feb 2018 19:22:23 +0100 Message-Id: <20180208182223.2562-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Thu, 08 Feb 2018 18:22:29 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Thu, 08 Feb 2018 18:22:29 +0000 (UTC) for IP:'10.11.54.6' DOMAIN:'int-mx06.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'pbonzini@redhat.com' RCPT:'' Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PATCH] g364fb: switch to using DirtyBitmapSnapshot X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Yongbok Kim , =?UTF-8?q?Herv=C3=A9=20Poussineau?= , Aurelien Jarno Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" This removes the last user of memory_region_test_and_clear_dirty outside memory.c. Cc: Herv=C3=A9 Poussineau Cc: Aurelien Jarno Cc: Yongbok Kim Signed-off-by: Paolo Bonzini Tested-by: Herv=C3=A9 Poussineau --- Untested... not sure where to get mips_bios.bin, or a kernel that works with -M magnum. Can anybody help? I'd like to get rid of memory_region_test_and_clear_dirty. hw/display/g364fb.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/hw/display/g364fb.c b/hw/display/g364fb.c index 86557d14a9..86452de780 100644 --- a/hw/display/g364fb.c +++ b/hw/display/g364fb.c @@ -62,15 +62,15 @@ typedef struct G364State { =20 #define G364_PAGE_SIZE 4096 =20 -static inline int check_dirty(G364State *s, ram_addr_t page) +static inline int check_dirty(G364State *s, DirtyBitmapSnapshot *snap, ram= _addr_t page) { - return memory_region_test_and_clear_dirty(&s->mem_vram, page, G364_PAG= E_SIZE, - DIRTY_MEMORY_VGA); + return memory_region_snapshot_get_dirty(&s->mem_vram, snap, page, G364= _PAGE_SIZE); } =20 static void g364fb_draw_graphic8(G364State *s) { DisplaySurface *surface =3D qemu_console_surface(s->con); + DirtyBitmapSnapshot *snap; int i, w; uint8_t *vram; uint8_t *data_display, *dd; @@ -122,8 +122,10 @@ static void g364fb_draw_graphic8(G364State *s) vram =3D s->vram + s->top_of_screen; /* XXX: out of range in vram? */ data_display =3D dd =3D surface_data(surface); + snap =3D memory_region_snapshot_and_clear_dirty(&s->mem_vram, 0, s->vr= am_size, + DIRTY_MEMORY_VGA); while (y < s->height) { - if (check_dirty(s, page)) { + if (check_dirty(s, snap, page)) { if (y < ymin) ymin =3D ymax =3D y; if (x < xmin) --=20 2.14.3