get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/2202584/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 2202584,
    "url": "http://patchwork.ozlabs.org/api/patches/2202584/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20260227203944.746471-13-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-13-chad@jablonski.xyz>",
    "list_archive_url": null,
    "date": "2026-02-27T20:39:38",
    "name": "[v9,12/18] ati-vga: Extract setup_2d_blt_ctx from ati_2d_blt",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "177eac42e5bd65f93a0281ab18226fffc8435964",
    "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-13-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/2202584/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2202584/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=V9/xn5cE;\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=RgEkePhm;\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 4fN0c40q8Dz1xyX\n\tfor <incoming@patchwork.ozlabs.org>; Sat, 28 Feb 2026 07:41:40 +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 1vw4e6-00025l-Pj; Fri, 27 Feb 2026 15:41:10 -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 1vw4e2-0001Vq-2i\n for qemu-devel@nongnu.org; Fri, 27 Feb 2026 15:41:06 -0500",
            "from fout-a1-smtp.messagingengine.com ([103.168.172.144])\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 1vw4dz-0007QJ-7g\n for qemu-devel@nongnu.org; Fri, 27 Feb 2026 15:41:05 -0500",
            "from phl-compute-12.internal (phl-compute-12.internal [10.202.2.52])\n by mailfout.phl.internal (Postfix) with ESMTP id 1AFA8EC0642;\n Fri, 27 Feb 2026 15:41:01 -0500 (EST)",
            "from phl-frontend-03 ([10.202.2.162])\n by phl-compute-12.internal (MEProxy); Fri, 27 Feb 2026 15:41:01 -0500",
            "by mail.messagingengine.com (Postfix) with ESMTPA; Fri,\n 27 Feb 2026 15:41:00 -0500 (EST)",
            "from localhost (chomposaur [local])\n by chomposaur (OpenSMTPD) with ESMTPA id 811b5076;\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=1772224861; x=\n 1772311261; bh=XKA7BDVAEuSkI7Cyv+HPSD9abD9gVHJAjeSHHpT4T3E=; b=V\n 9/xn5cExtFqmIzwe71UGAc+7Cvb+NH9tEMKcJhBgrqARsjumwtQJFyFi+IaamsgN\n RKpE20k9uLq7Y3L+kibhtUYvCqyfqqAe9Fb3plckcFwKzSDIDf0+wr5Wh5sHP+9V\n WGk75+4FuHiUlfT+dq2Gvuet0XogWmqYJilHoNp0XBImn7HGI5/ifi5NAMs8eDrv\n yTH+1N6SOtcXs/FFgC2D2cEwiQGI+/MwtcHddNW1l8JG2pTeAenRWQ870O7APi/a\n Z6MFr8YFBrK7UPBO/pZnGZB8YPGfMDgLMD+Co+DKYpyE6w3K6OMSu591ROhe6mKH\n NppzZmx+j1+4wfKLtwIyg==",
            "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=1772224861; x=1772311261; bh=X\n KA7BDVAEuSkI7Cyv+HPSD9abD9gVHJAjeSHHpT4T3E=; b=RgEkePhmkpJcw7xwB\n H/wjJkjP0VgVEfrfte2JbsmT/OAHUiR5oHVWIxQp3qfa2cxaPYJakavYmkB7T+pe\n Uv7mbZ8wt4etjlFNhw9wO0lNlBrzSmt8LmmJTnjD86qwhgfn7p7S6jOY2AKl7BNU\n DwPfN4Dg2NJcQG8RHQBC071bMICh3//4utNt6h4JEhtmlLGvKyawf1j+jXitAl75\n GkXJBN8W/FfbraVYCgLR8v9z/L754a0Tvf73UnpvUbPNNzBYi6xU0HPE0m/SXE+Y\n cyXK3xCL7LGb9GbFOlvzUvapIaeSi5u9g3+o5hp8gPh75/DaeUE3c8MD7tfKViHK\n Ocuwg=="
        ],
        "X-ME-Sender": "<xms:XQGiaWtfNMcd62x2Uw4QpQPE4-_E4C5aISBunQk2JJDROCtVtUrYFw>\n <xme:XQGiaSWp17psZuSNVxbtk0rmv3q4w_fdMWxXYlf3D7HtyMmdW3zkJXsTujmwGKF3v\n ku0bT6al1gmdOkU5LrYsNv0tTfG5esX5uHFTklL5PL796GOC5cogdk>",
        "X-ME-Received": "\n <xmr:XQGiaaHV-Pa5EgZIZXmRT9TCVzk9Qr90njSxq7Sl9DrQdrGy7BIc6YqxP0g->",
        "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 uhesrhgvughhrghtrdgtohhmpdhrtghpthhtohepsggrlhgrthhonhesvghikhdrsghmvg\n drhhhupdhrtghpthhtohepqhgvmhhuqdguvghvvghlsehnohhnghhnuhdrohhrghdprhgt\n phhtthhopehkrhgrgigvlhesrhgvughhrghtrdgtohhm",
        "X-ME-Proxy": "<xmx:XQGiac3F7st4WWADDzcBbzqTAYFmrJ8sYoTLADt7iZTvcJH8C6vs0g>\n <xmx:XQGiaUMjcq7UADKqOaPAqoWs2WYbugu7FdShpicsVNkL_sYYj1YuFA>\n <xmx:XQGiaT6PB3JbRuErjQdF99QvfZzIhql_UBlb0eD_kbEkm4U0lrqdJQ>\n <xmx:XQGiaW35Sn_K_xzZ_F3o5mf1kYaMP2KDm8yqgCQIGeAAOQ8m9HWdpQ>\n <xmx:XQGiaQxjVRcrAO-rW1tdHsqHaWVoX59GGLejJfiuTkeRcyWsqD0fS_YV>",
        "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 12/18] ati-vga: Extract setup_2d_blt_ctx from ati_2d_blt",
        "Date": "Fri, 27 Feb 2026 15:39:38 -0500",
        "Message-ID": "<20260227203944.746471-13-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.144;\n envelope-from=chad@jablonski.xyz;\n helo=fout-a1-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": "setup_2d_blt_ctx is responsible for knowing how to retrieve the state\nneeded by ati_2d_blt from the registers and assigning it to the ATI2DCtx.\nThis will be useful in a future patch when HOST_DATA needs to make small\nmodifications to the ctx.\n\nSigned-off-by: Chad Jablonski <chad@jablonski.xyz>\nReviewed-by: BALATON Zoltan <balaton@eik.bme.hu>\n---\n hw/display/ati_2d.c | 75 ++++++++++++++++++++++++---------------------\n 1 file changed, 40 insertions(+), 35 deletions(-)",
    "diff": "diff --git a/hw/display/ati_2d.c b/hw/display/ati_2d.c\nindex d43268ba5f..ebcec07334 100644\n--- a/hw/display/ati_2d.c\n+++ b/hw/display/ati_2d.c\n@@ -25,7 +25,7 @@\n  * possible.\n  */\n \n-static int ati_bpp_from_datatype(ATIVGAState *s)\n+static int ati_bpp_from_datatype(const ATIVGAState *s)\n {\n     switch (s->regs.dp_datatype & 0xf) {\n     case 2:\n@@ -80,76 +80,81 @@ static void ati_set_dirty(VGACommonState *vga, const ATI2DCtx *ctx)\n     }\n }\n \n-void ati_2d_blt(ATIVGAState *s)\n+static void setup_2d_blt_ctx(const ATIVGAState *s, ATI2DCtx *ctx)\n {\n-    /* FIXME it is probably more complex than this and may need to be */\n-    /* rewritten but for now as a start just to get some output: */\n-    bool use_pixman_fill = s->use_pixman & BIT(0);\n-    bool use_pixman_blt = s->use_pixman & BIT(1);\n-    ATI2DCtx ctx_;\n-    ATI2DCtx *ctx = &ctx_;\n+    ctx->bpp = ati_bpp_from_datatype(s);\n     ctx->rop3 = s->regs.dp_mix & GMC_ROP3_MASK;\n     ctx->left_to_right = s->regs.dp_cntl & DST_X_LEFT_TO_RIGHT;\n     ctx->top_to_bottom = s->regs.dp_cntl & DST_Y_TOP_TO_BOTTOM;\n     ctx->frgd_clr = s->regs.dp_brush_frgd_clr;\n     ctx->palette = s->vga.palette;\n     ctx->dst_offset = s->regs.dst_offset;\n+    ctx->vram_end = s->vga.vram_ptr + s->vga.vram_size;\n+\n     ctx->dst.width = s->regs.dst_width;\n     ctx->dst.height = s->regs.dst_height;\n     ctx->dst.x = (ctx->left_to_right ?\n                  s->regs.dst_x : s->regs.dst_x + 1 - ctx->dst.width);\n     ctx->dst.y = (ctx->top_to_bottom ?\n                  s->regs.dst_y : s->regs.dst_y + 1 - ctx->dst.height);\n-    ctx->bpp = ati_bpp_from_datatype(s);\n+    ctx->dst_stride = s->regs.dst_pitch;\n+    ctx->dst_bits = s->vga.vram_ptr + s->regs.dst_offset;\n+    if (s->dev_id == PCI_DEVICE_ID_ATI_RAGE128_PF) {\n+        ctx->dst_bits += s->regs.crtc_offset & 0x07ffffff;\n+        ctx->dst_stride *= ctx->bpp;\n+    }\n+\n+    ctx->src.x = (ctx->left_to_right ?\n+                 s->regs.src_x : s->regs.src_x + 1 - ctx->dst.width);\n+    ctx->src.y = (ctx->top_to_bottom ?\n+                 s->regs.src_y : s->regs.src_y + 1 - ctx->dst.height);\n+    ctx->src_stride = s->regs.src_pitch;\n+    ctx->src_bits = s->vga.vram_ptr + s->regs.src_offset;\n+    if (s->dev_id == PCI_DEVICE_ID_ATI_RAGE128_PF) {\n+        ctx->src_bits += s->regs.crtc_offset & 0x07ffffff;\n+        ctx->src_stride *= ctx->bpp;\n+    }\n+    DPRINTF(\"%d %d %d, %d %d %d, (%d,%d) -> (%d,%d) %dx%d %c %c\\n\",\n+            s->regs.src_offset, s->regs.dst_offset, s->regs.default_offset,\n+            ctx->src_stride, ctx->dst_stride, s->regs.default_pitch,\n+            ctx->src.x, ctx->src.y, ctx->dst.x, ctx->dst.y,\n+            ctx->dst.width, ctx->dst.height,\n+            (ctx->left_to_right ? '>' : '<'),\n+            (ctx->top_to_bottom ? 'v' : '^'));\n+}\n+\n+void ati_2d_blt(ATIVGAState *s)\n+{\n+    /* FIXME it is probably more complex than this and may need to be */\n+    /* rewritten but for now as a start just to get some output: */\n+    bool use_pixman_fill = s->use_pixman & BIT(0);\n+    bool use_pixman_blt = s->use_pixman & BIT(1);\n+    ATI2DCtx ctx_;\n+    ATI2DCtx *ctx = &ctx_;\n+    setup_2d_blt_ctx(s, ctx);\n     if (!ctx->bpp) {\n         qemu_log_mask(LOG_GUEST_ERROR, \"Invalid bpp\\n\");\n         return;\n     }\n-    ctx->dst_stride = s->regs.dst_pitch;\n     if (!ctx->dst_stride) {\n         qemu_log_mask(LOG_GUEST_ERROR, \"Zero dest pitch\\n\");\n         return;\n     }\n-    ctx->dst_bits = s->vga.vram_ptr + ctx->dst_offset;\n-\n-    if (s->dev_id == PCI_DEVICE_ID_ATI_RAGE128_PF) {\n-        ctx->dst_bits += s->regs.crtc_offset & 0x07ffffff;\n-        ctx->dst_stride *= ctx->bpp;\n-    }\n     int dst_stride_words = ctx->dst_stride / sizeof(uint32_t);\n-    ctx->vram_end = s->vga.vram_ptr + s->vga.vram_size;\n     if (ctx->dst.x > 0x3fff || ctx->dst.y > 0x3fff\n         || ctx->dst_bits >= ctx->vram_end || ctx->dst_bits + ctx->dst.x\n          + (ctx->dst.y + ctx->dst.height) * ctx->dst_stride >= ctx->vram_end) {\n         qemu_log_mask(LOG_UNIMP, \"blt outside vram not implemented\\n\");\n         return;\n     }\n-    DPRINTF(\"%d %d %d, %d %d %d, (%d,%d) -> (%d,%d) %dx%d %c %c\\n\",\n-            s->regs.src_offset, ctx->dst_offset, s->regs.default_offset,\n-            ctx->src_stride, ctx->dst_stride, s->regs.default_pitch,\n-            ctx->src.x, ctx->src.y, ctx->dst.x, ctx->dst.y,\n-            ctx->dst.width, ctx->dst.height,\n-            (ctx->left_to_right ? '>' : '<'),\n-            (ctx->top_to_bottom ? 'v' : '^'));\n     switch (ctx->rop3) {\n     case ROP3_SRCCOPY:\n     {\n         bool fallback = false;\n-        ctx->src.x = (ctx->left_to_right ?\n-                     s->regs.src_x : s->regs.src_x + 1 - ctx->dst.width);\n-        ctx->src.y = (ctx->top_to_bottom ?\n-                     s->regs.src_y : s->regs.src_y + 1 - ctx->dst.height);\n-        ctx->src_stride = s->regs.src_pitch;\n         if (!ctx->src_stride) {\n             qemu_log_mask(LOG_GUEST_ERROR, \"Zero source pitch\\n\");\n             return;\n         }\n-        ctx->src_bits = s->vga.vram_ptr + s->regs.src_offset;\n-\n-        if (s->dev_id == PCI_DEVICE_ID_ATI_RAGE128_PF) {\n-            ctx->src_bits += s->regs.crtc_offset & 0x07ffffff;\n-            ctx->src_stride *= ctx->bpp;\n-        }\n         int src_stride_words = ctx->src_stride / sizeof(uint32_t);\n         if (ctx->src.x > 0x3fff || ctx->src.y > 0x3fff\n             || ctx->src_bits >= ctx->vram_end\n",
    "prefixes": [
        "v9",
        "12/18"
    ]
}