From nobody Fri Mar 27 04:54:42 2026 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=jablonski.xyz ARC-Seal: i=1; a=rsa-sha256; t=1772506092; cv=none; d=zohomail.com; s=zohoarc; b=XFQkzJYi2H06hBbR8NbyR35svJnZqldejNTi8Lrzdl9tp+4t9cnSxDqQR1IA6IXUiSX633Hny4tKtIzj1uqcWQZi8e4f53XaQUTWUlfzvjtFpaZi8BgAXavfqNGIbiZPOPZ9OUNmRXbWqza25CCVYyGsoID6bJbTiqYhr3TwF80= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1772506092; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=hsOoV5SEFnjT+HmyKMFdg4LlrnghzAeccgr1Y6x1SZk=; b=gNgZaTuYLFqnv8YTNAZIfThdsBsGFPljhZkocequSkOOcJRxqmquPNRmf++AkHbE1LhnBmLIphZmlivX5MKHUuM/gKrWWcSEO3TJVpZcS7/byAMc/zr+Kp7PKz+X7rtGrkhKPIe0nheoBcXa+Jxx23tyi/v/pooe3srxXCi6AaQ= 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 1772506092191369.79923912733034; Mon, 2 Mar 2026 18:48:12 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vxFne-0008AF-3w; Mon, 02 Mar 2026 21:47: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 1vxFnT-0007pL-Mb for qemu-devel@nongnu.org; Mon, 02 Mar 2026 21:47:43 -0500 Received: from fhigh-a7-smtp.messagingengine.com ([103.168.172.158]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vxFnR-0002r6-4e for qemu-devel@nongnu.org; Mon, 02 Mar 2026 21:47:43 -0500 Received: from phl-compute-12.internal (phl-compute-12.internal [10.202.2.52]) by mailfhigh.phl.internal (Postfix) with ESMTP id 714611400215; Mon, 2 Mar 2026 21:47:40 -0500 (EST) Received: from phl-frontend-03 ([10.202.2.162]) by phl-compute-12.internal (MEProxy); Mon, 02 Mar 2026 21:47:40 -0500 Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 2 Mar 2026 21:47:39 -0500 (EST) Received: from localhost (chomposaur [local]) by chomposaur (OpenSMTPD) with ESMTPA id cde559c1; Tue, 3 Mar 2026 02:47:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jablonski.xyz; h=cc:cc:content-transfer-encoding:content-type:date:date:from :from:in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to; s=fm3; t=1772506060; x= 1772592460; bh=hsOoV5SEFnjT+HmyKMFdg4LlrnghzAeccgr1Y6x1SZk=; b=H mPcbyTlsv0kIep+MW4YNTMv9xWSbGw2zoFNHhIUAhS0XfM75ROdjln2o5TWLyigJ QUyvuQecTISatAbTG3Jy8N8Wi9NqNgfHwAgSnS3+Hx1+oS3QK7xDixHmctayz1SY 0WMUXe31x0GmFMM1PqAya7bI6gyuAdiZavPeWtbmjqnqkH2JgwHnMoV3ASXeH5tD K/0Qtza75T1f9d0BgnOy/fkgFAjP4PfVqPOpMWgHNIhVhcFj+U0VONhEqedJIJvg DaCR+pqVbMlUkb7+61a4dm7LmHBZwUmGxO+gV0/4RJlGNnvD24/daVNXGKSfrZ8b c5fE0ca8Wrva+OuVeMiYg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm1; t=1772506060; x=1772592460; bh=h sOoV5SEFnjT+HmyKMFdg4LlrnghzAeccgr1Y6x1SZk=; b=CxHQvNOPcQ/sbYmVq U8LeTdTlhiEsklczw5qebv9T5VFKnXgaVh023Blm/2zqWmLky8Z3oqhUkszkPMsd bxWfR5YE7pVIYPnJ0v3WhAjtQ1VTzqB/C98wuby0zUColwcE5rawqLLzO10HSr0r EnaQWj/VK8KhyvSNrbGHUg61P0j7OZzEvBTssPSsMdaE+QLCRh7IlFAb1eQiI9t0 p/GwWjUWfkUuI3/KYscgH1bcWvTl8mrx+B5X5Qqqgo9R+AeZCNxcuocZZuIg+eyX bEFGNt5ecgEWQR7Mfj3GL/Kk4M9DAcWsqttZ6/4o/1u4HiuqzCEcLMaozSbxakYA yoMNg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefgedrtddtgddvheelgedtucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnegfrh hlucfvnfffucdljedtmdenucfjughrpefhvfevufffkffojghfggfgsedtkeertdertddt necuhfhrohhmpeevhhgrugculfgrsghlohhnshhkihcuoegthhgrugesjhgrsghlohhnsh hkihdrgiihiieqnecuggftrfgrthhtvghrnhepgfeiteejhfelheefieetjefgleejfffh ueffvdduieejgfeuueeuvddvkeejhfelnecuvehluhhsthgvrhfuihiivgeptdenucfrrg hrrghmpehmrghilhhfrhhomheptghhrggusehjrggslhhonhhskhhirdighiiipdhnsggp rhgtphhtthhopeehpdhmohguvgepshhmthhpohhuthdprhgtphhtthhopehqvghmuhdqug gvvhgvlhesnhhonhhgnhhurdhorhhgpdhrtghpthhtohepsggrlhgrthhonhesvghikhdr sghmvgdrhhhupdhrtghpthhtoheptghhrggusehjrggslhhonhhskhhirdighiiipdhrtg hpthhtohepkhhrrgigvghlsehrvgguhhgrthdrtghomhdprhgtphhtthhopehmrghrtggr nhgurhgvrdhluhhrvggruhesrhgvughhrghtrdgtohhm X-ME-Proxy: Feedback-ID: ib26944c1:Fastmail From: Chad Jablonski To: qemu-devel@nongnu.org Cc: BALATON Zoltan , Gerd Hoffmann , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Chad Jablonski Subject: [PATCH v11 13/17] ati-vga: Split ati_2d_do_blt from ati_2d_blt Date: Mon, 2 Mar 2026 21:47:26 -0500 Message-ID: <20260303024730.1489136-14-chad@jablonski.xyz> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260303024730.1489136-1-chad@jablonski.xyz> References: <20260303024730.1489136-1-chad@jablonski.xyz> 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=103.168.172.158; envelope-from=chad@jablonski.xyz; helo=fhigh-a7-smtp.messagingengine.com X-Spam_score_int: 12 X-Spam_score: 1.2 X-Spam_bar: + X-Spam_report: (1.2 / 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, FROM_SUSPICIOUS_NTLD=0.5, PDS_OTHER_BAD_TLD=1.999, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.968, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.495, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, UNPARSEABLE_RELAY=0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development 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 @jablonski.xyz) X-ZM-MESSAGEID: 1772506093824158500 Content-Type: text/plain; charset="utf-8" ati_2d_blt remains the public interface to the blitter but the bulk of the implementation is moved down into ati_2d_do_blt which is passed an ATI2DCtx. ati_2d_do_blt returns a bool that is true when the blit succeeded, which means that a screen region will need to be set dirty. Otherwise false is returned. Signed-off-by: Chad Jablonski Reviewed-by: BALATON Zoltan --- hw/display/ati_2d.c | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/hw/display/ati_2d.c b/hw/display/ati_2d.c index f1536e5425..df8975d9d7 100644 --- a/hw/display/ati_2d.c +++ b/hw/display/ati_2d.c @@ -123,27 +123,24 @@ static void setup_2d_blt_ctx(const ATIVGAState *s, AT= I2DCtx *ctx) (ctx->top_to_bottom ? 'v' : '^')); } =20 -void ati_2d_blt(ATIVGAState *s) +static bool ati_2d_do_blt(ATIVGAState *s, ATI2DCtx *ctx) { bool use_pixman_fill =3D s->use_pixman & BIT(0); bool use_pixman_blt =3D s->use_pixman & BIT(1); - ATI2DCtx ctx_; - ATI2DCtx *ctx =3D &ctx_; - setup_2d_blt_ctx(s, ctx); if (!ctx->bpp) { qemu_log_mask(LOG_GUEST_ERROR, "Invalid bpp\n"); - return; + return false; } if (!ctx->dst_stride) { qemu_log_mask(LOG_GUEST_ERROR, "Zero dest pitch\n"); - return; + return false; } int dst_stride_words =3D ctx->dst_stride / sizeof(uint32_t); if (ctx->dst.x > 0x3fff || ctx->dst.y > 0x3fff || ctx->dst_bits >=3D ctx->vram_end || ctx->dst_bits + ctx->dst.x + (ctx->dst.y + ctx->dst.height) * ctx->dst_stride >=3D ctx->vram= _end) { qemu_log_mask(LOG_UNIMP, "blt outside vram not implemented\n"); - return; + return false; } switch (ctx->rop3) { case ROP3_SRCCOPY: @@ -151,7 +148,7 @@ void ati_2d_blt(ATIVGAState *s) bool fallback =3D false; if (!ctx->src_stride) { qemu_log_mask(LOG_GUEST_ERROR, "Zero source pitch\n"); - return; + return false; } int src_stride_words =3D ctx->src_stride / sizeof(uint32_t); if (ctx->src.x > 0x3fff || ctx->src.y > 0x3fff @@ -159,7 +156,7 @@ void ati_2d_blt(ATIVGAState *s) || ctx->src_bits + ctx->src.x + (ctx->src.y + ctx->dst.height) * ctx->src_stride >=3D ctx->vram_end) { qemu_log_mask(LOG_UNIMP, "blt outside vram not implemented\n"); - return; + return false; } =20 DPRINTF("pixman_blt(%p, %p, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d= )\n", @@ -262,8 +259,17 @@ void ati_2d_blt(ATIVGAState *s) default: qemu_log_mask(LOG_UNIMP, "Unimplemented ati_2d blt op %x\n", ctx->rop3 >> 16); - return; + return false; } =20 - ati_set_dirty(&s->vga, ctx); + return true; +} + +void ati_2d_blt(ATIVGAState *s) +{ + ATI2DCtx ctx; + setup_2d_blt_ctx(s, &ctx); + if (ati_2d_do_blt(s, &ctx)) { + ati_set_dirty(&s->vga, &ctx); + } } --=20 2.52.0