get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 813661,
    "url": "http://patchwork.ozlabs.org/api/patches/813661/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/uboot/patch/20170913221227.21091-4-robdclark@gmail.com/",
    "project": {
        "id": 18,
        "url": "http://patchwork.ozlabs.org/api/projects/18/?format=api",
        "name": "U-Boot",
        "link_name": "uboot",
        "list_id": "u-boot.lists.denx.de",
        "list_email": "u-boot@lists.denx.de",
        "web_url": null,
        "scm_url": null,
        "webscm_url": null,
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<20170913221227.21091-4-robdclark@gmail.com>",
    "list_archive_url": null,
    "date": "2017-09-13T22:12:22",
    "name": "[U-Boot,3/3] dm: video: Add color ANSI escape sequence support",
    "commit_ref": "703d885c228074fb24b4d51673a9422fac49fa9b",
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "89ff956807a2b75fda17d81c89895798760bf02f",
    "submitter": {
        "id": 18760,
        "url": "http://patchwork.ozlabs.org/api/people/18760/?format=api",
        "name": "Rob Clark",
        "email": "robdclark@gmail.com"
    },
    "delegate": {
        "id": 1700,
        "url": "http://patchwork.ozlabs.org/api/users/1700/?format=api",
        "username": "ag",
        "first_name": "Anatolij",
        "last_name": "Gustschin",
        "email": "agust@denx.de"
    },
    "mbox": "http://patchwork.ozlabs.org/project/uboot/patch/20170913221227.21091-4-robdclark@gmail.com/mbox/",
    "series": [
        {
            "id": 2992,
            "url": "http://patchwork.ozlabs.org/api/series/2992/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/uboot/list/?series=2992",
            "date": "2017-09-13T22:12:21",
            "name": "dm: video: enhancements for Shell.efi",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/2992/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/813661/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/813661/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<u-boot-bounces@lists.denx.de>",
        "X-Original-To": "incoming@patchwork.ozlabs.org",
        "Delivered-To": "patchwork-incoming@bilbo.ozlabs.org",
        "Authentication-Results": [
            "ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=lists.denx.de\n\t(client-ip=81.169.180.215; helo=lists.denx.de;\n\tenvelope-from=u-boot-bounces@lists.denx.de;\n\treceiver=<UNKNOWN>)",
            "ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"KNJLY0Bz\"; dkim-atps=neutral"
        ],
        "Received": [
            "from lists.denx.de (dione.denx.de [81.169.180.215])\n\tby ozlabs.org (Postfix) with ESMTP id 3xsx4h0FRTz9t0F\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu, 14 Sep 2017 08:22:59 +1000 (AEST)",
            "by lists.denx.de (Postfix, from userid 105)\n\tid 69C28C21EBC; Wed, 13 Sep 2017 22:18:28 +0000 (UTC)",
            "from lists.denx.de (localhost [IPv6:::1])\n\tby lists.denx.de (Postfix) with ESMTP id 9A603C22732;\n\tWed, 13 Sep 2017 22:18:25 +0000 (UTC)",
            "by lists.denx.de (Postfix, from userid 105)\n\tid 04524C22617; Wed, 13 Sep 2017 22:12:48 +0000 (UTC)",
            "from mail-qk0-f196.google.com (mail-qk0-f196.google.com\n\t[209.85.220.196])\n\tby lists.denx.de (Postfix) with ESMTPS id CE13BC2245A\n\tfor <u-boot@lists.denx.de>; Wed, 13 Sep 2017 22:12:41 +0000 (UTC)",
            "by mail-qk0-f196.google.com with SMTP id o77so953535qke.2\n\tfor <u-boot@lists.denx.de>; Wed, 13 Sep 2017 15:12:41 -0700 (PDT)",
            "from localhost ([2601:184:4780:aac0:25f8:dd96:a084:785a])\n\tby smtp.gmail.com with ESMTPSA id\n\ta22sm7713848qte.32.2017.09.13.15.12.39\n\t(version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256);\n\tWed, 13 Sep 2017 15:12:39 -0700 (PDT)"
        ],
        "X-Spam-Checker-Version": "SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de",
        "X-Spam-Level": "",
        "X-Spam-Status": "No, score=-0.0 required=5.0 tests=FREEMAIL_FROM,\n\tRCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,\n\tT_DKIM_INVALID\n\tautolearn=unavailable autolearn_force=no version=3.4.0",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;\n\th=from:to:cc:subject:date:message-id:in-reply-to:references;\n\tbh=p7enxtz18WXGN7EXeQYhuvP58LRIwvSyBPEQDaCdY/Q=;\n\tb=KNJLY0Bz9IN2/45ShxjPTEXqpilWZFjthqklpPTh/qTenoMmdM6xJf0qiSKpb2Avt8\n\tKBJm0Q7xIPUVyEoA4I6NjbAkmm/h1bJopHouMgADrXbm5uLfmNvv1xvMNUfu4KdLbfdq\n\t8H93dekuZHnuaNN31z7UZSFPkorVTSLKSRywIrnhSOWe8Z2DcLEATmv99hXnxsY1Ro9v\n\tNghuw1dPNsSp1pFJ+T+oAOPBC1VT1b/7OZ4/pAndY3UASzLvPjnmtmn4QyA3DLr/oHuy\n\tOnDlyonX4/5lqvWX1ZntdSXEqnuTNdLrYIoqXGZjt+uPkePwSlqYAqbQkMDum5qSQfbw\n\tjQgg==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n\t:references;\n\tbh=p7enxtz18WXGN7EXeQYhuvP58LRIwvSyBPEQDaCdY/Q=;\n\tb=Z81a7Dw4lp/Lc7vsEcaEcelyFVfuFeYB5WvaUOVO/DyIhItTE3XeAua9O4yiv3zTeu\n\tDDfHsV4uJN0HQJpeKlsqO+xWwFs7PgGbVhtOhYMdLGdWKkR12f53FYlR5rYoQmZkDz5Q\n\tDC20ww0QMkd5beIjXqkt4ZUkcTGQ0EEZrKUEWLlt+lxC66ymimDH9Jc5hpSRhdIq6wHL\n\tw9DNEWZjqK43XMi9AFsbN05wo4sCOTzkjCFwdFkgE38DYQ3XuQ6SM97PqI9qKqPqY8yK\n\trxcgaBWcF92SbYlQ4X8KCPkyk81UIBrTBQOt7Gdg5maEzb0jYFPIi2VsG5dMGpwQV+ge\n\t0r8A==",
        "X-Gm-Message-State": "AHPjjUgCYTZgXt8ClaaPb2GLzkajYBqLmGsoUBm+88n89NjRFkPdvwyG\n\tW3O4HlK4wOgK2XUljUA=",
        "X-Google-Smtp-Source": "AOwi7QDk16Fyp+wbONdZiDgxq8obCcfsCIctJgL2rmReWZphwUnvcQieZ+phdqYTUolxVZ7g21YPdQ==",
        "X-Received": "by 10.233.220.199 with SMTP id q190mr31466qkf.268.1505340760550; \n\tWed, 13 Sep 2017 15:12:40 -0700 (PDT)",
        "From": "Rob Clark <robdclark@gmail.com>",
        "To": "U-Boot Mailing List <u-boot@lists.denx.de>",
        "Date": "Wed, 13 Sep 2017 18:12:22 -0400",
        "Message-Id": "<20170913221227.21091-4-robdclark@gmail.com>",
        "X-Mailer": "git-send-email 2.13.5",
        "In-Reply-To": "<20170913221227.21091-1-robdclark@gmail.com>",
        "References": "<20170913221227.21091-1-robdclark@gmail.com>",
        "Subject": "[U-Boot] [PATCH 3/3] dm: video: Add color ANSI escape sequence\n\tsupport",
        "X-BeenThere": "u-boot@lists.denx.de",
        "X-Mailman-Version": "2.1.18",
        "Precedence": "list",
        "List-Id": "U-Boot discussion <u-boot.lists.denx.de>",
        "List-Unsubscribe": "<https://lists.denx.de/options/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=unsubscribe>",
        "List-Archive": "<http://lists.denx.de/pipermail/u-boot/>",
        "List-Post": "<mailto:u-boot@lists.denx.de>",
        "List-Help": "<mailto:u-boot-request@lists.denx.de?subject=help>",
        "List-Subscribe": "<https://lists.denx.de/listinfo/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=subscribe>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain; charset=\"utf-8\"",
        "Content-Transfer-Encoding": "base64",
        "Errors-To": "u-boot-bounces@lists.denx.de",
        "Sender": "\"U-Boot\" <u-boot-bounces@lists.denx.de>"
    },
    "content": "Note that this doesn't differentiate (due to lack of information in\nvideo_priv) between different possible component orders for 32bpp.\nBut the main user at this point is efi_loader, and GOP expects xBGR\nso any video drivers that this is incorrect for already have problems.\n(Also, conveniently, this matches what simple-framebuffer bindings\nexpect for kernels that use the simple-framebuffer DT binding to\ntake over the bootloader display.)\n\nSigned-off-by: Rob Clark <robdclark@gmail.com>\n---\n drivers/video/vidconsole-uclass.c | 94 +++++++++++++++++++++++++++++++++++++++\n 1 file changed, 94 insertions(+)",
    "diff": "diff --git a/drivers/video/vidconsole-uclass.c b/drivers/video/vidconsole-uclass.c\nindex 0a88cc0a42..820540b1bf 100644\n--- a/drivers/video/vidconsole-uclass.c\n+++ b/drivers/video/vidconsole-uclass.c\n@@ -108,6 +108,41 @@ static void vidconsole_newline(struct udevice *dev)\n \tvideo_sync(dev->parent);\n }\n \n+static const struct {\n+\tunsigned r;\n+\tunsigned g;\n+\tunsigned b;\n+} colors[] = {\n+\t{ 0x00, 0x00, 0x00 },  /* black */\n+\t{ 0xff, 0x00, 0x00 },  /* red */\n+\t{ 0x00, 0xff, 0x00 },  /* green */\n+\t{ 0xff, 0xff, 0x00 },  /* yellow */\n+\t{ 0x00, 0x00, 0xff },  /* blue */\n+\t{ 0xff, 0x00, 0xff },  /* magenta */\n+\t{ 0x00, 0xff, 0xff },  /* cyan */\n+\t{ 0xff, 0xff, 0xff },  /* white */\n+};\n+\n+static void set_color(struct video_priv *priv, unsigned idx, unsigned *c)\n+{\n+\tswitch (priv->bpix) {\n+\tcase VIDEO_BPP16:\n+\t\t*c = ((colors[idx].r >> 3) << 0) |\n+\t\t     ((colors[idx].g >> 2) << 5) |\n+\t\t     ((colors[idx].b >> 3) << 11);\n+\t\tbreak;\n+\tcase VIDEO_BPP32:\n+\t\t*c = 0xff000000 |\n+\t\t     (colors[idx].r << 0) |\n+\t\t     (colors[idx].g << 8) |\n+\t\t     (colors[idx].b << 16);\n+\t\tbreak;\n+\tdefault:\n+\t\t/* unsupported, leave current color in place */\n+\t\tbreak;\n+\t}\n+}\n+\n static char *parsenum(char *s, int *num)\n {\n \tchar *end;\n@@ -194,6 +229,65 @@ static void vidconsole_escape_char(struct udevice *dev, char ch)\n \t\t}\n \t\tbreak;\n \t}\n+\tcase 'm': {\n+\t\tstruct video_priv *vid_priv = dev_get_uclass_priv(dev->parent);\n+\t\tchar *s = priv->escape_buf;\n+\t\tchar *end = &priv->escape_buf[priv->escape_len];\n+\n+\t\t/*\n+\t\t * Set graphics mode: [%d;...;%dm\n+\t\t *\n+\t\t * Currently only supports the color attributes:\n+\t\t *\n+\t\t * Foreground Colors:\n+\t\t *\n+\t\t *   30\tBlack\n+\t\t *   31\tRed\n+\t\t *   32\tGreen\n+\t\t *   33\tYellow\n+\t\t *   34\tBlue\n+\t\t *   35\tMagenta\n+\t\t *   36\tCyan\n+\t\t *   37\tWhite\n+\t\t *\n+\t\t * Background Colors:\n+\t\t *\n+\t\t *   40\tBlack\n+\t\t *   41\tRed\n+\t\t *   42\tGreen\n+\t\t *   43\tYellow\n+\t\t *   44\tBlue\n+\t\t *   45\tMagenta\n+\t\t *   46\tCyan\n+\t\t *   47\tWhite\n+\t\t */\n+\n+\t\ts++;    /* [ */\n+\t\twhile (s < end) {\n+\t\t\tint val;\n+\n+\t\t\ts = parsenum(s, &val);\n+\t\t\ts++;\n+\n+\t\t\tswitch (val) {\n+\t\t\tcase 30 ... 37:\n+\t\t\t\t/* fg color */\n+\t\t\t\tset_color(vid_priv, val - 30,\n+\t\t\t\t\t  (unsigned *)&vid_priv->colour_fg);\n+\t\t\t\tbreak;\n+\t\t\tcase 40 ... 47:\n+\t\t\t\t/* bg color */\n+\t\t\t\tset_color(vid_priv, val - 40,\n+\t\t\t\t\t  (unsigned *)&vid_priv->colour_bg);\n+\t\t\t\tbreak;\n+\t\t\tdefault:\n+\t\t\t\t/* unknown/unsupported */\n+\t\t\t\tbreak;\n+\t\t\t}\n+\t\t}\n+\n+\t\tbreak;\n+\t}\n \tdefault:\n \t\tdebug(\"unrecognized escape sequence: %*s\\n\",\n \t\t      priv->escape_len, priv->escape_buf);\n",
    "prefixes": [
        "U-Boot",
        "3/3"
    ]
}