From nobody Sat Feb 28 02:44:41 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=1772224914; cv=none; d=zohomail.com; s=zohoarc; b=NyxZ5PlivIrQF6Rhy/EQ0qqAMXV7RMsHD2+CrVLi12OdPo5+iyhiTZLAPiCeMA8ZDIZlGqKl8zLMaE/xygl1HmdNdagPXMD0M9HLCUAEoagnaGbaw0um+7zAo+AQW+lTotlloNOwi20XaCtviw/SFFIYBRTvH4xmOSrSyfRavgQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1772224914; 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=/8gQrPLmCC6i3JQzdW1xashObqgDvg5nx94NGxDJ1P0=; b=gIyTZe/WJOsm2vp+mEOIXhGioOTEliHYTtiF5/dzd4mC7AhQgLvdFiKnzBVHRQcnL9QLjAHmPHbATqcnLIhKF+PjlMSj3XRA5v6DS/MUDy9OGkO17TkWcrEpOk6lcBRQRSpj+Fy2IfQ9MT/Klbjol/coqzoWyCHT3nfsa5n7Gxk= 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 1772224914491358.2420349377152; Fri, 27 Feb 2026 12:41:54 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vw4e8-0002Gf-Uw; Fri, 27 Feb 2026 15:41:14 -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 1vw4dz-0001Pm-Ne for qemu-devel@nongnu.org; Fri, 27 Feb 2026 15:41:05 -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 1vw4dx-0007Ps-5t for qemu-devel@nongnu.org; Fri, 27 Feb 2026 15:41:02 -0500 Received: from phl-compute-04.internal (phl-compute-04.internal [10.202.2.44]) by mailfhigh.phl.internal (Postfix) with ESMTP id 71647140017B; Fri, 27 Feb 2026 15:41:00 -0500 (EST) Received: from phl-frontend-04 ([10.202.2.163]) by phl-compute-04.internal (MEProxy); Fri, 27 Feb 2026 15:41:00 -0500 Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 27 Feb 2026 15:40:59 -0500 (EST) Received: from localhost (chomposaur [local]) by chomposaur (OpenSMTPD) with ESMTPA id d22ddc48; Fri, 27 Feb 2026 20:40:55 +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=1772224860; x= 1772311260; bh=/8gQrPLmCC6i3JQzdW1xashObqgDvg5nx94NGxDJ1P0=; b=A r/gR8Lj8PrPN00T2xdEAlaSy59+oDNDlxggVgAkI7xkmRS1E8rPhhWQnb+M7Tge+ 8ZwVcUUjAlfPhJprhd55oEwI8wzr53WuheC2fbre7Zo6S9jhIqFYZcc08z8eqPdy M8xMGajGRv4rRnyJCz6HqNcgutFIa0vqN4fTA1s+hHHJ2xcnTDlUURr7uL6hkxmL VQedMNL0eK3KdVsf+CvYbdHSINtnsazcEy1vmFTka7QfgG3kPgl9CsJiNgTtEiWU QNfBlj/ipK9osvlT4lfgxu5fMXo/SV6FkMvvHHURua7vgHVtyljgojZKRrOLyWf+ DnFbo3mo7aokqzLhIHRUA== 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=1772224860; x=1772311260; bh=/ 8gQrPLmCC6i3JQzdW1xashObqgDvg5nx94NGxDJ1P0=; b=tVNabtkYqU4CoZMP9 qu9YJLZUiFIn//NdXjRZo7FnVpJSqOnNMUCUYLpOD7QK+u55iyyFSA+nanCl7e1Z HRU5EFtaGMK5TlqG1fKNYf38stMZLzkvTVIOcP8iZcKGiZ9zuKPiODbFuVDVScm/ JzBpvBj3M9VwxC2WF5N16IU2l89cusnN/PuNwMtB3J+CZBpegS/ALyX452UYQG8Q WLT7aVAeficmZ1xhcUbjnTnJCpWFmLuMWUs6SJc9h7fsDqwYfbSmaKk/IDe6Kmky NKVRbOBLkL63jFh0QxWLwj42URDQjcofDt53DqcS0JSFB4svZ1dvI/vRqAvzAeuN H8/TA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefgedrtddtgddvgeelleelucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnegfrh hlucfvnfffucdljedtmdenucfjughrpefhvfevufffkffojghfggfgsedtkeertdertddt necuhfhrohhmpeevhhgrugculfgrsghlohhnshhkihcuoegthhgrugesjhgrsghlohhnsh hkihdrgiihiieqnecuggftrfgrthhtvghrnhepgfeiteejhfelheefieetjefgleejfffh ueffvdduieejgfeuueeuvddvkeejhfelnecuvehluhhsthgvrhfuihiivgepudenucfrrg hrrghmpehmrghilhhfrhhomheptghhrggusehjrggslhhonhhskhhirdighiiipdhnsggp rhgtphhtthhopeehpdhmohguvgepshhmthhpohhuthdprhgtphhtthhopegsrghlrghtoh hnsegvihhkrdgsmhgvrdhhuhdprhgtphhtthhopegthhgrugesjhgrsghlohhnshhkihdr giihiidprhgtphhtthhopehmrghrtggrnhgurhgvrdhluhhrvggruhesrhgvughhrghtrd gtohhmpdhrtghpthhtohepqhgvmhhuqdguvghvvghlsehnohhnghhnuhdrohhrghdprhgt phhtthhopehkrhgrgigvlhesrhgvughhrghtrdgtohhm 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 v9 08/18] ati-vga: Consolidate dirty region tracking in ati_2d_blt Date: Fri, 27 Feb 2026 15:39:34 -0500 Message-ID: <20260227203944.746471-9-chad@jablonski.xyz> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260227203944.746471-1-chad@jablonski.xyz> References: <20260227203944.746471-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: 8 X-Spam_score: 0.8 X-Spam_bar: / X-Spam_report: (0.8 / 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_CERTIFIED_BLOCKED=0.706, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.401, 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: 1772224915574158500 Content-Type: text/plain; charset="utf-8" Both supported ROPs follow the same memory set dirty logic. This consolidates that logic to remove the duplication. Signed-off-by: Chad Jablonski Reviewed-by: BALATON Zoltan --- hw/display/ati_2d.c | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/hw/display/ati_2d.c b/hw/display/ati_2d.c index cfc7bf9789..980cdd6ac0 100644 --- a/hw/display/ati_2d.c +++ b/hw/display/ati_2d.c @@ -43,15 +43,28 @@ static int ati_bpp_from_datatype(ATIVGAState *s) } } =20 +static void ati_set_dirty(ATIVGAState *s, + const uint8_t *dst_bits, unsigned dst_y) +{ + VGACommonState *vga =3D &s->vga; + DisplaySurface *ds =3D qemu_console_surface(vga->con); + + DPRINTF("%p %u ds: %p %d %d rop: %x\n", vga->vram_ptr, vga->vbe_start_= addr, + surface_data(ds), surface_stride(ds), surface_bits_per_pixel(d= s), + (s->regs.dp_mix & GMC_ROP3_MASK) >> 16); + if (dst_bits >=3D vga->vram_ptr + vga->vbe_start_addr && + 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 + + s->regs.dst_offset + dst_y * surface_strid= e(ds), + s->regs.dst_height * surface_stride(ds)); + } +} + void ati_2d_blt(ATIVGAState *s) { /* 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); - 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), - (s->regs.dp_mix & GMC_ROP3_MASK) >> 16); unsigned dst_x =3D (s->regs.dp_cntl & DST_X_LEFT_TO_RIGHT ? s->regs.dst_x : s->regs.dst_x + 1 - s->regs.dst_widt= h); unsigned dst_y =3D (s->regs.dp_cntl & DST_Y_TOP_TO_BOTTOM ? @@ -166,14 +179,6 @@ void ati_2d_blt(ATIVGAState *s) memmove(&dst_bits[i], &src_bits[j], s->regs.dst_width * by= pp); } } - if (dst_bits >=3D s->vga.vram_ptr + s->vga.vbe_start_addr && - 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 + - s->regs.dst_offset + - dst_y * surface_stride(ds), - s->regs.dst_height * surface_stride(ds= )); - } break; } case ROP3_PATCOPY: @@ -216,18 +221,13 @@ void ati_2d_blt(ATIVGAState *s) } } } - if (dst_bits >=3D s->vga.vram_ptr + s->vga.vbe_start_addr && - 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 + - s->regs.dst_offset + - dst_y * surface_stride(ds), - s->regs.dst_height * surface_stride(ds= )); - } break; } default: qemu_log_mask(LOG_UNIMP, "Unimplemented ati_2d blt op %x\n", (s->regs.dp_mix & GMC_ROP3_MASK) >> 16); + return; } + + ati_set_dirty(s, dst_bits, dst_y); } --=20 2.52.0