From nobody Wed Nov 5 18:26:50 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 1537361568550840.6479205379325; Wed, 19 Sep 2018 05:52:48 -0700 (PDT) Received: from localhost ([::1]:45282 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g2byI-0004a5-H1 for importer@patchew.org; Wed, 19 Sep 2018 08:52:46 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53608) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g2bmV-0005Kd-4C for qemu-devel@nongnu.org; Wed, 19 Sep 2018 08:40:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g2bmU-0003JY-BL for qemu-devel@nongnu.org; Wed, 19 Sep 2018 08:40:35 -0400 Received: from tunnel204845-pt.tunnel.tserv24.sto1.ipv6.he.net ([2001:470:27:e99::2]:36530 helo=bahamut.mc.pp.se) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1g2bmU-0003Gh-1F for qemu-devel@nongnu.org; Wed, 19 Sep 2018 08:40:34 -0400 Received: from hakua (hakua [192.168.42.40]) by bahamut.mc.pp.se (Postfix) with SMTP id 019EA3C27D; Wed, 19 Sep 2018 14:30:47 +0200 (CEST) Received: by hakua (sSMTP sendmail emulation); Wed, 19 Sep 2018 14:31:16 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=mc.pp.se; s=hedgehog; t=1537360249; bh=TiPPEix7y42en2b9Fdsxaz8msSH5qPZUQoq5FwNoIz8=; h=From:To:Cc:Subject:Date:Message-Id; b=RloldV9NhDjf65LDeyi1iv5dS9W HhFhlL092CBWqt7bADCThDemvdvWUVlhOHs9kGVwOVUlBmdJa4+XT7xPGf6nTDy1SfS /UDxoRG8pgHzmHROsE2x4ADSyQcHMB3wCNC0IuQ8fUcwDbli/ii5X0gU/tpRU0aLLhA 4V1YREANaQ= From: "Marcus Comstedt" To: qemu-devel@nongnu.org Date: Wed, 19 Sep 2018 14:31:14 +0200 Message-Id: <20180919123114.64267-1-marcus@mc.pp.se> X-Mailer: git-send-email 2.16.4 X-detected-operating-system: by eggs.gnu.org: Windows NT kernel [generic] [fuzzy] X-Received-From: 2001:470:27:e99::2 X-Mailman-Approved-At: Wed, 19 Sep 2018 08:47:21 -0400 Subject: [Qemu-devel] [PATCH] sm501: Adjust endianness of pixel value in rectangle fill 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 , David Gibson , Marcus Comstedt 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" The value from twoD_foreground (which is in host endian format) must be converted to the endianness of the framebuffer (currently always little endian) before it can be used to perform the fill operation. Signed-off-by: Marcus Comstedt Reviewed-by: BALATON Zoltan Reviewed-by: Peter Maydell --- Hi. I noticed when running AmigaOS 4.1 as a guest that the rectangle fill function in SM501 does not work correctly if the host is big endian (tested on a Talos II). This can be observed easily by starting a shell in 16-bit mode, where the background turns purple instead of gray. After applying this patch rendering was ok on both big and little endian hosts. // Marcus hw/display/sm501.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hw/display/sm501.c b/hw/display/sm501.c index 874260a143..4a8686f0f5 100644 --- a/hw/display/sm501.c +++ b/hw/display/sm501.c @@ -39,6 +39,7 @@ #include "hw/i2c/i2c-ddc.h" #include "qemu/range.h" #include "ui/pixel_ops.h" +#include "qemu/bswap.h" =20 /* * Status: 2010/05/07 @@ -812,9 +813,11 @@ static void sm501_2d_operation(SM501State *s) FILL_RECT(1, uint8_t); break; case 1: + color =3D cpu_to_le16(color); FILL_RECT(2, uint16_t); break; case 2: + color =3D cpu_to_le32(color); FILL_RECT(4, uint32_t); break; } --=20 2.16.4