From nobody Mon Apr 29 12:30:09 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 1491381467989300.98927290445135; Wed, 5 Apr 2017 01:37:47 -0700 (PDT) Received: from localhost ([::1]:39323 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cvgRm-0003UP-Qz for importer@patchew.org; Wed, 05 Apr 2017 04:37:46 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57214) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cvgQ5-0002Hy-0n for qemu-devel@nongnu.org; Wed, 05 Apr 2017 04:36:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cvgQ0-0005TJ-Qn for qemu-devel@nongnu.org; Wed, 05 Apr 2017 04:36:01 -0400 Received: from chuckie.co.uk ([82.165.15.123]:42814 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 1cvgQ0-0005Sb-Jm for qemu-devel@nongnu.org; Wed, 05 Apr 2017 04:35:56 -0400 Received: from host86-184-243-30.range86-184.btcentralplus.com ([86.184.243.30] 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 1cvgPy-0001ob-DK; Wed, 05 Apr 2017 09:35:55 +0100 From: Mark Cave-Ayland To: kraxel@redhat.com, qemu-devel@nongnu.org Date: Wed, 5 Apr 2017 09:35:16 +0100 Message-Id: <1491381329-3995-2-git-send-email-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1491381329-3995-1-git-send-email-mark.cave-ayland@ilande.co.uk> References: <1491381329-3995-1-git-send-email-mark.cave-ayland@ilande.co.uk> X-SA-Exim-Connect-IP: 86.184.243.30 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 01/14] 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: , 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 Mon Apr 29 12:30:09 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 1491381463950317.5851722738731; Wed, 5 Apr 2017 01:37:43 -0700 (PDT) Received: from localhost ([::1]:39321 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cvgRi-0003R5-Ic for importer@patchew.org; Wed, 05 Apr 2017 04:37:42 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57215) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cvgQ5-0002Hz-0x for qemu-devel@nongnu.org; Wed, 05 Apr 2017 04:36:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cvgQ2-0005U4-8Q for qemu-devel@nongnu.org; Wed, 05 Apr 2017 04:36:00 -0400 Received: from chuckie.co.uk ([82.165.15.123]:42817 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 1cvgQ2-0005TV-12 for qemu-devel@nongnu.org; Wed, 05 Apr 2017 04:35:58 -0400 Received: from host86-184-243-30.range86-184.btcentralplus.com ([86.184.243.30] 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 1cvgPz-0001ob-K7; Wed, 05 Apr 2017 09:35:56 +0100 From: Mark Cave-Ayland To: kraxel@redhat.com, qemu-devel@nongnu.org Date: Wed, 5 Apr 2017 09:35:17 +0100 Message-Id: <1491381329-3995-3-git-send-email-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1491381329-3995-1-git-send-email-mark.cave-ayland@ilande.co.uk> References: <1491381329-3995-1-git-send-email-mark.cave-ayland@ilande.co.uk> X-SA-Exim-Connect-IP: 86.184.243.30 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 02/14] 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: , 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 Mon Apr 29 12:30:09 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 149138146520376.62250716786946; Wed, 5 Apr 2017 01:37:45 -0700 (PDT) Received: from localhost ([::1]:39322 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cvgRk-0003SU-38 for importer@patchew.org; Wed, 05 Apr 2017 04:37:44 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57243) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cvgQ5-0002I1-Pr for qemu-devel@nongnu.org; Wed, 05 Apr 2017 04:36:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cvgQ4-0005WZ-Qt for qemu-devel@nongnu.org; Wed, 05 Apr 2017 04:36:01 -0400 Received: from chuckie.co.uk ([82.165.15.123]:42824 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 1cvgQ4-0005VY-JD for qemu-devel@nongnu.org; Wed, 05 Apr 2017 04:36:00 -0400 Received: from host86-184-243-30.range86-184.btcentralplus.com ([86.184.243.30] 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 1cvgQ1-0001ob-0I; Wed, 05 Apr 2017 09:35:57 +0100 From: Mark Cave-Ayland To: kraxel@redhat.com, qemu-devel@nongnu.org Date: Wed, 5 Apr 2017 09:35:18 +0100 Message-Id: <1491381329-3995-4-git-send-email-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1491381329-3995-1-git-send-email-mark.cave-ayland@ilande.co.uk> References: <1491381329-3995-1-git-send-email-mark.cave-ayland@ilande.co.uk> X-SA-Exim-Connect-IP: 86.184.243.30 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 03/14] cg3: remove unused width and height variables 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: , 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" These aren't required since we can use the display width and height directl= y. Signed-off-by: Mark Cave-Ayland Reviewed-by: Gerd Hoffmann Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/display/cg3.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/hw/display/cg3.c b/hw/display/cg3.c index b42f60e..178a6dd 100644 --- a/hw/display/cg3.c +++ b/hw/display/cg3.c @@ -93,14 +93,11 @@ static void cg3_update_display(void *opaque) uint32_t *data; uint32_t dval; int x, y, y_start; - unsigned int width, height; ram_addr_t page, page_min, page_max; =20 if (surface_bits_per_pixel(surface) !=3D 32) { return; } - width =3D s->width; - height =3D s->height; =20 y_start =3D -1; page_min =3D -1; @@ -110,11 +107,11 @@ static void cg3_update_display(void *opaque) data =3D (uint32_t *)surface_data(surface); =20 memory_region_sync_dirty_bitmap(&s->vram_mem); - for (y =3D 0; y < height; y++) { + for (y =3D 0; y < s->height; y++) { int update =3D s->full_update; =20 - page =3D y * width; - update |=3D memory_region_get_dirty(&s->vram_mem, page, width, + page =3D y * s->width; + update |=3D memory_region_get_dirty(&s->vram_mem, page, s->width, DIRTY_MEMORY_VGA); if (update) { if (y_start < 0) { @@ -127,7 +124,7 @@ static void cg3_update_display(void *opaque) page_max =3D page; } =20 - for (x =3D 0; x < width; x++) { + for (x =3D 0; x < s->width; x++) { dval =3D *pix++; dval =3D (s->r[dval] << 16) | (s->g[dval] << 8) | s->b[dva= l]; *data++ =3D dval; @@ -137,8 +134,8 @@ static void cg3_update_display(void *opaque) dpy_gfx_update(s->con, 0, y_start, s->width, y - y_start); y_start =3D -1; } - pix +=3D width; - data +=3D width; + pix +=3D s->width; + data +=3D s->width; } } s->full_update =3D 0; --=20 1.7.10.4 From nobody Mon Apr 29 12:30:09 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 1491381462379401.2603667904219; Wed, 5 Apr 2017 01:37:42 -0700 (PDT) Received: from localhost ([::1]:39320 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cvgRg-0003PS-Vb for importer@patchew.org; Wed, 05 Apr 2017 04:37:41 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57223) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cvgQ5-0002I0-Aj for qemu-devel@nongnu.org; Wed, 05 Apr 2017 04:36:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cvgQ4-0005WE-Bm for qemu-devel@nongnu.org; Wed, 05 Apr 2017 04:36:01 -0400 Received: from chuckie.co.uk ([82.165.15.123]:42821 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 1cvgQ4-0005Ud-4U for qemu-devel@nongnu.org; Wed, 05 Apr 2017 04:36:00 -0400 Received: from host86-184-243-30.range86-184.btcentralplus.com ([86.184.243.30] 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 1cvgQ2-0001ob-2R; Wed, 05 Apr 2017 09:35:58 +0100 From: Mark Cave-Ayland To: kraxel@redhat.com, qemu-devel@nongnu.org Date: Wed, 5 Apr 2017 09:35:19 +0100 Message-Id: <1491381329-3995-5-git-send-email-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1491381329-3995-1-git-send-email-mark.cave-ayland@ilande.co.uk> References: <1491381329-3995-1-git-send-email-mark.cave-ayland@ilande.co.uk> X-SA-Exim-Connect-IP: 86.184.243.30 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 04/14] 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: , 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 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 178a6dd..3d36960 100644 --- a/hw/display/cg3.c +++ b/hw/display/cg3.c @@ -300,8 +300,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); @@ -366,7 +365,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 Mon Apr 29 12:30:09 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 1491381604852709.4668481388383; Wed, 5 Apr 2017 01:40:04 -0700 (PDT) Received: from localhost ([::1]:39329 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cvgTz-0005fv-Q6 for importer@patchew.org; Wed, 05 Apr 2017 04:40:03 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57258) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cvgQ6-0002IE-B0 for qemu-devel@nongnu.org; Wed, 05 Apr 2017 04:36:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cvgQ5-0005XG-Al for qemu-devel@nongnu.org; Wed, 05 Apr 2017 04:36:02 -0400 Received: from chuckie.co.uk ([82.165.15.123]:42826 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 1cvgQ5-0005WI-4j for qemu-devel@nongnu.org; Wed, 05 Apr 2017 04:36:01 -0400 Received: from host86-184-243-30.range86-184.btcentralplus.com ([86.184.243.30] 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 1cvgQ3-0001ob-5V; Wed, 05 Apr 2017 09:36:00 +0100 From: Mark Cave-Ayland To: kraxel@redhat.com, qemu-devel@nongnu.org Date: Wed, 5 Apr 2017 09:35:20 +0100 Message-Id: <1491381329-3995-6-git-send-email-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1491381329-3995-1-git-send-email-mark.cave-ayland@ilande.co.uk> References: <1491381329-3995-1-git-send-email-mark.cave-ayland@ilande.co.uk> X-SA-Exim-Connect-IP: 86.184.243.30 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 05/14] 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: , 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 Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- 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 Mon Apr 29 12:30:09 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 1491381712025303.5342826105083; Wed, 5 Apr 2017 01:41:52 -0700 (PDT) Received: from localhost ([::1]:39343 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cvgVj-0007Do-1g for importer@patchew.org; Wed, 05 Apr 2017 04:41:51 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57311) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cvgQD-0002Mx-Ac for qemu-devel@nongnu.org; Wed, 05 Apr 2017 04:36:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cvgQ6-0005YH-Al for qemu-devel@nongnu.org; Wed, 05 Apr 2017 04:36:07 -0400 Received: from chuckie.co.uk ([82.165.15.123]:42829 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 1cvgQ6-0005XO-3y for qemu-devel@nongnu.org; Wed, 05 Apr 2017 04:36:02 -0400 Received: from host86-184-243-30.range86-184.btcentralplus.com ([86.184.243.30] 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 1cvgQ4-0001ob-5X; Wed, 05 Apr 2017 09:36:00 +0100 From: Mark Cave-Ayland To: kraxel@redhat.com, qemu-devel@nongnu.org Date: Wed, 5 Apr 2017 09:35:21 +0100 Message-Id: <1491381329-3995-7-git-send-email-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1491381329-3995-1-git-send-email-mark.cave-ayland@ilande.co.uk> References: <1491381329-3995-1-git-send-email-mark.cave-ayland@ilande.co.uk> X-SA-Exim-Connect-IP: 86.184.243.30 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 06/14] 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: , 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 Mon Apr 29 12:30:09 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 1491381710323813.0245408645451; Wed, 5 Apr 2017 01:41:50 -0700 (PDT) Received: from localhost ([::1]:39342 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cvgVh-0007Cw-8o for importer@patchew.org; Wed, 05 Apr 2017 04:41:49 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57278) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cvgQ8-0002JP-75 for qemu-devel@nongnu.org; Wed, 05 Apr 2017 04:36:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cvgQ7-0005Zq-EP for qemu-devel@nongnu.org; Wed, 05 Apr 2017 04:36:04 -0400 Received: from chuckie.co.uk ([82.165.15.123]:42831 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 1cvgQ7-0005YP-79 for qemu-devel@nongnu.org; Wed, 05 Apr 2017 04:36:03 -0400 Received: from host86-184-243-30.range86-184.btcentralplus.com ([86.184.243.30] 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 1cvgQ5-0001ob-4n; Wed, 05 Apr 2017 09:36:02 +0100 From: Mark Cave-Ayland To: kraxel@redhat.com, qemu-devel@nongnu.org Date: Wed, 5 Apr 2017 09:35:22 +0100 Message-Id: <1491381329-3995-8-git-send-email-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1491381329-3995-1-git-send-email-mark.cave-ayland@ilande.co.uk> References: <1491381329-3995-1-git-send-email-mark.cave-ayland@ilande.co.uk> X-SA-Exim-Connect-IP: 86.184.243.30 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 07/14] 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: , 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 Mon Apr 29 12:30:09 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 1491381604141912.1960058790796; Wed, 5 Apr 2017 01:40:04 -0700 (PDT) Received: from localhost ([::1]:39328 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cvgTy-0005eb-GB for importer@patchew.org; Wed, 05 Apr 2017 04:40:02 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57289) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cvgQ9-0002Ka-Ap for qemu-devel@nongnu.org; Wed, 05 Apr 2017 04:36:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cvgQ8-0005aY-FJ for qemu-devel@nongnu.org; Wed, 05 Apr 2017 04:36:05 -0400 Received: from chuckie.co.uk ([82.165.15.123]:42835 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 1cvgQ8-0005a0-8v for qemu-devel@nongnu.org; Wed, 05 Apr 2017 04:36:04 -0400 Received: from host86-184-243-30.range86-184.btcentralplus.com ([86.184.243.30] 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 1cvgQ6-0001ob-6r; Wed, 05 Apr 2017 09:36:03 +0100 From: Mark Cave-Ayland To: kraxel@redhat.com, qemu-devel@nongnu.org Date: Wed, 5 Apr 2017 09:35:23 +0100 Message-Id: <1491381329-3995-9-git-send-email-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1491381329-3995-1-git-send-email-mark.cave-ayland@ilande.co.uk> References: <1491381329-3995-1-git-send-email-mark.cave-ayland@ilande.co.uk> X-SA-Exim-Connect-IP: 86.184.243.30 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 08/14] 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: , 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 Mon Apr 29 12:30:09 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 1491381607146216.4712326489173; Wed, 5 Apr 2017 01:40:07 -0700 (PDT) Received: from localhost ([::1]:39331 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cvgU2-0005ix-2Y for importer@patchew.org; Wed, 05 Apr 2017 04:40:06 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57301) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cvgQA-0002LK-8s for qemu-devel@nongnu.org; Wed, 05 Apr 2017 04:36:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cvgQ9-0005b3-Cw for qemu-devel@nongnu.org; Wed, 05 Apr 2017 04:36:06 -0400 Received: from chuckie.co.uk ([82.165.15.123]:42838 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 1cvgQ9-0005aT-5G for qemu-devel@nongnu.org; Wed, 05 Apr 2017 04:36:05 -0400 Received: from host86-184-243-30.range86-184.btcentralplus.com ([86.184.243.30] 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 1cvgQ7-0001ob-9i; Wed, 05 Apr 2017 09:36:04 +0100 From: Mark Cave-Ayland To: kraxel@redhat.com, qemu-devel@nongnu.org Date: Wed, 5 Apr 2017 09:35:24 +0100 Message-Id: <1491381329-3995-10-git-send-email-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1491381329-3995-1-git-send-email-mark.cave-ayland@ilande.co.uk> References: <1491381329-3995-1-git-send-email-mark.cave-ayland@ilande.co.uk> X-SA-Exim-Connect-IP: 86.184.243.30 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 09/14] 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: , 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 Mon Apr 29 12:30:09 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 1491381872288688.1373050843672; Wed, 5 Apr 2017 01:44:32 -0700 (PDT) Received: from localhost ([::1]:39356 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cvgYJ-0000cy-8S for importer@patchew.org; Wed, 05 Apr 2017 04:44:31 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59717) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cvgWB-0007iI-1X for qemu-devel@nongnu.org; Wed, 05 Apr 2017 04:42:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cvgWA-0008T8-4b for qemu-devel@nongnu.org; Wed, 05 Apr 2017 04:42:19 -0400 Received: from chuckie.co.uk ([82.165.15.123]:42865 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 1cvgW9-0008ST-Tb for qemu-devel@nongnu.org; Wed, 05 Apr 2017 04:42:18 -0400 Received: from host86-184-243-30.range86-184.btcentralplus.com ([86.184.243.30] 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 1cvgQ8-0001ob-5N; Wed, 05 Apr 2017 09:36:05 +0100 From: Mark Cave-Ayland To: kraxel@redhat.com, qemu-devel@nongnu.org Date: Wed, 5 Apr 2017 09:35:25 +0100 Message-Id: <1491381329-3995-11-git-send-email-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1491381329-3995-1-git-send-email-mark.cave-ayland@ilande.co.uk> References: <1491381329-3995-1-git-send-email-mark.cave-ayland@ilande.co.uk> X-SA-Exim-Connect-IP: 86.184.243.30 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 10/14] 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: , 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 Mon Apr 29 12:30:09 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 1491381930920227.845841426628; Wed, 5 Apr 2017 01:45:30 -0700 (PDT) Received: from localhost ([::1]:39363 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cvgZF-0001FO-PK for importer@patchew.org; Wed, 05 Apr 2017 04:45:29 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59740) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cvgWD-0007kU-CX for qemu-devel@nongnu.org; Wed, 05 Apr 2017 04:42:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cvgWC-0008UJ-AF for qemu-devel@nongnu.org; Wed, 05 Apr 2017 04:42:21 -0400 Received: from chuckie.co.uk ([82.165.15.123]:42867 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 1cvgWC-0008Tu-2Q for qemu-devel@nongnu.org; Wed, 05 Apr 2017 04:42:20 -0400 Received: from host86-184-243-30.range86-184.btcentralplus.com ([86.184.243.30] 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 1cvgQ9-0001ob-6V; Wed, 05 Apr 2017 09:36:06 +0100 From: Mark Cave-Ayland To: kraxel@redhat.com, qemu-devel@nongnu.org Date: Wed, 5 Apr 2017 09:35:26 +0100 Message-Id: <1491381329-3995-12-git-send-email-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1491381329-3995-1-git-send-email-mark.cave-ayland@ilande.co.uk> References: <1491381329-3995-1-git-send-email-mark.cave-ayland@ilande.co.uk> X-SA-Exim-Connect-IP: 86.184.243.30 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 11/14] 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: , 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 Mon Apr 29 12:30:09 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 1491382013337284.98500275755407; Wed, 5 Apr 2017 01:46:53 -0700 (PDT) Received: from localhost ([::1]:39366 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cvgaa-000228-7c for importer@patchew.org; Wed, 05 Apr 2017 04:46:52 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59794) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cvgWJ-0007of-0l for qemu-devel@nongnu.org; Wed, 05 Apr 2017 04:42:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cvgWF-0008Vm-1c for qemu-devel@nongnu.org; Wed, 05 Apr 2017 04:42:27 -0400 Received: from chuckie.co.uk ([82.165.15.123]:42869 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 1cvgWE-0008Us-ML for qemu-devel@nongnu.org; Wed, 05 Apr 2017 04:42:22 -0400 Received: from host86-184-243-30.range86-184.btcentralplus.com ([86.184.243.30] 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 1cvgQA-0001ob-9L; Wed, 05 Apr 2017 09:36:07 +0100 From: Mark Cave-Ayland To: kraxel@redhat.com, qemu-devel@nongnu.org Date: Wed, 5 Apr 2017 09:35:27 +0100 Message-Id: <1491381329-3995-13-git-send-email-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1491381329-3995-1-git-send-email-mark.cave-ayland@ilande.co.uk> References: <1491381329-3995-1-git-send-email-mark.cave-ayland@ilande.co.uk> X-SA-Exim-Connect-IP: 86.184.243.30 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 12/14] 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: , 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 Mon Apr 29 12:30:09 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 1491381804674697.011026558585; Wed, 5 Apr 2017 01:43:24 -0700 (PDT) Received: from localhost ([::1]:39352 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cvgXD-0008KR-2k for importer@patchew.org; Wed, 05 Apr 2017 04:43:23 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59687) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cvgW9-0007gs-AP for qemu-devel@nongnu.org; Wed, 05 Apr 2017 04:42:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cvgW5-0008ON-By for qemu-devel@nongnu.org; Wed, 05 Apr 2017 04:42:17 -0400 Received: from chuckie.co.uk ([82.165.15.123]:42861 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 1cvgW5-0008NG-4S for qemu-devel@nongnu.org; Wed, 05 Apr 2017 04:42:13 -0400 Received: from host86-184-243-30.range86-184.btcentralplus.com ([86.184.243.30] 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 1cvgQB-0001ob-Ml; Wed, 05 Apr 2017 09:36:08 +0100 From: Mark Cave-Ayland To: kraxel@redhat.com, qemu-devel@nongnu.org Date: Wed, 5 Apr 2017 09:35:28 +0100 Message-Id: <1491381329-3995-14-git-send-email-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1491381329-3995-1-git-send-email-mark.cave-ayland@ilande.co.uk> References: <1491381329-3995-1-git-send-email-mark.cave-ayland@ilande.co.uk> X-SA-Exim-Connect-IP: 86.184.243.30 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 13/14] 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: , 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 Mon Apr 29 12:30:09 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 1491381804668221.97216354572822; Wed, 5 Apr 2017 01:43:24 -0700 (PDT) Received: from localhost ([::1]:39351 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cvgXC-0008KG-RR for importer@patchew.org; Wed, 05 Apr 2017 04:43:22 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59686) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cvgW9-0007gr-AB for qemu-devel@nongnu.org; Wed, 05 Apr 2017 04:42:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cvgW8-0008Rs-7T for qemu-devel@nongnu.org; Wed, 05 Apr 2017 04:42:17 -0400 Received: from chuckie.co.uk ([82.165.15.123]:42862 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 1cvgW7-0008QB-Pd for qemu-devel@nongnu.org; Wed, 05 Apr 2017 04:42:16 -0400 Received: from host86-184-243-30.range86-184.btcentralplus.com ([86.184.243.30] 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 1cvgQC-0001ob-PI; Wed, 05 Apr 2017 09:36:09 +0100 From: Mark Cave-Ayland To: kraxel@redhat.com, qemu-devel@nongnu.org Date: Wed, 5 Apr 2017 09:35:29 +0100 Message-Id: <1491381329-3995-15-git-send-email-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1491381329-3995-1-git-send-email-mark.cave-ayland@ilande.co.uk> References: <1491381329-3995-1-git-send-email-mark.cave-ayland@ilande.co.uk> X-SA-Exim-Connect-IP: 86.184.243.30 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 14/14] 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: , 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 Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- 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