From nobody Tue Apr 15 15:44:10 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; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1535106170115511.95269276347017; Fri, 24 Aug 2018 03:22:50 -0700 (PDT) Received: from localhost ([::1]:40925 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ft9El-0005As-FT for importer@patchew.org; Fri, 24 Aug 2018 06:22:39 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35865) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ft8UN-0007hf-M7 for qemu-devel@nongnu.org; Fri, 24 Aug 2018 05:34:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ft8UM-0004pw-3r for qemu-devel@nongnu.org; Fri, 24 Aug 2018 05:34:43 -0400 Received: from orth.archaic.org.uk ([2001:8b0:1d0::2]:44900) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ft8UL-0004n1-PO for qemu-devel@nongnu.org; Fri, 24 Aug 2018 05:34:41 -0400 Received: from pm215 by orth.archaic.org.uk with local (Exim 4.89) (envelope-from ) id 1ft8UI-0006fD-W4 for qemu-devel@nongnu.org; Fri, 24 Aug 2018 10:34:39 +0100 From: Peter Maydell To: qemu-devel@nongnu.org Date: Fri, 24 Aug 2018 10:33:37 +0100 Message-Id: <20180824093343.11346-47-peter.maydell@linaro.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180824093343.11346-1-peter.maydell@linaro.org> References: <20180824093343.11346-1-peter.maydell@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2001:8b0:1d0::2 Subject: [Qemu-devel] [PULL 46/52] hw/display/bcm2835_fb: Drop unused size and pitch fields 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: RDMRC_1 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" The BCM2835FBState struct has a 'pitch' field which is a cached copy of xres * (bpp >> 3), and a 'size' field which is a cached copy of pitch * yres. However we don't actually do anything with these fields; delete them. We retain the now-unused slots in the VMState struct for migration compatibility. Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson Message-id: 20180814144436.679-4-peter.maydell@linaro.org --- include/hw/display/bcm2835_fb.h | 4 ---- hw/display/bcm2835_fb.c | 19 ++++++++----------- 2 files changed, 8 insertions(+), 15 deletions(-) diff --git a/include/hw/display/bcm2835_fb.h b/include/hw/display/bcm2835_f= b.h index b965698d28a..69cbf2d1fd9 100644 --- a/include/hw/display/bcm2835_fb.h +++ b/include/hw/display/bcm2835_fb.h @@ -47,10 +47,6 @@ typedef struct { bool lock, invalidate, pending; =20 BCM2835FBConfig config; - - /* These are just cached values calculated from the config settings */ - uint32_t size; - uint32_t pitch; } BCM2835FBState; =20 void bcm2835_fb_reconfigure(BCM2835FBState *s, BCM2835FBConfig *newconfig); diff --git a/hw/display/bcm2835_fb.c b/hw/display/bcm2835_fb.c index 8155de5d0b1..9faabf0d0b4 100644 --- a/hw/display/bcm2835_fb.c +++ b/hw/display/bcm2835_fb.c @@ -184,6 +184,9 @@ static void fb_update_display(void *opaque) =20 static void bcm2835_fb_mbox_push(BCM2835FBState *s, uint32_t value) { + uint32_t pitch; + uint32_t size; + value &=3D ~0xf; =20 s->lock =3D true; @@ -201,12 +204,12 @@ static void bcm2835_fb_mbox_push(BCM2835FBState *s, u= int32_t value) =20 /* TODO - Manage properly virtual resolution */ =20 - s->pitch =3D s->config.xres * (s->config.bpp >> 3); - s->size =3D s->config.yres * s->pitch; + pitch =3D s->config.xres * (s->config.bpp >> 3); + size =3D s->config.yres * pitch; =20 - stl_le_phys(&s->dma_as, value + 16, s->pitch); + stl_le_phys(&s->dma_as, value + 16, pitch); stl_le_phys(&s->dma_as, value + 32, s->config.base); - stl_le_phys(&s->dma_as, value + 36, s->size); + stl_le_phys(&s->dma_as, value + 36, size); =20 s->invalidate =3D true; qemu_console_resize(s->con, s->config.xres, s->config.yres); @@ -223,9 +226,6 @@ void bcm2835_fb_reconfigure(BCM2835FBState *s, BCM2835F= BConfig *newconfig) =20 /* TODO - Manage properly virtual resolution */ =20 - s->pitch =3D s->config.xres * (s->config.bpp >> 3); - s->size =3D s->config.yres * s->pitch; - s->invalidate =3D true; qemu_console_resize(s->con, s->config.xres, s->config.yres); s->lock =3D false; @@ -301,8 +301,7 @@ static const VMStateDescription vmstate_bcm2835_fb =3D { VMSTATE_UINT32(config.yoffset, BCM2835FBState), VMSTATE_UINT32(config.bpp, BCM2835FBState), VMSTATE_UINT32(config.base, BCM2835FBState), - VMSTATE_UINT32(pitch, BCM2835FBState), - VMSTATE_UINT32(size, BCM2835FBState), + VMSTATE_UNUSED(8), /* Was pitch and size */ VMSTATE_UINT32(config.pixo, BCM2835FBState), VMSTATE_UINT32(config.alpha, BCM2835FBState), VMSTATE_END_OF_LIST() @@ -335,8 +334,6 @@ static void bcm2835_fb_reset(DeviceState *dev) s->config.xoffset =3D 0; s->config.yoffset =3D 0; s->config.base =3D s->vcram_base + BCM2835_FB_OFFSET; - s->pitch =3D s->config.xres * (s->config.bpp >> 3); - s->size =3D s->config.yres * s->pitch; =20 s->invalidate =3D true; s->lock =3D false; --=20 2.18.0