From nobody Tue Feb 10 07:42:45 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=1769784727; cv=none; d=zohomail.com; s=zohoarc; b=BMuKyDXiLCMEWJ9BcApJDmjszauIrFmf0ujwUhBLMULF+dduc0rObclR85dX1MSim1pJvwgDoLAZ/RHSvXvo7Fs3U6/X3RHwyDjEsnpvFOMhbeekzDU8ByEUqgK+WozDs087siRBICWrYglR2txcTggHFyUWJmgBK/KjJT3v5GQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1769784727; 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=KRvjY95S9WC5R7utng58A1IuUIjwKpupOAaLfYpwcTM=; b=P5hsjl27wXElenTr8gRJUkwmXcjm9BkQm1Awxx8iqW7CLJzSw3/IIMwwU6jt1vMaQw2UXSUBQcjy4WMyiI+19h40HlXDzjqaCb1rkPFrQdEllP+Uj5tiwk7nlfWWe3YtdSX2XziucE7tVNc9JF+4Wubx8gvTvDd+fBc0Y4wWu0s= 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 1769784727530843.8659161352215; Fri, 30 Jan 2026 06:52:07 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vlppR-0004lB-Ug; Fri, 30 Jan 2026 09:50:33 -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 1vlppO-0004ir-3q for qemu-devel@nongnu.org; Fri, 30 Jan 2026 09:50:30 -0500 Received: from fhigh-b2-smtp.messagingengine.com ([202.12.124.153]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vlppL-00038T-D6 for qemu-devel@nongnu.org; Fri, 30 Jan 2026 09:50:29 -0500 Received: from phl-compute-06.internal (phl-compute-06.internal [10.202.2.46]) by mailfhigh.stl.internal (Postfix) with ESMTP id 265937A0167; Fri, 30 Jan 2026 09:50:26 -0500 (EST) Received: from phl-frontend-03 ([10.202.2.162]) by phl-compute-06.internal (MEProxy); Fri, 30 Jan 2026 09:50:26 -0500 Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 30 Jan 2026 09:50:25 -0500 (EST) Received: from localhost (chomposaur [local]) by chomposaur (OpenSMTPD) with ESMTPA id a8f1f6eb; Fri, 30 Jan 2026 14:50:19 +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=fm2; t=1769784626; x= 1769871026; bh=KRvjY95S9WC5R7utng58A1IuUIjwKpupOAaLfYpwcTM=; b=k C6Q8pllQmcTh/ZUGkl6xNKcS3nJUXKAo6+byqh1Xh55BoL3sPYvd9RtBV67Qhto/ WEJIXmaq3upqXIDN8hH26QWbJTVBYs/eslFoNfkzFL5gKJ0Rj9fBfmgYNuTagakk evYHcIokFjHHMbjsHkejIJl5PXCWPVHdIcCkV6c1XTrU0wgW/FV81XDqJsQOFNXN s5dEv+BGVt/QZMf/23YUXkuoi1VOK4FtiMpfFmaX7YCguxh/Wk8GPAEecRPbAwsd P0LW6Bk9aulEPH3HXeeHzaY0F4J9HzJTHU8I1/pOxw2rLCuZpVGUlqbAo2ljMpyH pqEbluOG5lgvni/PR3xhg== 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=fm3; t=1769784626; x=1769871026; bh=K RvjY95S9WC5R7utng58A1IuUIjwKpupOAaLfYpwcTM=; b=vmRAu1z0LsHmkTkfi bW84OIN8Tk/oUUhd/IaaQ8Ky8o4sXY9Zqfsj9LUoZ1TgiCn5fRWA5Fn5XyDCmwk8 VTB+DOj58gOyi1UQy4T5s3Ebl6V+fhXIHMPAFqVFF5rMAPhZlzomGoyIBb3VTk92 BAS08SlR2BKf7A1vCS0wrpEt3jbsPLHr4eHBm3Pq1IwntUWZ1fHuT3oDy36B8eFp u5EsQQtyGVbxul5ZG5Mu0KFrpMgsr9AiwCqybhGYN1dPBMgU+qIUJfYYqcdI5S7y IP/3q11F7PL6q78UKb5/XRPrvB8DU4RZjugVAJ+9fJhVmySy9Z4zPKAAsT2+e8oD 47KTg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefgedrtddtgdduieelfedvucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucgfrhhlucfvnfffucdljedtmdenucfjughrpefhvfevuf ffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpeevhhgrugculfgrsghlohhnshhk ihcuoegthhgrugesjhgrsghlohhnshhkihdrgiihiieqnecuggftrfgrthhtvghrnhepgf eiteejhfelheefieetjefgleejfffhueffvdduieejgfeuueeuvddvkeejhfelnecuvehl uhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheptghhrggusehjrg gslhhonhhskhhirdighiiipdhnsggprhgtphhtthhopeefpdhmohguvgepshhmthhpohhu thdprhgtphhtthhopegthhgrugesjhgrsghlohhnshhkihdrgiihiidprhgtphhtthhope gsrghlrghtohhnsegvihhkrdgsmhgvrdhhuhdprhgtphhtthhopehqvghmuhdquggvvhgv lhesnhhonhhgnhhurdhorhhg X-ME-Proxy: Feedback-ID: ib26944c1:Fastmail From: Chad Jablonski To: qemu-devel@nongnu.org Cc: balaton@eik.bme.hu, Chad Jablonski Subject: [PATCH v6 15/20] ati-vga: Extract ati_set_dirty helper function Date: Fri, 30 Jan 2026 09:50:00 -0500 Message-ID: <20260130145005.731129-16-chad@jablonski.xyz> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260130145005.731129-1-chad@jablonski.xyz> References: <20260130145005.731129-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=202.12.124.153; envelope-from=chad@jablonski.xyz; helo=fhigh-b2-smtp.messagingengine.com X-Spam_score_int: -2 X-Spam_score: -0.3 X-Spam_bar: / X-Spam_report: (-0.3 / 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.499, PDS_OTHER_BAD_TLD=1.999, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, 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: 1769784728580158500 Content-Type: text/plain; charset="utf-8" This is done in preparation for the removal of the ATIVGAState *s parameter. It will also be used by the HOST_DATA implementation. Signed-off-by: Chad Jablonski --- hw/display/ati_2d.c | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/hw/display/ati_2d.c b/hw/display/ati_2d.c index 39ea67aeb7..5c15c3ec70 100644 --- a/hw/display/ati_2d.c +++ b/hw/display/ati_2d.c @@ -64,6 +64,19 @@ typedef struct { const uint8_t *src_bits; } ATI2DCtx; =20 +static void ati_set_dirty(VGACommonState *vga, const ATI2DCtx *ctx) +{ + DisplaySurface *ds =3D qemu_console_surface(vga->con); + unsigned dst_offset =3D ctx->dst_bits - vga->vram_ptr; + if (ctx->dst_bits >=3D vga->vram_ptr + vga->vbe_start_addr && + ctx->dst_bits < vga->vram_ptr + vga->vbe_start_addr + + vga->vbe_regs[VBE_DISPI_INDEX_YRES] * vga->vbe_line_offset) { + memory_region_set_dirty(&vga->vram, vga->vbe_start_addr + + dst_offset + ctx->dst.y * surface_stride(d= s), + ctx->dst.height * surface_stride(ds)); + } +} + static void setup_2d_blt_ctx(const ATIVGAState *s, ATI2DCtx *ctx) { ctx->bpp =3D ati_bpp_from_datatype(s); @@ -105,14 +118,12 @@ static void ati_2d_do_blt(ATIVGAState *s, ATI2DCtx *c= tx, uint8_t use_pixman) { /* FIXME it is probably more complex than this and may need to be */ /* rewritten but for now as a start just to get some output: */ - DisplaySurface *ds =3D qemu_console_surface(s->vga.con); bool use_pixman_fill =3D use_pixman & BIT(0); bool use_pixman_blt =3D use_pixman & BIT(1); DPRINTF("%p %u ds: %p %d %d rop: %x\n", s->vga.vram_ptr, s->vga.vbe_start_addr, surface_data(ds), surface_stride(ds), surface_bits_per_pixel(ds), ctx->rop3 >> 16); - unsigned dst_offset =3D s->regs.dst_offset; if (!ctx->bpp) { qemu_log_mask(LOG_GUEST_ERROR, "Invalid bpp\n"); return; @@ -261,14 +272,6 @@ static void ati_2d_do_blt(ATIVGAState *s, ATI2DCtx *ct= x, uint8_t use_pixman) ctx->rop3 >> 16); return; } - - if (ctx->dst_bits >=3D s->vga.vram_ptr + s->vga.vbe_start_addr && - ctx->dst_bits < s->vga.vram_ptr + s->vga.vbe_start_addr + - s->vga.vbe_regs[VBE_DISPI_INDEX_YRES] * s->vga.vbe_line_offset) { - memory_region_set_dirty(&s->vga.vram, s->vga.vbe_start_addr + - dst_offset + ctx->dst.y * surface_stride(d= s), - ctx->dst.height * surface_stride(ds)); - } } =20 void ati_2d_blt(ATIVGAState *s) @@ -276,4 +279,5 @@ void ati_2d_blt(ATIVGAState *s) ATI2DCtx ctx; setup_2d_blt_ctx(s, &ctx); ati_2d_do_blt(s, &ctx, s->use_pixman); + ati_set_dirty(&s->vga, &ctx); } --=20 2.52.0