From nobody Tue Nov 4 21:44:00 2025 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; dkim=fail; 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 1531122583764850.0606463097212; Mon, 9 Jul 2018 00:49:43 -0700 (PDT) Received: from localhost ([::1]:39726 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fcQvW-0000VB-Jb for importer@patchew.org; Mon, 09 Jul 2018 03:49:42 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44114) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fcQq5-00052f-Ej for qemu-devel@nongnu.org; Mon, 09 Jul 2018 03:44:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fcQq4-0002Ac-Ef for qemu-devel@nongnu.org; Mon, 09 Jul 2018 03:44:05 -0400 Received: from ozlabs.org ([2401:3900:2:1::2]:59613) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fcQq4-00028o-1Z; Mon, 09 Jul 2018 03:44:04 -0400 Received: by ozlabs.org (Postfix, from userid 1007) id 41PHQS1HBcz9s1b; Mon, 9 Jul 2018 17:43:59 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1531122240; bh=rXki+7d3256sgFXV02Qnk7jleWx4jlhogkI/OQoo6tg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XIkta34SfOBcomby2Bz51NoP9Ogl6UpAIC+32qkLL5vEj4BZLpTTZ4NxH9PZ/liQH wi6waXL1zfBGrn8xbf+Z68JxDuaJZ/gWKXOqobFW1EqKVPtdB4fWkf9rZt/bGDNPUm AxBgjkLIZ/rMeGyrWnEunVZHjCtj9/kmKaRfKfZc= From: David Gibson To: peter.maydell@linaro.org Date: Mon, 9 Jul 2018 17:43:38 +1000 Message-Id: <20180709074350.27086-5-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180709074350.27086-1-david@gibson.dropbear.id.au> References: <20180709074350.27086-1-david@gibson.dropbear.id.au> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2401:3900:2:1::2 Subject: [Qemu-devel] [PULL 04/16] 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: Sebastian Bauer , qemu-devel@nongnu.org, groug@kaod.org, qemu-ppc@nongnu.org, clg@kaod.org, David Gibson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 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 Signed-off-by: David Gibson --- hw/display/sm501.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/hw/display/sm501.c b/hw/display/sm501.c index 05c964bea1..b095134d6f 100644 --- a/hw/display/sm501.c +++ b/hw/display/sm501.c @@ -487,6 +487,7 @@ typedef struct SM501State { MemoryRegion twoD_engine_region; uint32_t last_width; uint32_t last_height; + bool do_full_update; /* perform a full update next time */ I2CBus *i2c_bus; =20 /* mmio registers */ @@ -1042,6 +1043,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 true; } =20 static uint64_t sm501_disp_ctrl_read(void *opaque, hwaddr addr, @@ -1630,6 +1632,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 false; + 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.17.1