get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 2222064,
    "url": "http://patchwork.ozlabs.org/api/1.1/patches/2222064/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20260410183249.4046456-2-peter.maydell@linaro.org/",
    "project": {
        "id": 14,
        "url": "http://patchwork.ozlabs.org/api/1.1/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": ""
    },
    "msgid": "<20260410183249.4046456-2-peter.maydell@linaro.org>",
    "date": "2026-04-10T18:32:48",
    "name": "[1/2] hw/display/cirrus_vga: Fix packed-24 color-expansion transparent pattern fills",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "62f9bf4f23a3b0371f8128fe0da99cf7679d15ca",
    "submitter": {
        "id": 5111,
        "url": "http://patchwork.ozlabs.org/api/1.1/people/5111/?format=api",
        "name": "Peter Maydell",
        "email": "peter.maydell@linaro.org"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20260410183249.4046456-2-peter.maydell@linaro.org/mbox/",
    "series": [
        {
            "id": 499492,
            "url": "http://patchwork.ozlabs.org/api/1.1/series/499492/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/list/?series=499492",
            "date": "2026-04-10T18:32:49",
            "name": "hw/display/cirrus_vga: Fix packed-24 color-expansion ops",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/499492/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2222064/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2222064/checks/",
    "tags": {},
    "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=linaro.org header.i=@linaro.org header.a=rsa-sha256\n header.s=google header.b=X9BMtu1n;\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 (lists1p.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 4fsln10Tjrz20HT\n\tfor <incoming@patchwork.ozlabs.org>; Sat, 11 Apr 2026 04:33:39 +1000 (AEST)",
            "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 1wBGf5-0003De-MS; Fri, 10 Apr 2026 14:32:59 -0400",
            "from eggs.gnu.org ([2001:470:142:3::10])\n by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)\n (Exim 4.90_1) (envelope-from <peter.maydell@linaro.org>)\n id 1wBGf2-0003D7-Un\n for qemu-devel@nongnu.org; Fri, 10 Apr 2026 14:32:57 -0400",
            "from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c])\n by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)\n (Exim 4.90_1) (envelope-from <peter.maydell@linaro.org>)\n id 1wBGf0-000521-QP\n for qemu-devel@nongnu.org; Fri, 10 Apr 2026 14:32:56 -0400",
            "by mail-wr1-x42c.google.com with SMTP id\n ffacd0b85a97d-43cf73bbfbdso1447416f8f.1\n for <qemu-devel@nongnu.org>; Fri, 10 Apr 2026 11:32:52 -0700 (PDT)",
            "from lanath.. (wildly.archaic.org.uk. [81.2.115.145])\n by smtp.gmail.com with ESMTPSA id\n ffacd0b85a97d-43d63e46a85sm9344714f8f.24.2026.04.10.11.32.50\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Fri, 10 Apr 2026 11:32:51 -0700 (PDT)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=linaro.org; s=google; t=1775845972; x=1776450772; darn=nongnu.org;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:from:to:cc:subject:date\n :message-id:reply-to;\n bh=SU2AVvFa5Q7oPg8IgegmSYKlHHXfypWTPcMMS/P4M7M=;\n b=X9BMtu1nLCurOHOTC8wC8QXT4pHz5/6/u4ubtxKPV9YO5LqaI96DuuOv7GV0oQPBHV\n NHr3Rze+/egdHI7uyZXmCbTXE70C3nPaOqTF92cWxklq82lsqd3noZ5/wQmPyvCy53jW\n AHv69x1MTo+Q6g8R+6BHWDAsgx1exgtqYHD6lSHCVbzIXYHERn0M9hl+gTM3SNzHrJ1l\n zJ5pcjEJel7J/g4vfTwGKC2EQvGlWOzOmD/chltMzBK/bjbNBaFkjZCpCID6ckqRiRht\n C6UOkliIrEptRNMGmCs9krUWljz06tVJ4TtiZIdS9TRm42P0tps5TidjiyI0ppudGWRI\n 5kGw==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1775845972; x=1776450772;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from\n :to:cc:subject:date:message-id:reply-to;\n bh=SU2AVvFa5Q7oPg8IgegmSYKlHHXfypWTPcMMS/P4M7M=;\n b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Dc\n yux0LUZzu15URhgeJKYM6VcI0+T+Geu/9gXw9C1OA==",
        "X-Received": "by 2002:a05:6000:24c2:b0:43b:8f30:39bb with SMTP id\n ffacd0b85a97d-43d642ab9a7mr6288988f8f.24.1775845971658;\n Fri, 10 Apr 2026 11:32:51 -0700 (PDT)",
        "From": "Peter Maydell <peter.maydell@linaro.org>",
        "To": "qemu-devel@nongnu.org",
        "Cc": "Gerd Hoffmann <kraxel@redhat.com>",
        "Subject": "[PATCH 1/2] hw/display/cirrus_vga: Fix packed-24 color-expansion\n transparent pattern fills",
        "Date": "Fri, 10 Apr 2026 19:32:48 +0100",
        "Message-ID": "<20260410183249.4046456-2-peter.maydell@linaro.org>",
        "X-Mailer": "git-send-email 2.43.0",
        "In-Reply-To": "<20260410183249.4046456-1-peter.maydell@linaro.org>",
        "References": "<20260410183249.4046456-1-peter.maydell@linaro.org>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Received-SPF": "pass client-ip=2a00:1450:4864:20::42c;\n envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x42c.google.com",
        "X-Spam_score_int": "-20",
        "X-Spam_score": "-2.1",
        "X-Spam_bar": "--",
        "X-Spam_report": "(-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,\n DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,\n RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001,\n SPF_PASS=-0.001 autolearn=ham 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": "The Cirrus Logic VGA card has \"pattern fill\" blit modes where it\nrepeatedly copies an 8x8 source pattern to the display.  For the\n\"color expansion\" subtype of these, the source pixel format is an 8x8\nmonochrome bitmap, and the destination can be any of 8, 16, 24 or\n32bpp.  We implemented these wrong for the 24bpp case, in a way that\nresults in a complaint from the undefined-behavior sanitizer about a\nshift by a negative value.\n\nFor these pattern fills, the GR2F register includes a field which\nspecifies how much to skip at the start of each scanline.  In the 8,\n16 and 32 bit cases, this field is 3 bits and is a count of pixels to\nskip.  We get this case right.  However, for the 24 bit case, the\nfield is 5 bits and is a count of destination bytes to skip.  We\ntried to add support for 24-bits in commit ad81218e40e27 (\"depth=24\nwrite mask fix (Volker Ruppert)\") in 2005.  However we got this\nwrong, because when we need to skip, for example, 30 bytes in the\ndestination, this is 10 input pixels but the whole pattern is only 8\npixels wide, and we ended up with a negative bitpos for the first bit\nto use in the pattern.\n\nFix the bug by masking srcskipleft in the 24-bit case so that it\ncorrectly gives the first pixel to use in the pattern even if we skip\nso many pixels that we have wrapped around to what would have been\nthe second copy of the pattern to the destination.\n\nThis patch was produced based on the information in the CL-GD5446\nTechnical Reference Manual, specifically sections 5.8 \"GR2F: BLT\nDestination Left-Side Clipping\" and 9.4.8 \"Pattern Fills\".\n\nCc: qemu-stable@nongnu.org\nResolves: https://gitlab.com/qemu-project/qemu/-/work_items/3377\nFixes: ad81218e40e27 (\"depth=24 write mask fix (Volker Ruppert)\")\nSigned-off-by: Peter Maydell <peter.maydell@linaro.org>\n---\n hw/display/cirrus_vga_rop2.h | 21 ++++++++++++++++++++-\n 1 file changed, 20 insertions(+), 1 deletion(-)",
    "diff": "diff --git a/hw/display/cirrus_vga_rop2.h b/hw/display/cirrus_vga_rop2.h\nindex b208b7348a..8be35ec6e2 100644\n--- a/hw/display/cirrus_vga_rop2.h\n+++ b/hw/display/cirrus_vga_rop2.h\n@@ -191,10 +191,29 @@ glue(glue(glue(cirrus_colorexpand_pattern_transp_, ROP_NAME), _),DEPTH)\n     int x, y, bitpos, pattern_y;\n     unsigned int bits, bits_xor;\n     unsigned int col;\n+\n+    /*\n+     * Copy from an 8x8 monochrome pattern with color expansion.\n+     */\n+\n #if DEPTH == 24\n+    /*\n+     * For packed-24 modes, GR2F bits [4:0] are a count of destination\n+     * bytes to be suppressed for each scanline, which we keep in\n+     * dstskipleft. Our srcskipleft is the number of pixels to skip\n+     * within the 8x8 source pattern to match up with that number\n+     * of suppressed bytes. As the pattern repeats every 8 bits we\n+     * take the number of pixels mod 8.\n+     */\n     int dstskipleft = s->vga.gr[0x2f] & 0x1f;\n-    int srcskipleft = dstskipleft / 3;\n+    int srcskipleft = (dstskipleft / 3) & 0x7;\n #else\n+    /*\n+     * In all other modes, GR2F bits [2:0] are a count of how many\n+     * destination pixels to suppress for each scanline, which is our\n+     * srcskipleft. We get dstskipleft, the number of bytes to skip,\n+     * by multiplying this by the bytes-per-pixel.\n+     */\n     int srcskipleft = s->vga.gr[0x2f] & 0x07;\n     int dstskipleft = srcskipleft * (DEPTH / 8);\n #endif\n",
    "prefixes": [
        "1/2"
    ]
}