From nobody Mon Feb 9 20:32:10 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 152956982159144.18864290783574; Thu, 21 Jun 2018 01:30:21 -0700 (PDT) Received: from localhost ([::1]:53756 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fVuyy-0003K5-NR for importer@patchew.org; Thu, 21 Jun 2018 04:30:20 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52705) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fVuwk-0001jd-9j for qemu-devel@nongnu.org; Thu, 21 Jun 2018 04:28:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fVuwh-0004co-1H for qemu-devel@nongnu.org; Thu, 21 Jun 2018 04:28:02 -0400 Received: from zero.eik.bme.hu ([152.66.115.2]:31085) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fVuwg-0004cF-QL for qemu-devel@nongnu.org; Thu, 21 Jun 2018 04:27:58 -0400 Received: from zero.eik.bme.hu (blah.eik.bme.hu [152.66.115.182]) by localhost (Postfix) with SMTP id 3CAD87456C8; Thu, 21 Jun 2018 10:27:57 +0200 (CEST) Received: by zero.eik.bme.hu (Postfix, from userid 432) id BA8C174568D; Thu, 21 Jun 2018 10:27:56 +0200 (CEST) Message-Id: In-Reply-To: References: From: BALATON Zoltan Date: Thu, 21 Jun 2018 10:08:21 +0200 To: qemu-devel@nongnu.org X-detected-operating-system: by eggs.gnu.org: FreeBSD 9.x [fuzzy] X-Received-From: 152.66.115.2 Subject: [Qemu-devel] [PATCH 2/5] sm501: Perform a full update after palette change 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: Peter Maydell , Sebastian Bauer , Magnus Damm , Aurelien Jarno , David Gibson 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" From: Sebastian Bauer Changing the palette of a color index has as an immediate effect on all pixels with the corresponding index on real hardware. Performing a full update after a palette change is a simple way to emulate this effect. Signed-off-by: Sebastian Bauer Signed-off-by: BALATON Zoltan --- Notes: v4: Updated commit message hw/display/sm501.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/hw/display/sm501.c b/hw/display/sm501.c index 0625cf5..a2ee6e3 100644 --- a/hw/display/sm501.c +++ b/hw/display/sm501.c @@ -479,6 +479,7 @@ typedef struct SM501State { MemoryRegion twoD_engine_region; uint32_t last_width; uint32_t last_height; + uint32_t do_full_update; /* perform a full update next time */ I2CBus *i2c_bus; =20 /* mmio registers */ @@ -1032,6 +1033,7 @@ static void sm501_palette_write(void *opaque, hwaddr = addr, =20 assert(range_covers_byte(0, 0x400 * 3, addr)); *(uint32_t *)&s->dc_palette[addr] =3D value; + s->do_full_update =3D 1; } =20 static uint64_t sm501_disp_ctrl_read(void *opaque, hwaddr addr, @@ -1620,6 +1622,12 @@ static void sm501_update_display(void *opaque) full_update =3D 1; } =20 + /* someone else requested a full update */ + if (s->do_full_update) { + s->do_full_update =3D 0; + full_update =3D 1; + } + /* draw each line according to conditions */ snap =3D memory_region_snapshot_and_clear_dirty(&s->local_mem_region, offset, width * height * src_bpp, DIRTY_MEMORY_VGA); --=20 2.7.6