From nobody Sun Apr 28 23:51:07 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.zoho.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; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1492763579695107.80485764268985; Fri, 21 Apr 2017 01:32:59 -0700 (PDT) Received: from localhost ([::1]:57864 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d1Tzu-0002KJ-2t for importer@patchew.org; Fri, 21 Apr 2017 04:32:58 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54426) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d1TwY-0008UQ-Ly for qemu-devel@nongnu.org; Fri, 21 Apr 2017 04:29:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d1TwX-0001ZK-Co for qemu-devel@nongnu.org; Fri, 21 Apr 2017 04:29:30 -0400 Received: from chuckie.co.uk ([82.165.15.123]:50158 helo=s16892447.onlinehome-server.info) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d1TwX-0001Xx-6C for qemu-devel@nongnu.org; Fri, 21 Apr 2017 04:29:29 -0400 Received: from host86-191-119-77.range86-191.btcentralplus.com ([86.191.119.77] helo=kentang.home) by s16892447.onlinehome-server.info with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.76) (envelope-from ) id 1d1TwK-0002g4-Fh; Fri, 21 Apr 2017 09:29:17 +0100 From: Mark Cave-Ayland To: qemu-devel@nongnu.org, kraxel@redhat.com Date: Fri, 21 Apr 2017 09:28:35 +0100 Message-Id: <1492763327-12742-2-git-send-email-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1492763327-12742-1-git-send-email-mark.cave-ayland@ilande.co.uk> References: <1492763327-12742-1-git-send-email-mark.cave-ayland@ilande.co.uk> X-SA-Exim-Connect-IP: 86.191.119.77 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk X-SA-Exim-Version: 4.2.1 (built Sun, 08 Jan 2012 02:45:44 +0000) X-SA-Exim-Scanned: Yes (on s16892447.onlinehome-server.info) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 82.165.15.123 Subject: [Qemu-devel] [PATCH v2 01/13] cg3: remove TARGET_PAGE_SIZE rounding on dirty page detection 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: Mark Cave-Ayland Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" This was an artifact from very early versions of the code from before the memory API and is no longer needed. Signed-off-by: Mark Cave-Ayland Reviewed-by: Gerd Hoffmann --- hw/display/cg3.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/hw/display/cg3.c b/hw/display/cg3.c index 1174220..7d43694 100644 --- a/hw/display/cg3.c +++ b/hw/display/cg3.c @@ -26,7 +26,6 @@ #include "qemu/osdep.h" #include "qapi/error.h" #include "qemu-common.h" -#include "cpu.h" #include "qemu/error-report.h" #include "ui/console.h" #include "hw/sysbus.h" @@ -114,7 +113,7 @@ static void cg3_update_display(void *opaque) for (y =3D 0; y < height; y++) { int update =3D s->full_update; =20 - page =3D (y * width) & TARGET_PAGE_MASK; + page =3D y * width; update |=3D memory_region_get_dirty(&s->vram_mem, page, page + wid= th, DIRTY_MEMORY_VGA); if (update) { @@ -148,8 +147,7 @@ static void cg3_update_display(void *opaque) } if (page_max >=3D page_min) { memory_region_reset_dirty(&s->vram_mem, - page_min, page_max - page_min + TARGET_PAGE_= SIZE, - DIRTY_MEMORY_VGA); + page_min, page_max - page_min, DIRTY_MEMORY_= VGA); } /* vsync interrupt? */ if (s->regs[0] & CG3_CR_ENABLE_INTS) { --=20 1.7.10.4 From nobody Sun Apr 28 23:51:07 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.zoho.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; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1492763783824251.89897005864805; Fri, 21 Apr 2017 01:36:23 -0700 (PDT) Received: from localhost ([::1]:57883 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d1U3C-0004vV-CE for importer@patchew.org; Fri, 21 Apr 2017 04:36:22 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54424) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d1TwY-0008UO-Lx for qemu-devel@nongnu.org; Fri, 21 Apr 2017 04:29:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d1TwT-0001YJ-M2 for qemu-devel@nongnu.org; Fri, 21 Apr 2017 04:29:30 -0400 Received: from chuckie.co.uk ([82.165.15.123]:50151 helo=s16892447.onlinehome-server.info) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d1TwT-0001Xg-Fa for qemu-devel@nongnu.org; Fri, 21 Apr 2017 04:29:25 -0400 Received: from host86-191-119-77.range86-191.btcentralplus.com ([86.191.119.77] helo=kentang.home) by s16892447.onlinehome-server.info with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.76) (envelope-from ) id 1d1TwL-0002g4-Lc; Fri, 21 Apr 2017 09:29:18 +0100 From: Mark Cave-Ayland To: qemu-devel@nongnu.org, kraxel@redhat.com Date: Fri, 21 Apr 2017 09:28:36 +0100 Message-Id: <1492763327-12742-3-git-send-email-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1492763327-12742-1-git-send-email-mark.cave-ayland@ilande.co.uk> References: <1492763327-12742-1-git-send-email-mark.cave-ayland@ilande.co.uk> X-SA-Exim-Connect-IP: 86.191.119.77 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk X-SA-Exim-Version: 4.2.1 (built Sun, 08 Jan 2012 02:45:44 +0000) X-SA-Exim-Scanned: Yes (on s16892447.onlinehome-server.info) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 82.165.15.123 Subject: [Qemu-devel] [PATCH v2 02/13] cg3: fix up size parameter for memory_region_get_dirty() 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: Mark Cave-Ayland Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" The code was incorrectly calculating the end address rather than the size of the required region. Signed-off-by: Mark Cave-Ayland Reviewed-by: Gerd Hoffmann --- hw/display/cg3.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/display/cg3.c b/hw/display/cg3.c index 7d43694..b42f60e 100644 --- a/hw/display/cg3.c +++ b/hw/display/cg3.c @@ -114,7 +114,7 @@ static void cg3_update_display(void *opaque) int update =3D s->full_update; =20 page =3D y * width; - update |=3D memory_region_get_dirty(&s->vram_mem, page, page + wid= th, + update |=3D memory_region_get_dirty(&s->vram_mem, page, width, DIRTY_MEMORY_VGA); if (update) { if (y_start < 0) { --=20 1.7.10.4 From nobody Sun Apr 28 23:51:07 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.zoho.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; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1492763937357435.50493812481113; Fri, 21 Apr 2017 01:38:57 -0700 (PDT) Received: from localhost ([::1]:57894 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d1U5f-00074b-VF for importer@patchew.org; Fri, 21 Apr 2017 04:38:55 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54472) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d1TwZ-0008Uz-Jt for qemu-devel@nongnu.org; Fri, 21 Apr 2017 04:29:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d1TwY-0001Za-2C for qemu-devel@nongnu.org; Fri, 21 Apr 2017 04:29:31 -0400 Received: from chuckie.co.uk ([82.165.15.123]:50162 helo=s16892447.onlinehome-server.info) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d1TwX-0001Y1-RH for qemu-devel@nongnu.org; Fri, 21 Apr 2017 04:29:29 -0400 Received: from host86-191-119-77.range86-191.btcentralplus.com ([86.191.119.77] helo=kentang.home) by s16892447.onlinehome-server.info with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.76) (envelope-from ) id 1d1TwM-0002g4-ME; Fri, 21 Apr 2017 09:29:19 +0100 From: Mark Cave-Ayland To: qemu-devel@nongnu.org, kraxel@redhat.com Date: Fri, 21 Apr 2017 09:28:37 +0100 Message-Id: <1492763327-12742-4-git-send-email-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1492763327-12742-1-git-send-email-mark.cave-ayland@ilande.co.uk> References: <1492763327-12742-1-git-send-email-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 86.191.119.77 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk X-SA-Exim-Version: 4.2.1 (built Sun, 08 Jan 2012 02:45:44 +0000) X-SA-Exim-Scanned: Yes (on s16892447.onlinehome-server.info) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 82.165.15.123 Subject: [Qemu-devel] [PATCH v2 03/13] cg3: switch to load_image_mr() and remove prom-addr hack 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: Mark Cave-Ayland Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Previous to the existence of load_image_mr(), the only way to load in the FCode ROM image was to pass in its physical address via qdev properties and use load_image_targphys(). Signed-off-by: Mark Cave-Ayland Reviewed-by: Gerd Hoffmann Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/display/cg3.c | 4 +--- hw/sparc/sun4m.c | 1 - 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/hw/display/cg3.c b/hw/display/cg3.c index b42f60e..03d9197 100644 --- a/hw/display/cg3.c +++ b/hw/display/cg3.c @@ -303,8 +303,7 @@ static void cg3_realizefn(DeviceState *dev, Error **err= p) vmstate_register_ram_global(&s->rom); fcode_filename =3D qemu_find_file(QEMU_FILE_TYPE_BIOS, CG3_ROM_FILE); if (fcode_filename) { - ret =3D load_image_targphys(fcode_filename, s->prom_addr, - FCODE_MAX_ROM_SIZE); + ret =3D load_image_mr(fcode_filename, &s->rom); g_free(fcode_filename); if (ret < 0 || ret > FCODE_MAX_ROM_SIZE) { error_report("cg3: could not load prom '%s'", CG3_ROM_FILE); @@ -369,7 +368,6 @@ static Property cg3_properties[] =3D { DEFINE_PROP_UINT16("width", CG3State, width, -1), DEFINE_PROP_UINT16("height", CG3State, height, -1), DEFINE_PROP_UINT16("depth", CG3State, depth, -1), - DEFINE_PROP_UINT64("prom-addr", CG3State, prom_addr, -1), DEFINE_PROP_END_OF_LIST(), }; =20 diff --git a/hw/sparc/sun4m.c b/hw/sparc/sun4m.c index 873cd7d..7a0922b 100644 --- a/hw/sparc/sun4m.c +++ b/hw/sparc/sun4m.c @@ -544,7 +544,6 @@ static void cg3_init(hwaddr addr, qemu_irq irq, int vra= m_size, int width, qdev_prop_set_uint16(dev, "width", width); qdev_prop_set_uint16(dev, "height", height); qdev_prop_set_uint16(dev, "depth", depth); - qdev_prop_set_uint64(dev, "prom-addr", addr); qdev_init_nofail(dev); s =3D SYS_BUS_DEVICE(dev); =20 --=20 1.7.10.4 From nobody Sun Apr 28 23:51:07 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.zoho.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; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1492763783777495.1570831378706; Fri, 21 Apr 2017 01:36:23 -0700 (PDT) Received: from localhost ([::1]:57882 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d1U3C-0004uv-8D for importer@patchew.org; Fri, 21 Apr 2017 04:36:22 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54455) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d1TwZ-0008Ui-6x for qemu-devel@nongnu.org; Fri, 21 Apr 2017 04:29:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d1TwX-0001ZR-Mk for qemu-devel@nongnu.org; Fri, 21 Apr 2017 04:29:31 -0400 Received: from chuckie.co.uk ([82.165.15.123]:50160 helo=s16892447.onlinehome-server.info) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d1TwX-0001Xz-Fd for qemu-devel@nongnu.org; Fri, 21 Apr 2017 04:29:29 -0400 Received: from host86-191-119-77.range86-191.btcentralplus.com ([86.191.119.77] helo=kentang.home) by s16892447.onlinehome-server.info with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.76) (envelope-from ) id 1d1TwO-0002g4-0E; Fri, 21 Apr 2017 09:29:21 +0100 From: Mark Cave-Ayland To: qemu-devel@nongnu.org, kraxel@redhat.com Date: Fri, 21 Apr 2017 09:28:38 +0100 Message-Id: <1492763327-12742-5-git-send-email-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1492763327-12742-1-git-send-email-mark.cave-ayland@ilande.co.uk> References: <1492763327-12742-1-git-send-email-mark.cave-ayland@ilande.co.uk> X-SA-Exim-Connect-IP: 86.191.119.77 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk X-SA-Exim-Version: 4.2.1 (built Sun, 08 Jan 2012 02:45:44 +0000) X-SA-Exim-Scanned: Yes (on s16892447.onlinehome-server.info) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 82.165.15.123 Subject: [Qemu-devel] [PATCH v2 04/13] tcx: alter tcx_set_dirty() to accept address and length parameters 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: Mark Cave-Ayland Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Mark Cave-Ayland Reviewed-by: Gerd Hoffmann --- hw/display/tcx.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/hw/display/tcx.c b/hw/display/tcx.c index 8e26aae..d24466f 100644 --- a/hw/display/tcx.c +++ b/hw/display/tcx.c @@ -93,9 +93,9 @@ typedef struct TCXState { uint16_t cursy; } TCXState; =20 -static void tcx_set_dirty(TCXState *s) +static void tcx_set_dirty(TCXState *s, ram_addr_t addr, int len) { - memory_region_set_dirty(&s->vram_mem, 0, MAXX * MAXY); + memory_region_set_dirty(&s->vram_mem, addr, len); } =20 static inline int tcx24_check_dirty(TCXState *s, ram_addr_t page, @@ -156,7 +156,7 @@ static void update_palette_entries(TCXState *s, int sta= rt, int end) break; } } - tcx_set_dirty(s); + tcx_set_dirty(s, 0, memory_region_size(&s->vram_mem)); } =20 static void tcx_draw_line32(TCXState *s1, uint8_t *d, @@ -526,7 +526,7 @@ static void tcx_invalidate_display(void *opaque) { TCXState *s =3D opaque; =20 - tcx_set_dirty(s); + tcx_set_dirty(s, 0, memory_region_size(&s->vram_mem)); qemu_console_resize(s->con, s->width, s->height); } =20 @@ -534,7 +534,7 @@ static void tcx24_invalidate_display(void *opaque) { TCXState *s =3D opaque; =20 - tcx_set_dirty(s); + tcx_set_dirty(s, 0, memory_region_size(&s->vram_mem)); qemu_console_resize(s->con, s->width, s->height); } =20 @@ -543,7 +543,7 @@ static int vmstate_tcx_post_load(void *opaque, int vers= ion_id) TCXState *s =3D opaque; =20 update_palette_entries(s, 0, 256); - tcx_set_dirty(s); + tcx_set_dirty(s, 0, memory_region_size(&s->vram_mem)); return 0; } =20 --=20 1.7.10.4 From nobody Sun Apr 28 23:51:08 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.zoho.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; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1492763464559627.8952527908359; Fri, 21 Apr 2017 01:31:04 -0700 (PDT) Received: from localhost ([::1]:57859 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d1Ty2-00011n-Pc for importer@patchew.org; Fri, 21 Apr 2017 04:31:02 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54422) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d1TwY-0008UM-Lz for qemu-devel@nongnu.org; Fri, 21 Apr 2017 04:29:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d1TwX-0001ZD-3n for qemu-devel@nongnu.org; Fri, 21 Apr 2017 04:29:30 -0400 Received: from chuckie.co.uk ([82.165.15.123]:50155 helo=s16892447.onlinehome-server.info) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d1TwW-0001Xv-Sk for qemu-devel@nongnu.org; Fri, 21 Apr 2017 04:29:29 -0400 Received: from host86-191-119-77.range86-191.btcentralplus.com ([86.191.119.77] helo=kentang.home) by s16892447.onlinehome-server.info with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.76) (envelope-from ) id 1d1TwP-0002g4-8U; Fri, 21 Apr 2017 09:29:22 +0100 From: Mark Cave-Ayland To: qemu-devel@nongnu.org, kraxel@redhat.com Date: Fri, 21 Apr 2017 09:28:39 +0100 Message-Id: <1492763327-12742-6-git-send-email-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1492763327-12742-1-git-send-email-mark.cave-ayland@ilande.co.uk> References: <1492763327-12742-1-git-send-email-mark.cave-ayland@ilande.co.uk> X-SA-Exim-Connect-IP: 86.191.119.77 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk X-SA-Exim-Version: 4.2.1 (built Sun, 08 Jan 2012 02:45:44 +0000) X-SA-Exim-Scanned: Yes (on s16892447.onlinehome-server.info) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 82.165.15.123 Subject: [Qemu-devel] [PATCH v2 05/13] tcx: ensure tcx_set_dirty() also invalidates the 24-bit plane and cplane 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: Mark Cave-Ayland Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Mark Cave-Ayland Reviewed-by: Gerd Hoffmann --- hw/display/tcx.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/hw/display/tcx.c b/hw/display/tcx.c index d24466f..6817bd2 100644 --- a/hw/display/tcx.c +++ b/hw/display/tcx.c @@ -96,6 +96,13 @@ typedef struct TCXState { static void tcx_set_dirty(TCXState *s, ram_addr_t addr, int len) { memory_region_set_dirty(&s->vram_mem, addr, len); + + if (s->depth =3D=3D 24) { + memory_region_set_dirty(&s->vram_mem, s->vram24_offset + addr * 4, + len * 4); + memory_region_set_dirty(&s->vram_mem, s->cplane_offset + addr * 4, + len * 4); + } } =20 static inline int tcx24_check_dirty(TCXState *s, ram_addr_t page, --=20 1.7.10.4 From nobody Sun Apr 28 23:51:08 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.zoho.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; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1492764047298571.0123672381432; Fri, 21 Apr 2017 01:40:47 -0700 (PDT) Received: from localhost ([::1]:57913 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d1U7R-0008Vb-Ry for importer@patchew.org; Fri, 21 Apr 2017 04:40:45 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54475) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d1TwZ-0008V7-LW for qemu-devel@nongnu.org; Fri, 21 Apr 2017 04:29:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d1TwY-0001Zi-9f for qemu-devel@nongnu.org; Fri, 21 Apr 2017 04:29:31 -0400 Received: from chuckie.co.uk ([82.165.15.123]:50164 helo=s16892447.onlinehome-server.info) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d1TwY-0001Y3-2f for qemu-devel@nongnu.org; Fri, 21 Apr 2017 04:29:30 -0400 Received: from host86-191-119-77.range86-191.btcentralplus.com ([86.191.119.77] helo=kentang.home) by s16892447.onlinehome-server.info with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.76) (envelope-from ) id 1d1TwQ-0002g4-88; Fri, 21 Apr 2017 09:29:23 +0100 From: Mark Cave-Ayland To: qemu-devel@nongnu.org, kraxel@redhat.com Date: Fri, 21 Apr 2017 09:28:40 +0100 Message-Id: <1492763327-12742-7-git-send-email-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1492763327-12742-1-git-send-email-mark.cave-ayland@ilande.co.uk> References: <1492763327-12742-1-git-send-email-mark.cave-ayland@ilande.co.uk> X-SA-Exim-Connect-IP: 86.191.119.77 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk X-SA-Exim-Version: 4.2.1 (built Sun, 08 Jan 2012 02:45:44 +0000) X-SA-Exim-Scanned: Yes (on s16892447.onlinehome-server.info) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 82.165.15.123 Subject: [Qemu-devel] [PATCH v2 06/13] tcx: alter tcx24_check_dirty() to accept address and length parameters 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: Mark Cave-Ayland Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" This can now be used by both the 8-bit and 24-bit display code, so rename to tcx_check_dirty(). Signed-off-by: Mark Cave-Ayland Reviewed-by: Gerd Hoffmann --- hw/display/tcx.c | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/hw/display/tcx.c b/hw/display/tcx.c index 6817bd2..171236a 100644 --- a/hw/display/tcx.c +++ b/hw/display/tcx.c @@ -105,17 +105,21 @@ static void tcx_set_dirty(TCXState *s, ram_addr_t add= r, int len) } } =20 -static inline int tcx24_check_dirty(TCXState *s, ram_addr_t page, - ram_addr_t page24, ram_addr_t cpage) +static int tcx_check_dirty(TCXState *s, ram_addr_t addr, int len) { int ret; =20 - ret =3D memory_region_get_dirty(&s->vram_mem, page, TARGET_PAGE_SIZE, - DIRTY_MEMORY_VGA); - ret |=3D memory_region_get_dirty(&s->vram_mem, page24, TARGET_PAGE_SIZ= E * 4, - DIRTY_MEMORY_VGA); - ret |=3D memory_region_get_dirty(&s->vram_mem, cpage, TARGET_PAGE_SIZE= * 4, - DIRTY_MEMORY_VGA); + ret =3D memory_region_get_dirty(&s->vram_mem, addr, len, DIRTY_MEMORY_= VGA); + + if (s->depth =3D=3D 24) { + ret |=3D memory_region_get_dirty(&s->vram_mem, + s->vram24_offset + addr * 4, len * = 4, + DIRTY_MEMORY_VGA); + ret |=3D memory_region_get_dirty(&s->vram_mem, + s->cplane_offset + addr * 4, len * = 4, + DIRTY_MEMORY_VGA); + } + return ret; } =20 @@ -366,8 +370,7 @@ static void tcx_update_display(void *opaque) =20 memory_region_sync_dirty_bitmap(&ts->vram_mem); for (y =3D 0; y < ts->height; page +=3D TARGET_PAGE_SIZE) { - if (memory_region_get_dirty(&ts->vram_mem, page, TARGET_PAGE_SIZE, - DIRTY_MEMORY_VGA)) { + if (tcx_check_dirty(ts, page, TARGET_PAGE_SIZE)) { if (y_start < 0) y_start =3D y; if (page < page_min) @@ -461,7 +464,7 @@ static void tcx24_update_display(void *opaque) memory_region_sync_dirty_bitmap(&ts->vram_mem); for (y =3D 0; y < ts->height; page +=3D TARGET_PAGE_SIZE, page24 +=3D TARGET_PAGE_SIZE, cpage +=3D TARGET_PAGE_SIZE) { - if (tcx24_check_dirty(ts, page, page24, cpage)) { + if (tcx_check_dirty(ts, page, TARGET_PAGE_SIZE)) { if (y_start < 0) y_start =3D y; if (page < page_min) --=20 1.7.10.4 From nobody Sun Apr 28 23:51:08 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.zoho.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; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1492763467948157.1879999397246; Fri, 21 Apr 2017 01:31:07 -0700 (PDT) Received: from localhost ([::1]:57860 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d1Ty6-00013A-Ck for importer@patchew.org; Fri, 21 Apr 2017 04:31:06 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54423) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d1TwY-0008UN-Lv for qemu-devel@nongnu.org; Fri, 21 Apr 2017 04:29:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d1TwT-0001YP-PQ for qemu-devel@nongnu.org; Fri, 21 Apr 2017 04:29:30 -0400 Received: from chuckie.co.uk ([82.165.15.123]:50167 helo=s16892447.onlinehome-server.info) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d1TwT-0001Y7-Ix for qemu-devel@nongnu.org; Fri, 21 Apr 2017 04:29:25 -0400 Received: from host86-191-119-77.range86-191.btcentralplus.com ([86.191.119.77] helo=kentang.home) by s16892447.onlinehome-server.info with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.76) (envelope-from ) id 1d1TwR-0002g4-EM; Fri, 21 Apr 2017 09:29:24 +0100 From: Mark Cave-Ayland To: qemu-devel@nongnu.org, kraxel@redhat.com Date: Fri, 21 Apr 2017 09:28:41 +0100 Message-Id: <1492763327-12742-8-git-send-email-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1492763327-12742-1-git-send-email-mark.cave-ayland@ilande.co.uk> References: <1492763327-12742-1-git-send-email-mark.cave-ayland@ilande.co.uk> X-SA-Exim-Connect-IP: 86.191.119.77 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk X-SA-Exim-Version: 4.2.1 (built Sun, 08 Jan 2012 02:45:44 +0000) X-SA-Exim-Scanned: Yes (on s16892447.onlinehome-server.info) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 82.165.15.123 Subject: [Qemu-devel] [PATCH v2 07/13] tcx: alter tcx24_reset_dirty() to accept address and length parameters 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: Mark Cave-Ayland Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" This can now be used by both the 8-bit and 24-bit display code, so rename to tcx_check_dirty(). Signed-off-by: Mark Cave-Ayland Reviewed-by: Gerd Hoffmann --- hw/display/tcx.c | 31 +++++++++++-------------------- 1 file changed, 11 insertions(+), 20 deletions(-) diff --git a/hw/display/tcx.c b/hw/display/tcx.c index 171236a..e9056e0 100644 --- a/hw/display/tcx.c +++ b/hw/display/tcx.c @@ -123,22 +123,16 @@ static int tcx_check_dirty(TCXState *s, ram_addr_t ad= dr, int len) return ret; } =20 -static inline void tcx24_reset_dirty(TCXState *ts, ram_addr_t page_min, - ram_addr_t page_max, ram_addr_t page24, - ram_addr_t cpage) +static void tcx_reset_dirty(TCXState *s, ram_addr_t addr, int len) { - memory_region_reset_dirty(&ts->vram_mem, - page_min, - (page_max - page_min) + TARGET_PAGE_SIZE, - DIRTY_MEMORY_VGA); - memory_region_reset_dirty(&ts->vram_mem, - page24 + page_min * 4, - (page_max - page_min) * 4 + TARGET_PAGE_SIZE, - DIRTY_MEMORY_VGA); - memory_region_reset_dirty(&ts->vram_mem, - cpage + page_min * 4, - (page_max - page_min) * 4 + TARGET_PAGE_SIZE, - DIRTY_MEMORY_VGA); + memory_region_reset_dirty(&s->vram_mem, addr, len, DIRTY_MEMORY_VGA); + + if (s->depth =3D=3D 24) { + memory_region_reset_dirty(&s->vram_mem, s->vram24_offset + addr * = 4, + len * 4, DIRTY_MEMORY_VGA); + memory_region_reset_dirty(&s->vram_mem, s->cplane_offset + addr * = 4, + len * 4, DIRTY_MEMORY_VGA); + } } =20 static void update_palette_entries(TCXState *s, int start, int end) @@ -428,10 +422,7 @@ static void tcx_update_display(void *opaque) } /* reset modified pages */ if (page_max >=3D page_min) { - memory_region_reset_dirty(&ts->vram_mem, - page_min, - (page_max - page_min) + TARGET_PAGE_SIZE, - DIRTY_MEMORY_VGA); + tcx_reset_dirty(ts, page_min, page_max - page_min); } } =20 @@ -528,7 +519,7 @@ static void tcx24_update_display(void *opaque) } /* reset modified pages */ if (page_max >=3D page_min) { - tcx24_reset_dirty(ts, page_min, page_max, page24, cpage); + tcx_reset_dirty(ts, page_min, page_max - page_min); } } =20 --=20 1.7.10.4 From nobody Sun Apr 28 23:51:08 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.zoho.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; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1492763613449898.115204707315; Fri, 21 Apr 2017 01:33:33 -0700 (PDT) Received: from localhost ([::1]:57866 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d1U0R-0002l9-TO for importer@patchew.org; Fri, 21 Apr 2017 04:33:31 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54425) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d1TwY-0008UP-Lx for qemu-devel@nongnu.org; Fri, 21 Apr 2017 04:29:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d1TwV-0001Yc-2e for qemu-devel@nongnu.org; Fri, 21 Apr 2017 04:29:30 -0400 Received: from chuckie.co.uk ([82.165.15.123]:50169 helo=s16892447.onlinehome-server.info) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d1TwU-0001YU-Rc for qemu-devel@nongnu.org; Fri, 21 Apr 2017 04:29:27 -0400 Received: from host86-191-119-77.range86-191.btcentralplus.com ([86.191.119.77] helo=kentang.home) by s16892447.onlinehome-server.info with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.76) (envelope-from ) id 1d1TwS-0002g4-Hz; Fri, 21 Apr 2017 09:29:25 +0100 From: Mark Cave-Ayland To: qemu-devel@nongnu.org, kraxel@redhat.com Date: Fri, 21 Apr 2017 09:28:42 +0100 Message-Id: <1492763327-12742-9-git-send-email-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1492763327-12742-1-git-send-email-mark.cave-ayland@ilande.co.uk> References: <1492763327-12742-1-git-send-email-mark.cave-ayland@ilande.co.uk> X-SA-Exim-Connect-IP: 86.191.119.77 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk X-SA-Exim-Version: 4.2.1 (built Sun, 08 Jan 2012 02:45:44 +0000) X-SA-Exim-Scanned: Yes (on s16892447.onlinehome-server.info) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 82.165.15.123 Subject: [Qemu-devel] [PATCH v2 08/13] tcx: remove page24 and cpage from tcx24_update_display() 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: Mark Cave-Ayland Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Since all of the tcx_*_dirty() functions now calculate the 24-bit and cplane offsets themselves from the base address, these variables are no longer needed. Signed-off-by: Mark Cave-Ayland Reviewed-by: Gerd Hoffmann --- hw/display/tcx.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/hw/display/tcx.c b/hw/display/tcx.c index e9056e0..4f4f03f 100644 --- a/hw/display/tcx.c +++ b/hw/display/tcx.c @@ -430,7 +430,7 @@ static void tcx24_update_display(void *opaque) { TCXState *ts =3D opaque; DisplaySurface *surface =3D qemu_console_surface(ts->con); - ram_addr_t page, page_min, page_max, cpage, page24; + ram_addr_t page, page_min, page_max; int y, y_start, dd, ds; uint8_t *d, *s; uint32_t *cptr, *s24; @@ -440,8 +440,6 @@ static void tcx24_update_display(void *opaque) } =20 page =3D 0; - page24 =3D ts->vram24_offset; - cpage =3D ts->cplane_offset; y_start =3D -1; page_min =3D -1; page_max =3D 0; @@ -453,8 +451,7 @@ static void tcx24_update_display(void *opaque) ds =3D 1024; =20 memory_region_sync_dirty_bitmap(&ts->vram_mem); - for (y =3D 0; y < ts->height; page +=3D TARGET_PAGE_SIZE, - page24 +=3D TARGET_PAGE_SIZE, cpage +=3D TARGET_PAGE_SIZE) { + for (y =3D 0; y < ts->height; page +=3D TARGET_PAGE_SIZE) { if (tcx_check_dirty(ts, page, TARGET_PAGE_SIZE)) { if (y_start < 0) y_start =3D y; --=20 1.7.10.4 From nobody Sun Apr 28 23:51:08 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.zoho.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; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1492763614164243.1929488468868; Fri, 21 Apr 2017 01:33:34 -0700 (PDT) Received: from localhost ([::1]:57867 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d1U0S-0002mC-PP for importer@patchew.org; Fri, 21 Apr 2017 04:33:32 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54421) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d1TwY-0008UK-Lw for qemu-devel@nongnu.org; Fri, 21 Apr 2017 04:29:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d1TwW-0001Yr-BV for qemu-devel@nongnu.org; Fri, 21 Apr 2017 04:29:30 -0400 Received: from chuckie.co.uk ([82.165.15.123]:50172 helo=s16892447.onlinehome-server.info) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d1TwW-0001Yg-3y for qemu-devel@nongnu.org; Fri, 21 Apr 2017 04:29:28 -0400 Received: from host86-191-119-77.range86-191.btcentralplus.com ([86.191.119.77] helo=kentang.home) by s16892447.onlinehome-server.info with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.76) (envelope-from ) id 1d1TwT-0002g4-Qt; Fri, 21 Apr 2017 09:29:26 +0100 From: Mark Cave-Ayland To: qemu-devel@nongnu.org, kraxel@redhat.com Date: Fri, 21 Apr 2017 09:28:43 +0100 Message-Id: <1492763327-12742-10-git-send-email-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1492763327-12742-1-git-send-email-mark.cave-ayland@ilande.co.uk> References: <1492763327-12742-1-git-send-email-mark.cave-ayland@ilande.co.uk> X-SA-Exim-Connect-IP: 86.191.119.77 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk X-SA-Exim-Version: 4.2.1 (built Sun, 08 Jan 2012 02:45:44 +0000) X-SA-Exim-Scanned: Yes (on s16892447.onlinehome-server.info) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 82.165.15.123 Subject: [Qemu-devel] [PATCH v2 09/13] tcx: remove TARGET_PAGE_SIZE from tcx_update_display() 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: Mark Cave-Ayland Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Now that page alignment is handled by the memory API, there is no need to duplicate the code 4 times (4 * 1024 =3D=3D 4096 =3D=3D TARGET_PAGE_SIZE). Signed-off-by: Mark Cave-Ayland Reviewed-by: Gerd Hoffmann --- hw/display/tcx.c | 36 ++++-------------------------------- 1 file changed, 4 insertions(+), 32 deletions(-) diff --git a/hw/display/tcx.c b/hw/display/tcx.c index 4f4f03f..14a17fe 100644 --- a/hw/display/tcx.c +++ b/hw/display/tcx.c @@ -363,8 +363,8 @@ static void tcx_update_display(void *opaque) } =20 memory_region_sync_dirty_bitmap(&ts->vram_mem); - for (y =3D 0; y < ts->height; page +=3D TARGET_PAGE_SIZE) { - if (tcx_check_dirty(ts, page, TARGET_PAGE_SIZE)) { + for (y =3D 0; y < ts->height; y++, page +=3D ds) { + if (tcx_check_dirty(ts, page, ds)) { if (y_start < 0) y_start =3D y; if (page < page_min) @@ -376,33 +376,6 @@ static void tcx_update_display(void *opaque) if (y >=3D ts->cursy && y < ts->cursy + 32 && ts->cursx < ts->= width) { fc(ts, d, y, ts->width); } - d +=3D dd; - s +=3D ds; - y++; - - f(ts, d, s, ts->width); - if (y >=3D ts->cursy && y < ts->cursy + 32 && ts->cursx < ts->= width) { - fc(ts, d, y, ts->width); - } - d +=3D dd; - s +=3D ds; - y++; - - f(ts, d, s, ts->width); - if (y >=3D ts->cursy && y < ts->cursy + 32 && ts->cursx < ts->= width) { - fc(ts, d, y, ts->width); - } - d +=3D dd; - s +=3D ds; - y++; - - f(ts, d, s, ts->width); - if (y >=3D ts->cursy && y < ts->cursy + 32 && ts->cursx < ts->= width) { - fc(ts, d, y, ts->width); - } - d +=3D dd; - s +=3D ds; - y++; } else { if (y_start >=3D 0) { /* flush to display */ @@ -410,10 +383,9 @@ static void tcx_update_display(void *opaque) ts->width, y - y_start); y_start =3D -1; } - d +=3D dd * 4; - s +=3D ds * 4; - y +=3D 4; } + s +=3D ds; + d +=3D dd; } if (y_start >=3D 0) { /* flush to display */ --=20 1.7.10.4 From nobody Sun Apr 28 23:51:08 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.zoho.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; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1492764249200318.3431985530492; Fri, 21 Apr 2017 01:44:09 -0700 (PDT) Received: from localhost ([::1]:57932 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d1UAh-0002KC-Sv for importer@patchew.org; Fri, 21 Apr 2017 04:44:07 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55317) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d1U00-0002iL-Qz for qemu-devel@nongnu.org; Fri, 21 Apr 2017 04:33:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d1Tzv-0002pH-UN for qemu-devel@nongnu.org; Fri, 21 Apr 2017 04:33:04 -0400 Received: from chuckie.co.uk ([82.165.15.123]:50205 helo=s16892447.onlinehome-server.info) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d1Tzv-0002pB-Nq for qemu-devel@nongnu.org; Fri, 21 Apr 2017 04:32:59 -0400 Received: from host86-191-119-77.range86-191.btcentralplus.com ([86.191.119.77] helo=kentang.home) by s16892447.onlinehome-server.info with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.76) (envelope-from ) id 1d1TwV-0002g4-2x; Fri, 21 Apr 2017 09:29:28 +0100 From: Mark Cave-Ayland To: qemu-devel@nongnu.org, kraxel@redhat.com Date: Fri, 21 Apr 2017 09:28:44 +0100 Message-Id: <1492763327-12742-11-git-send-email-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1492763327-12742-1-git-send-email-mark.cave-ayland@ilande.co.uk> References: <1492763327-12742-1-git-send-email-mark.cave-ayland@ilande.co.uk> X-SA-Exim-Connect-IP: 86.191.119.77 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk X-SA-Exim-Version: 4.2.1 (built Sun, 08 Jan 2012 02:45:44 +0000) X-SA-Exim-Scanned: Yes (on s16892447.onlinehome-server.info) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 82.165.15.123 Subject: [Qemu-devel] [PATCH v2 10/13] tcx: remove TARGET_PAGE_SIZE from tcx24_update_display() 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: Mark Cave-Ayland Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Now that page alignment is handled by the memory API, there is no need to duplicate the code 4 times (4 * 1024 =3D=3D 4096 =3D=3D TARGET_PAGE_SIZE). Finally we have now removed all traces of TARGET_PAGE_SIZE. Signed-off-by: Mark Cave-Ayland Reviewed-by: Gerd Hoffmann --- 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 =3D 1024; =20 memory_region_sync_dirty_bitmap(&ts->vram_mem); - for (y =3D 0; y < ts->height; page +=3D TARGET_PAGE_SIZE) { - if (tcx_check_dirty(ts, page, TARGET_PAGE_SIZE)) { + for (y =3D 0; y < ts->height; y++, page +=3D ds) { + if (tcx_check_dirty(ts, page, ds)) { if (y_start < 0) y_start =3D y; if (page < page_min) @@ -435,38 +434,6 @@ static void tcx24_update_display(void *opaque) if (y >=3D ts->cursy && y < ts->cursy+32 && ts->cursx < ts->wi= dth) { tcx_draw_cursor32(ts, d, y, ts->width); } - d +=3D dd; - s +=3D ds; - cptr +=3D ds; - s24 +=3D ds; - y++; - tcx24_draw_line32(ts, d, s, ts->width, cptr, s24); - if (y >=3D ts->cursy && y < ts->cursy+32 && ts->cursx < ts->wi= dth) { - tcx_draw_cursor32(ts, d, y, ts->width); - } - d +=3D dd; - s +=3D ds; - cptr +=3D ds; - s24 +=3D ds; - y++; - tcx24_draw_line32(ts, d, s, ts->width, cptr, s24); - if (y >=3D ts->cursy && y < ts->cursy+32 && ts->cursx < ts->wi= dth) { - tcx_draw_cursor32(ts, d, y, ts->width); - } - d +=3D dd; - s +=3D ds; - cptr +=3D ds; - s24 +=3D ds; - y++; - tcx24_draw_line32(ts, d, s, ts->width, cptr, s24); - if (y >=3D ts->cursy && y < ts->cursy+32 && ts->cursx < ts->wi= dth) { - tcx_draw_cursor32(ts, d, y, ts->width); - } - d +=3D dd; - s +=3D ds; - cptr +=3D ds; - s24 +=3D ds; - y++; } else { if (y_start >=3D 0) { /* flush to display */ @@ -474,12 +441,11 @@ static void tcx24_update_display(void *opaque) ts->width, y - y_start); y_start =3D -1; } - d +=3D dd * 4; - s +=3D ds * 4; - cptr +=3D ds * 4; - s24 +=3D ds * 4; - y +=3D 4; } + d +=3D dd; + s +=3D ds; + cptr +=3D ds; + s24 +=3D ds; } if (y_start >=3D 0) { /* flush to display */ --=20 1.7.10.4 From nobody Sun Apr 28 23:51:08 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.zoho.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; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1492763942609908.7418765263353; Fri, 21 Apr 2017 01:39:02 -0700 (PDT) Received: from localhost ([::1]:57897 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d1U5l-0007CL-1g for importer@patchew.org; Fri, 21 Apr 2017 04:39:01 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55316) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d1U00-0002iK-Qm for qemu-devel@nongnu.org; Fri, 21 Apr 2017 04:33:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d1Tzy-0002q5-NU for qemu-devel@nongnu.org; Fri, 21 Apr 2017 04:33:04 -0400 Received: from chuckie.co.uk ([82.165.15.123]:50207 helo=s16892447.onlinehome-server.info) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d1Tzy-0002pk-Gf for qemu-devel@nongnu.org; Fri, 21 Apr 2017 04:33:02 -0400 Received: from host86-191-119-77.range86-191.btcentralplus.com ([86.191.119.77] helo=kentang.home) by s16892447.onlinehome-server.info with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.76) (envelope-from ) id 1d1TwW-0002g4-Ah; Fri, 21 Apr 2017 09:29:29 +0100 From: Mark Cave-Ayland To: qemu-devel@nongnu.org, kraxel@redhat.com Date: Fri, 21 Apr 2017 09:28:45 +0100 Message-Id: <1492763327-12742-12-git-send-email-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1492763327-12742-1-git-send-email-mark.cave-ayland@ilande.co.uk> References: <1492763327-12742-1-git-send-email-mark.cave-ayland@ilande.co.uk> X-SA-Exim-Connect-IP: 86.191.119.77 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk X-SA-Exim-Version: 4.2.1 (built Sun, 08 Jan 2012 02:45:44 +0000) X-SA-Exim-Scanned: Yes (on s16892447.onlinehome-server.info) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 82.165.15.123 Subject: [Qemu-devel] [PATCH v2 11/13] tcx: remove primitives for non-32-bit surfaces 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: Mark Cave-Ayland Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" As all surfaces in QEMU are now either shared or 32-bit ARGB regardless of the guest depth, remove all non-32-bit primitives from tcx_update_display() and consequence their implementation which are no longer required. Signed-off-by: Mark Cave-Ayland Reviewed-by: Gerd Hoffmann --- hw/display/tcx.c | 126 ++++----------------------------------------------= ---- 1 file changed, 8 insertions(+), 118 deletions(-) diff --git a/hw/display/tcx.c b/hw/display/tcx.c index 0dd007e..6da6dfb 100644 --- a/hw/display/tcx.c +++ b/hw/display/tcx.c @@ -140,25 +140,12 @@ static void update_palette_entries(TCXState *s, int s= tart, int end) int i; =20 for (i =3D start; i < end; i++) { - switch (surface_bits_per_pixel(surface)) { - default: - case 8: - s->palette[i] =3D rgb_to_pixel8(s->r[i], s->g[i], s->b[i]); - break; - case 15: - s->palette[i] =3D rgb_to_pixel15(s->r[i], s->g[i], s->b[i]); - break; - case 16: - s->palette[i] =3D rgb_to_pixel16(s->r[i], s->g[i], s->b[i]); - break; - case 32: - if (is_surface_bgr(surface)) { - s->palette[i] =3D rgb_to_pixel32bgr(s->r[i], s->g[i], s->b= [i]); - } else { - s->palette[i] =3D rgb_to_pixel32(s->r[i], s->g[i], s->b[i]= ); - } - break; + if (is_surface_bgr(surface)) { + s->palette[i] =3D rgb_to_pixel32bgr(s->r[i], s->g[i], s->b[i]); + } else { + s->palette[i] =3D rgb_to_pixel32(s->r[i], s->g[i], s->b[i]); } + break; } tcx_set_dirty(s, 0, memory_region_size(&s->vram_mem)); } @@ -176,31 +163,6 @@ static void tcx_draw_line32(TCXState *s1, uint8_t *d, } } =20 -static void tcx_draw_line16(TCXState *s1, uint8_t *d, - const uint8_t *s, int width) -{ - int x; - uint8_t val; - uint16_t *p =3D (uint16_t *)d; - - for (x =3D 0; x < width; x++) { - val =3D *s++; - *p++ =3D s1->palette[val]; - } -} - -static void tcx_draw_line8(TCXState *s1, uint8_t *d, - const uint8_t *s, int width) -{ - int x; - uint8_t val; - - for(x =3D 0; x < width; x++) { - val =3D *s++; - *d++ =3D s1->palette[val]; - } -} - static void tcx_draw_cursor32(TCXState *s1, uint8_t *d, int y, int width) { @@ -227,57 +189,6 @@ static void tcx_draw_cursor32(TCXState *s1, uint8_t *d, } } =20 -static void tcx_draw_cursor16(TCXState *s1, uint8_t *d, - int y, int width) -{ - int x, len; - uint32_t mask, bits; - uint16_t *p =3D (uint16_t *)d; - - y =3D y - s1->cursy; - mask =3D s1->cursmask[y]; - bits =3D s1->cursbits[y]; - len =3D MIN(width - s1->cursx, 32); - p =3D &p[s1->cursx]; - for (x =3D 0; x < len; x++) { - if (mask & 0x80000000) { - if (bits & 0x80000000) { - *p =3D s1->palette[259]; - } else { - *p =3D s1->palette[258]; - } - } - p++; - mask <<=3D 1; - bits <<=3D 1; - } -} - -static void tcx_draw_cursor8(TCXState *s1, uint8_t *d, - int y, int width) -{ - int x, len; - uint32_t mask, bits; - - y =3D y - s1->cursy; - mask =3D s1->cursmask[y]; - bits =3D s1->cursbits[y]; - len =3D MIN(width - s1->cursx, 32); - d =3D &d[s1->cursx]; - for (x =3D 0; x < len; x++) { - if (mask & 0x80000000) { - if (bits & 0x80000000) { - *d =3D s1->palette[259]; - } else { - *d =3D s1->palette[258]; - } - } - d++; - mask <<=3D 1; - bits <<=3D 1; - } -} - /* XXX Could be much more optimal: * detect if line/page/whole screen is in 24 bit mode @@ -326,10 +237,8 @@ static void tcx_update_display(void *opaque) ram_addr_t page, page_min, page_max; int y, y_start, dd, ds; uint8_t *d, *s; - void (*f)(TCXState *s1, uint8_t *dst, const uint8_t *src, int width); - void (*fc)(TCXState *s1, uint8_t *dst, int y, int width); =20 - if (surface_bits_per_pixel(surface) =3D=3D 0) { + if (surface_bits_per_pixel(surface) !=3D 32) { return; } =20 @@ -342,25 +251,6 @@ static void tcx_update_display(void *opaque) dd =3D surface_stride(surface); ds =3D 1024; =20 - switch (surface_bits_per_pixel(surface)) { - case 32: - f =3D tcx_draw_line32; - fc =3D tcx_draw_cursor32; - break; - case 15: - case 16: - f =3D tcx_draw_line16; - fc =3D tcx_draw_cursor16; - break; - default: - case 8: - f =3D tcx_draw_line8; - fc =3D tcx_draw_cursor8; - break; - case 0: - return; - } - memory_region_sync_dirty_bitmap(&ts->vram_mem); for (y =3D 0; y < ts->height; y++, page +=3D ds) { if (tcx_check_dirty(ts, page, ds)) { @@ -371,9 +261,9 @@ static void tcx_update_display(void *opaque) if (page > page_max) page_max =3D page; =20 - f(ts, d, s, ts->width); + tcx_draw_line32(ts, d, s, ts->width); if (y >=3D ts->cursy && y < ts->cursy + 32 && ts->cursx < ts->= width) { - fc(ts, d, y, ts->width); + tcx_draw_cursor32(ts, d, y, ts->width); } } else { if (y_start >=3D 0) { --=20 1.7.10.4 From nobody Sun Apr 28 23:51:08 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.zoho.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; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1492764348817248.8711656249909; Fri, 21 Apr 2017 01:45:48 -0700 (PDT) Received: from localhost ([::1]:57944 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d1UCJ-0003VH-C8 for importer@patchew.org; Fri, 21 Apr 2017 04:45:47 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55337) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d1U02-0002jb-6q for qemu-devel@nongnu.org; Fri, 21 Apr 2017 04:33:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d1U01-0002qV-9V for qemu-devel@nongnu.org; Fri, 21 Apr 2017 04:33:06 -0400 Received: from chuckie.co.uk ([82.165.15.123]:50209 helo=s16892447.onlinehome-server.info) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d1U01-0002qE-3Q for qemu-devel@nongnu.org; Fri, 21 Apr 2017 04:33:05 -0400 Received: from host86-191-119-77.range86-191.btcentralplus.com ([86.191.119.77] helo=kentang.home) by s16892447.onlinehome-server.info with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.76) (envelope-from ) id 1d1TwX-0002g4-Oz; Fri, 21 Apr 2017 09:29:30 +0100 From: Mark Cave-Ayland To: qemu-devel@nongnu.org, kraxel@redhat.com Date: Fri, 21 Apr 2017 09:28:46 +0100 Message-Id: <1492763327-12742-13-git-send-email-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1492763327-12742-1-git-send-email-mark.cave-ayland@ilande.co.uk> References: <1492763327-12742-1-git-send-email-mark.cave-ayland@ilande.co.uk> X-SA-Exim-Connect-IP: 86.191.119.77 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk X-SA-Exim-Version: 4.2.1 (built Sun, 08 Jan 2012 02:45:44 +0000) X-SA-Exim-Scanned: Yes (on s16892447.onlinehome-server.info) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 82.165.15.123 Subject: [Qemu-devel] [PATCH v2 12/13] tcx: use tcx_set_dirty() for accelerated ops 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: Mark Cave-Ayland Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Rather than calling memory_region_set_dirty() directly, make sure that we c= all tcx_set_dirty() instead. This ensures that the 24-bit plane and cplane are also invalidated correctly. Signed-off-by: Mark Cave-Ayland Reviewed-by: Gerd Hoffmann --- hw/display/tcx.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/hw/display/tcx.c b/hw/display/tcx.c index 6da6dfb..3f00735 100644 --- a/hw/display/tcx.c +++ b/hw/display/tcx.c @@ -525,7 +525,7 @@ static void tcx_stip_writel(void *opaque, hwaddr addr, val <<=3D 1; } } - memory_region_set_dirty(&s->vram_mem, addr, 32); + tcx_set_dirty(s, addr, 32); } } =20 @@ -558,7 +558,7 @@ static void tcx_rstip_writel(void *opaque, hwaddr addr, val <<=3D 1; } } - memory_region_set_dirty(&s->vram_mem, addr, 32); + tcx_set_dirty(s, addr, 32); } } =20 @@ -616,7 +616,7 @@ static void tcx_blit_writel(void *opaque, hwaddr addr, memcpy(&s->vram24[addr], &s->vram24[adsr], len * 4); } } - memory_region_set_dirty(&s->vram_mem, addr, len); + tcx_set_dirty(s, addr, len); } } =20 @@ -650,7 +650,7 @@ static void tcx_rblit_writel(void *opaque, hwaddr addr, memcpy(&s->cplane[addr], &s->cplane[adsr], len * 4); } } - memory_region_set_dirty(&s->vram_mem, addr, len); + tcx_set_dirty(s, addr, len); } } =20 @@ -687,7 +687,7 @@ static void tcx_invalidate_cursor_position(TCXState *s) start =3D ymin * 1024; end =3D ymax * 1024; =20 - memory_region_set_dirty(&s->vram_mem, start, end-start); + tcx_set_dirty(s, start, end - start); } =20 static uint64_t tcx_thc_readl(void *opaque, hwaddr addr, --=20 1.7.10.4 From nobody Sun Apr 28 23:51:08 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.zoho.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; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1492763906245267.5001341252714; Fri, 21 Apr 2017 01:38:26 -0700 (PDT) Received: from localhost ([::1]:57893 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d1U5A-0006cY-Sg for importer@patchew.org; Fri, 21 Apr 2017 04:38:24 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55362) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d1U04-0002l0-MY for qemu-devel@nongnu.org; Fri, 21 Apr 2017 04:33:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d1U03-0002qv-Pn for qemu-devel@nongnu.org; Fri, 21 Apr 2017 04:33:08 -0400 Received: from chuckie.co.uk ([82.165.15.123]:50211 helo=s16892447.onlinehome-server.info) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d1U03-0002ql-I9 for qemu-devel@nongnu.org; Fri, 21 Apr 2017 04:33:07 -0400 Received: from host86-191-119-77.range86-191.btcentralplus.com ([86.191.119.77] helo=kentang.home) by s16892447.onlinehome-server.info with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.76) (envelope-from ) id 1d1TwY-0002g4-Pg; Fri, 21 Apr 2017 09:29:31 +0100 From: Mark Cave-Ayland To: qemu-devel@nongnu.org, kraxel@redhat.com Date: Fri, 21 Apr 2017 09:28:47 +0100 Message-Id: <1492763327-12742-14-git-send-email-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1492763327-12742-1-git-send-email-mark.cave-ayland@ilande.co.uk> References: <1492763327-12742-1-git-send-email-mark.cave-ayland@ilande.co.uk> X-SA-Exim-Connect-IP: 86.191.119.77 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk X-SA-Exim-Version: 4.2.1 (built Sun, 08 Jan 2012 02:45:44 +0000) X-SA-Exim-Scanned: Yes (on s16892447.onlinehome-server.info) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 82.165.15.123 Subject: [Qemu-devel] [PATCH v2 13/13] tcx: switch to load_image_mr() and remove prom_addr hack 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: Mark Cave-Ayland Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Previous to the existence of load_image_mr(), the only way to load in the FCode ROM image was to pass in its physical address via qdev properties and use load_image_targphys(). Signed-off-by: Mark Cave-Ayland Reviewed-by: Gerd Hoffmann --- hw/display/tcx.c | 4 +--- hw/sparc/sun4m.c | 1 - 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/hw/display/tcx.c b/hw/display/tcx.c index 3f00735..5a1115c 100644 --- a/hw/display/tcx.c +++ b/hw/display/tcx.c @@ -843,8 +843,7 @@ static void tcx_realizefn(DeviceState *dev, Error **err= p) vmstate_register_ram_global(&s->rom); fcode_filename =3D qemu_find_file(QEMU_FILE_TYPE_BIOS, TCX_ROM_FILE); if (fcode_filename) { - ret =3D load_image_targphys(fcode_filename, s->prom_addr, - FCODE_MAX_ROM_SIZE); + ret =3D load_image_mr(fcode_filename, &s->rom); g_free(fcode_filename); if (ret < 0 || ret > FCODE_MAX_ROM_SIZE) { error_report("tcx: could not load prom '%s'", TCX_ROM_FILE); @@ -902,7 +901,6 @@ static Property tcx_properties[] =3D { DEFINE_PROP_UINT16("width", TCXState, width, -1), DEFINE_PROP_UINT16("height", TCXState, height, -1), DEFINE_PROP_UINT16("depth", TCXState, depth, -1), - DEFINE_PROP_UINT64("prom_addr", TCXState, prom_addr, -1), DEFINE_PROP_END_OF_LIST(), }; =20 diff --git a/hw/sparc/sun4m.c b/hw/sparc/sun4m.c index 7a0922b..5f022cc 100644 --- a/hw/sparc/sun4m.c +++ b/hw/sparc/sun4m.c @@ -491,7 +491,6 @@ static void tcx_init(hwaddr addr, qemu_irq irq, int vra= m_size, int width, qdev_prop_set_uint16(dev, "width", width); qdev_prop_set_uint16(dev, "height", height); qdev_prop_set_uint16(dev, "depth", depth); - qdev_prop_set_uint64(dev, "prom_addr", addr); qdev_init_nofail(dev); s =3D SYS_BUS_DEVICE(dev); =20 --=20 1.7.10.4