From nobody Tue Jan 21 01:01:51 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1677504962; cv=none; d=zohomail.com; s=zohoarc; b=AaIhvR8vf0YD1iUrzEjN/ymGyE2MVx4dRaCIVk8EJhq4XLJ/ufk+g1a5PC9xKiAneqGPS1FfkGA9bZuqqr3TMo/3SRQ3x4Fti0OXiffnAYJ8s0VJrPTYiBS1WMtQFRG7OoFesnASIhJaERbu2OZbTL1IS4lXjbfCSMcHMFP/BBo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1677504962; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=0Lqzv22KvYd26WZBONiwLPN2WCs4CWG7bM0JqgVXsno=; b=ZMOSwOL4DuGtPUCsMogTwmI9vvgBBhCUDJ+ssiUqE6c5aOr1ltX6/Ehs9y+8eCNzfZQlWR8M8QgbEDd3bYSvJw7Iexo2O4dy8445dn1sVor1qOwcDCwxmxiAnWpNaLd9Bgc+d30GoDOeSmhmtE8z2U0lLv1u+a3oZgvavQhu60c= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1677504962726649.3741584151281; Mon, 27 Feb 2023 05:36:02 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pWdeY-0005F0-7P; Mon, 27 Feb 2023 08:34:54 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pWddv-0004zc-IE; Mon, 27 Feb 2023 08:34:24 -0500 Received: from mail-ed1-x535.google.com ([2a00:1450:4864:20::535]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pWddo-0007eb-Qe; Mon, 27 Feb 2023 08:34:13 -0500 Received: by mail-ed1-x535.google.com with SMTP id o12so25781433edb.9; Mon, 27 Feb 2023 05:33:59 -0800 (PST) Received: from localhost.localdomain (dynamic-078-055-154-008.78.55.pool.telefonica.de. [78.55.154.8]) by smtp.gmail.com with ESMTPSA id gx16-20020a1709068a5000b008b69aa62efcsm3253603ejc.62.2023.02.27.05.33.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Feb 2023 05:33:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=0Lqzv22KvYd26WZBONiwLPN2WCs4CWG7bM0JqgVXsno=; b=nuo2CveytfjAXGT5pVJ0vSsWFFOOSCNeaBKGMqLZjsg92D28UkimNplFlynr3JUWX6 i9Aveg4abv2vfjObyop4yZkh4T+LP9HtTaaTSDW/iHTjU/vDblZbTsNbJD9d/g+M6dFh LsCMhl3iKYrK31ibeqrUqfraNhcmGKnqEGmk88UGIeXQwFR3+3RQXYbXRtcUn/vx+Q3g HVGXpdTlowNU21HFZu88kKEho2dEDAzfc+c99QK6UwfZk9TGcdFiSyRu37w7dywZD05X dzzhRCrziKefpj+h6urlzLN5UVqmgLvKMp6c3GjgkFEyNk9IC0N+xh5lIse6yE/b+G9S dnCA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=0Lqzv22KvYd26WZBONiwLPN2WCs4CWG7bM0JqgVXsno=; b=SqXADK0NHW1w1VRsJP/UuQZCkATajCI/SJed/mRw94fs0OKCphNM9zdv1uOot4Y3O/ lz3TBE/4B0hpJPBhHlraCqULeQXrDksOAT1cItmbkORK5XzYVfpqiOyu6pziTG98XQCJ 7rkpT9cH0ek44MEIu/muqk6P7WD4poAU/Ca/69CghVyGzGIsezjjNc9Og7qm9kRWth3b FkmPYP6ZCo+SnI0g44NZ0RpVADBW2r7ZTMKyLb8yVbk6kcVDhAmAIu0Inl1ygHIg1kjj liO/C7eDiTKqw3VlPQlCTjT2K1Xat7BFHd9dbuIIOI9EV9UGjYp6mshd13baFaGpU+k1 Uaag== X-Gm-Message-State: AO0yUKWsaGPFsMyLcx0TZiiI57LFH4rexC76ckGaaCweNQaU3ZkrjCMq fo+B0W8WXig4O6f73AfIlFnsD+dVI5k= X-Google-Smtp-Source: AK7set965rrO8OqvvVKqbc2Oivr8UkYH7Vt+MrC5I2N7iwamiArLHohjZJhQ/Egbk9A6Cdo0cFWg4w== X-Received: by 2002:a17:907:1c14:b0:8f0:143d:ee34 with SMTP id nc20-20020a1709071c1400b008f0143dee34mr9829024ejc.1.1677504837992; Mon, 27 Feb 2023 05:33:57 -0800 (PST) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: BALATON Zoltan , Huacai Chen , Gerd Hoffmann , Jiaxun Yang , qemu-ppc@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Rene Engel , Daniel Henrique Barboza Subject: [PATCH v4 1/7] hw/display/sm501: Implement more 2D raster operations Date: Mon, 27 Feb 2023 14:33:19 +0100 Message-Id: <20230227133325.22023-2-shentey@gmail.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230227133325.22023-1-shentey@gmail.com> References: <20230227133325.22023-1-shentey@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::535; envelope-from=shentey@gmail.com; helo=mail-ed1-x535.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 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-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1677504964562100001 Content-Type: text/plain; charset="utf-8" From: BALATON Zoltan Add simple implementation for two raster operations that are used by AmigaOS which fixes graphics problems in some programs using these. Signed-off-by: BALATON Zoltan Reported-by: Rene Engel Tested-by: Rene Engel Reviewed-by: Daniel Henrique Barboza Message-Id: <17ef3c59dc7868f75034e9ebe21e2999c8f718d4.1677445307.git.balato= n@eik.bme.hu> --- hw/display/sm501.c | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/hw/display/sm501.c b/hw/display/sm501.c index e1d0591d36..58bc9701ee 100644 --- a/hw/display/sm501.c +++ b/hw/display/sm501.c @@ -753,7 +753,7 @@ static void sm501_2d_operation(SM501State *s) } =20 if ((rop_mode && rop =3D=3D 0x5) || (!rop_mode && rop =3D=3D 0x55)= ) { - /* Invert dest, is there a way to do this with pixman? */ + /* DSTINVERT, is there a way to do this with pixman? */ unsigned int x, y, i; uint8_t *d =3D s->local_mem + dst_base; =20 @@ -763,6 +763,34 @@ static void sm501_2d_operation(SM501State *s) stn_he_p(&d[i], bypp, ~ldn_he_p(&d[i], bypp)); } } + } else if (!rop_mode && rop =3D=3D 0x99) { + /* DSxn, is there a way to do this with pixman? */ + unsigned int x, y, i, j; + uint8_t *sp =3D s->local_mem + src_base; + uint8_t *d =3D s->local_mem + dst_base; + + for (y =3D 0; y < height; y++) { + i =3D (dst_x + (dst_y + y) * dst_pitch) * bypp; + j =3D (src_x + (src_y + y) * src_pitch) * bypp; + for (x =3D 0; x < width; x++, i +=3D bypp, j +=3D bypp) { + stn_he_p(&d[i], bypp, + ~(ldn_he_p(&sp[j], bypp) ^ ldn_he_p(&d[i], by= pp))); + } + } + } else if (!rop_mode && rop =3D=3D 0xee) { + /* SRCPAINT, is there a way to do this with pixman? */ + unsigned int x, y, i, j; + uint8_t *sp =3D s->local_mem + src_base; + uint8_t *d =3D s->local_mem + dst_base; + + for (y =3D 0; y < height; y++) { + i =3D (dst_x + (dst_y + y) * dst_pitch) * bypp; + j =3D (src_x + (src_y + y) * src_pitch) * bypp; + for (x =3D 0; x < width; x++, i +=3D bypp, j +=3D bypp) { + stn_he_p(&d[i], bypp, + ldn_he_p(&sp[j], bypp) | ldn_he_p(&d[i], bypp= )); + } + } } else { /* Do copy src for unimplemented ops, better than unpainted ar= ea */ if ((rop_mode && (rop !=3D 0xc || rop2_source_is_pattern)) || --=20 2.39.2