Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/2202581/?format=api
{ "id": 2202581, "url": "http://patchwork.ozlabs.org/api/patches/2202581/?format=api", "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20260227203944.746471-2-chad@jablonski.xyz/", "project": { "id": 14, "url": "http://patchwork.ozlabs.org/api/projects/14/?format=api", "name": "QEMU Development", "link_name": "qemu-devel", "list_id": "qemu-devel.nongnu.org", "list_email": "qemu-devel@nongnu.org", "web_url": "", "scm_url": "", "webscm_url": "", "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<20260227203944.746471-2-chad@jablonski.xyz>", "list_archive_url": null, "date": "2026-02-27T20:39:27", "name": "[v9,01/18] ati-vga: Fix framebuffer mapping by using hardware-correct aperture sizes", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "6137a97dc6e2cb05c60c5278c89a4fe537c3cd9c", "submitter": { "id": 91805, "url": "http://patchwork.ozlabs.org/api/people/91805/?format=api", "name": "Chad Jablonski", "email": "chad@jablonski.xyz" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20260227203944.746471-2-chad@jablonski.xyz/mbox/", "series": [ { "id": 493814, "url": "http://patchwork.ozlabs.org/api/series/493814/?format=api", "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/list/?series=493814", "date": "2026-02-27T20:39:27", "name": "ati-vga: Implement HOST_DATA transfers to enable X.org text rendering", "version": 9, "mbox": "http://patchwork.ozlabs.org/series/493814/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2202581/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2202581/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>", "X-Original-To": "incoming@patchwork.ozlabs.org", "Delivered-To": "patchwork-incoming@legolas.ozlabs.org", "Authentication-Results": [ "legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=jablonski.xyz header.i=@jablonski.xyz\n header.a=rsa-sha256 header.s=fm2 header.b=LgTz5wMc;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=messagingengine.com header.i=@messagingengine.com\n header.a=rsa-sha256 header.s=fm3 header.b=iv1u06Vz;\n\tdkim-atps=neutral", "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org\n (client-ip=209.51.188.17; helo=lists.gnu.org;\n envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n receiver=patchwork.ozlabs.org)" ], "Received": [ "from lists.gnu.org (lists.gnu.org [209.51.188.17])\n\t(using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fN0bV6b2Mz1xxx\n\tfor <incoming@patchwork.ozlabs.org>; Sat, 28 Feb 2026 07:41:10 +1100 (AEDT)", "from localhost ([::1] helo=lists1p.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.90_1)\n\t(envelope-from <qemu-devel-bounces@nongnu.org>)\n\tid 1vw4e2-0001Z6-HU; Fri, 27 Feb 2026 15:41:06 -0500", "from eggs.gnu.org ([2001:470:142:3::10])\n by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)\n (Exim 4.90_1) (envelope-from <chad@jablonski.xyz>)\n id 1vw4dx-0001Lo-Hf\n for qemu-devel@nongnu.org; Fri, 27 Feb 2026 15:41:02 -0500", "from fhigh-a7-smtp.messagingengine.com ([103.168.172.158])\n by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)\n (Exim 4.90_1) (envelope-from <chad@jablonski.xyz>)\n id 1vw4dv-0007Ok-A6\n for qemu-devel@nongnu.org; Fri, 27 Feb 2026 15:41:01 -0500", "from phl-compute-12.internal (phl-compute-12.internal [10.202.2.52])\n by mailfhigh.phl.internal (Postfix) with ESMTP id 3076514001D8;\n Fri, 27 Feb 2026 15:40:58 -0500 (EST)", "from phl-frontend-03 ([10.202.2.162])\n by phl-compute-12.internal (MEProxy); Fri, 27 Feb 2026 15:40:58 -0500", "by mail.messagingengine.com (Postfix) with ESMTPA; Fri,\n 27 Feb 2026 15:40:57 -0500 (EST)", "from localhost (chomposaur [local])\n by chomposaur (OpenSMTPD) with ESMTPA id 10ff023b;\n Fri, 27 Feb 2026 20:40:55 +0000 (UTC)" ], "DKIM-Signature": [ "v=1; a=rsa-sha256; c=relaxed/relaxed; d=jablonski.xyz;\n h=cc:cc:content-transfer-encoding:content-type:date:date:from\n :from:in-reply-to:in-reply-to:message-id:mime-version:references\n :reply-to:subject:subject:to:to; s=fm2; t=1772224858; x=\n 1772311258; bh=laB0U4bo8HCPOWBM9uXAA+xB62yuJOctU/qX8DNsXjM=; b=L\n gTz5wMcgKVaVRu144xBtSqBr0/P4+3BVHsyWbx3PhSj6+nDddjTN7NqDQzIR6uEF\n 5Jajs85EfE7pwGizyhIR/YNjUIPBHp/D9WQfGTJn1oat3T0KHo1ExJ6GdSJJrWrr\n VjyG/eioIK4Amhd9ZCO+Jm9XNkzhKJEgzarLXyHzGhQxC/mhpHTRXpjhDpwVS3L9\n c1vnMwVeL8kRJDt0VGxpUjOMylcHGDmydD//4RtFKOG6JLvX0YMAv42cbdlIv6Tb\n CVptkn9F5/1HHXVetvMrtHVy5QcE2tQ8NEASZ/0akODHK1QGleHtZzaqiER5phaV\n 2LuQ4oxdiJaZtAskVStrw==", "v=1; a=rsa-sha256; c=relaxed/relaxed; d=\n messagingengine.com; h=cc:cc:content-transfer-encoding\n :content-type:date:date:feedback-id:feedback-id:from:from\n :in-reply-to:in-reply-to:message-id:mime-version:references\n :reply-to:subject:subject:to:to:x-me-proxy:x-me-sender\n :x-me-sender:x-sasl-enc; s=fm3; t=1772224858; x=1772311258; bh=l\n aB0U4bo8HCPOWBM9uXAA+xB62yuJOctU/qX8DNsXjM=; b=iv1u06VzLB9m5Vxg4\n d/8rub181c4l9ZJCppss9YrbA6wj1IQuCqaJ3pzFECcf3WBJyaimy0HkoYcGHdxg\n t4nf+X62/9tA570LJH371IXau1M//hDUD2xZM7uCyK8hTb+VsiDzn/7/YdIJZb8x\n V98Pg1sEcd0ulOXM4FCCzv2D0IZtUh2i7oft4SMkJqew07g65x5fQzqurqCXCga9\n y5tBlq8H6+xLImnMpWPsrnnAU/NzAu6X39Nj7oYycUw9Te86MoL1G8NNiyVJqDZp\n QIn6w7kpXcKgTUU+K2XZStFL3zi34brKman8xOfP+zkT8V5DfinaogCVApY7K5x+\n b2v4A==" ], "X-ME-Sender": "<xms:WQGiafz7FiRaPLcNQ_Hgafgjv3Uo06ns7bP-MJN9LOooO_08Plj-cA>\n <xme:WQGiaeKYqvOldae21nz5wguCyskQrHD7jfHL0zDhmckJb09soLBMWEXdP-bYFXVJ_\n 6NgGDd2Ygto6JUjQOH9NOnP4HOg-Dj2Db3nLgZs7BhZFWh5Wil_IWod>", "X-ME-Received": "\n <xmr:WQGiaRq3aJSSjNrVVTCX5BL31iPLBRjyg26655rrMs1pSqMrINHDDAsY1Osh>", "X-ME-Proxy-Cause": "\n gggruggvucftvghtrhhoucdtuddrgeefgedrtddtgddvgeelleelucetufdoteggodetrf\n dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu\n rghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnegfrh\n hlucfvnfffucdljedtmdenucfjughrpefhvfevufffkffojghfggfgsedtkeertdertddt\n necuhfhrohhmpeevhhgrugculfgrsghlohhnshhkihcuoegthhgrugesjhgrsghlohhnsh\n hkihdrgiihiieqnecuggftrfgrthhtvghrnhepgfeiteejhfelheefieetjefgleejfffh\n ueffvdduieejgfeuueeuvddvkeejhfelnecuvehluhhsthgvrhfuihiivgeptdenucfrrg\n hrrghmpehmrghilhhfrhhomheptghhrggusehjrggslhhonhhskhhirdighiiipdhnsggp\n rhgtphhtthhopeehpdhmohguvgepshhmthhpohhuthdprhgtphhtthhopegthhgrugesjh\n grsghlohhnshhkihdrgiihiidprhgtphhtthhopehmrghrtggrnhgurhgvrdhluhhrvggr\n uhesrhgvughhrghtrdgtohhmpdhrtghpthhtohepkhhrrgigvghlsehrvgguhhgrthdrtg\n homhdprhgtphhtthhopegsrghlrghtohhnsegvihhkrdgsmhgvrdhhuhdprhgtphhtthho\n pehqvghmuhdquggvvhgvlhesnhhonhhgnhhurdhorhhg", "X-ME-Proxy": "<xmx:WgGiaVJ8sCLRdAl8iLnH7qU1pn07VoUHDlmO5CrFabcdfYf2gWIueA>\n <xmx:WgGiaeRXhEHWJgiz40hW1EDOlARnIL4gPxGB2Me4dq3cdhmwRc1EqA>\n <xmx:WgGiacudfI4wCKcWTjp_CP7Gi2HZpUHu0Ht7FfKoJFT-eO8nHR90lw>\n <xmx:WgGiaXbZMHjKGdbKW1qsnxQIwnSbHHNRTANVjBxeiRpOq0_w21QiQw>\n <xmx:WgGiaVkZqoL6_PwACZQCWbE7POW2C-Za8wr6EB6vwee2imveCsuPiK-m>", "Feedback-ID": "ib26944c1:Fastmail", "From": "Chad Jablonski <chad@jablonski.xyz>", "To": "qemu-devel@nongnu.org", "Cc": "BALATON Zoltan <balaton@eik.bme.hu>, Gerd Hoffmann <kraxel@redhat.com>,\n\t=?utf-8?q?Marc-Andr=C3=A9_Lureau?= <marcandre.lureau@redhat.com>,\n Chad Jablonski <chad@jablonski.xyz>", "Subject": "[PATCH v9 01/18] ati-vga: Fix framebuffer mapping by using\n hardware-correct aperture sizes", "Date": "Fri, 27 Feb 2026 15:39:27 -0500", "Message-ID": "<20260227203944.746471-2-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": "8bit", "Received-SPF": "pass client-ip=103.168.172.158;\n envelope-from=chad@jablonski.xyz;\n 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,\n DKIM_VALID=-0.1,\n DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FROM_SUSPICIOUS_NTLD=0.5,\n PDS_OTHER_BAD_TLD=1.999, RCVD_IN_DNSWL_LOW=-0.7,\n RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.706,\n RCVD_IN_VALIDITY_RPBL_BLOCKED=0.401,\n SPF_HELO_PASS=-0.001, SPF_PASS=-0.001,\n 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 <qemu-devel.nongnu.org>", "List-Unsubscribe": "<https://lists.nongnu.org/mailman/options/qemu-devel>,\n <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>", "List-Archive": "<https://lists.nongnu.org/archive/html/qemu-devel>", "List-Post": "<mailto:qemu-devel@nongnu.org>", "List-Help": "<mailto:qemu-devel-request@nongnu.org?subject=help>", "List-Subscribe": "<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n <mailto:qemu-devel-request@nongnu.org?subject=subscribe>", "Errors-To": "qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org", "Sender": "qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org" }, "content": "Rage 128 cards always request 64MB for their linear (framebuffer)\naperture and R100 cards always request 128MB. This is regardless\nof the amount of physical VRAM on the board. The following are results\nfrom real hardware tests:\n\nCard VRAM PCI BAR0 CONFIG_MEMSIZE CONFIG_APER_SIZE AGP_APER_OFFSET\n----------------------- ---- -------- -------------- ---------------- ---------------\nRage 128 Pro Ultra TF 32MB 64MB 0x02000000 0x02000000 0x02000000\nRage 128 RF/SG AGP 16MB 64MB 0x01000000 0x02000000 0x02000000\nRadeon R100 QD [Radeon 7200] 64MB 128MB 0x04000000 0x04000000 N/A\nRadeon RV100 QY [Radeon 7000/VE] 32MB 128MB 0x02000000 0x04000000 N/A\n\nPreviously the linear aperture (BAR0) would match the VRAM size.\nThis discrepancy caused issues with the X.org and XFree86 r128 drivers.\nThese drivers apply a mask of 0xfc000000 (2^26 = 64MB) to the linear\naperture address. If that address is not on a 64MB boundary the\nframebuffer points to an incorrect memory location.\n\nTesting shows that the Radeon R100 also has a BAR0 larger than VRAM\n(128MB in this case) and the X.org radeon driver also masks to 64MB.\n\nFor Rage 128, CONFIG_APER_SIZE also differs from the previous value and\nthe behavior stated in the documentation. The Rage 128 register guide\nstates that it should contain the size of the VRAM + AGP memory. The cards\ntested above show that this isn't the case. These tests also included\nenabling/disabling AGP with 8MB of memory. It didn't change the\ncontents of CONFIG_APER_SIZE.\n\nFor both Rage 128 and R100 the CONFIG_APER_SIZE is half of the PCI BAR0 size.\n\nSigned-off-by: Chad Jablonski <chad@jablonski.xyz>\nReviewed-by: BALATON Zoltan <balaton@eik.bme.hu>\n---\n hw/display/ati.c | 16 ++++++++++++++--\n hw/display/ati_int.h | 5 +++++\n 2 files changed, 19 insertions(+), 2 deletions(-)", "diff": "diff --git a/hw/display/ati.c b/hw/display/ati.c\nindex e9c3ad2cd1..8438a77de0 100644\n--- a/hw/display/ati.c\n+++ b/hw/display/ati.c\n@@ -361,7 +361,7 @@ static uint64_t ati_mm_read(void *opaque, hwaddr addr, unsigned int size)\n PCI_BASE_ADDRESS_0, size) & 0xfffffff0;\n break;\n case CONFIG_APER_SIZE:\n- val = s->vga.vram_size / 2;\n+ val = memory_region_size(&s->linear_aper) / 2;\n break;\n case CONFIG_REG_1_BASE:\n val = pci_default_read_config(&s->dev,\n@@ -952,6 +952,7 @@ static void ati_vga_realize(PCIDevice *dev, Error **errp)\n {\n ATIVGAState *s = ATI_VGA(dev);\n VGACommonState *vga = &s->vga;\n+ uint64_t aper_size;\n \n #ifndef CONFIG_PIXMAN\n if (s->use_pixman != 0) {\n@@ -1011,7 +1012,18 @@ static void ati_vga_realize(PCIDevice *dev, Error **errp)\n /* io space is alias to beginning of mmregs */\n memory_region_init_alias(&s->io, OBJECT(s), \"ati.io\", &s->mm, 0, 0x100);\n \n- pci_register_bar(dev, 0, PCI_BASE_ADDRESS_MEM_PREFETCH, &vga->vram);\n+ /*\n+ * The framebuffer is at the beginning of the linear aperture. For\n+ * Rage128 the upper half of the aperture is reserved for an AGP\n+ * window (which we do not emulate.)\n+ */\n+ aper_size = s->dev_id == PCI_DEVICE_ID_ATI_RAGE128_PF ?\n+ ATI_RAGE128_LINEAR_APER_SIZE : ATI_R100_LINEAR_APER_SIZE;\n+ memory_region_init(&s->linear_aper, OBJECT(dev), \"ati-linear-aperture0\",\n+ aper_size);\n+ memory_region_add_subregion(&s->linear_aper, 0, &vga->vram);\n+\n+ pci_register_bar(dev, 0, PCI_BASE_ADDRESS_MEM_PREFETCH, &s->linear_aper);\n pci_register_bar(dev, 1, PCI_BASE_ADDRESS_SPACE_IO, &s->io);\n pci_register_bar(dev, 2, PCI_BASE_ADDRESS_SPACE_MEMORY, &s->mm);\n \ndiff --git a/hw/display/ati_int.h b/hw/display/ati_int.h\nindex f5a47b82b0..708cc1dd3a 100644\n--- a/hw/display/ati_int.h\n+++ b/hw/display/ati_int.h\n@@ -10,6 +10,7 @@\n #define ATI_INT_H\n \n #include \"qemu/timer.h\"\n+#include \"qemu/units.h\"\n #include \"hw/pci/pci_device.h\"\n #include \"hw/i2c/bitbang_i2c.h\"\n #include \"vga_int.h\"\n@@ -29,6 +30,9 @@\n /* Radeon RV100 (VE) */\n #define PCI_DEVICE_ID_ATI_RADEON_QY 0x5159\n \n+#define ATI_RAGE128_LINEAR_APER_SIZE (64 * MiB)\n+#define ATI_R100_LINEAR_APER_SIZE (128 * MiB)\n+\n #define TYPE_ATI_VGA \"ati-vga\"\n OBJECT_DECLARE_SIMPLE_TYPE(ATIVGAState, ATI_VGA)\n \n@@ -97,6 +101,7 @@ struct ATIVGAState {\n QEMUCursor *cursor;\n QEMUTimer vblank_timer;\n bitbang_i2c_interface bbi2c;\n+ MemoryRegion linear_aper;\n MemoryRegion io;\n MemoryRegion mm;\n ATIVGARegs regs;\n", "prefixes": [ "v9", "01/18" ] }