Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/812121/?format=api
{ "id": 812121, "url": "http://patchwork.ozlabs.org/api/patches/812121/?format=api", "web_url": "http://patchwork.ozlabs.org/project/uboot/patch/20170910112149.21358-31-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": "<20170910112149.21358-31-robdclark@gmail.com>", "list_archive_url": null, "date": "2017-09-10T11:21:47", "name": "[U-Boot,v2,21/21] efi_loader: Some console improvements for vidconsole", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "c787c91fbe1d4fe0ec8604835c99549a2ee5b0d2", "submitter": { "id": 18760, "url": "http://patchwork.ozlabs.org/api/people/18760/?format=api", "name": "Rob Clark", "email": "robdclark@gmail.com" }, "delegate": { "id": 3400, "url": "http://patchwork.ozlabs.org/api/users/3400/?format=api", "username": "agraf", "first_name": "Alexander", "last_name": "Graf", "email": "agraf@suse.de" }, "mbox": "http://patchwork.ozlabs.org/project/uboot/patch/20170910112149.21358-31-robdclark@gmail.com/mbox/", "series": [ { "id": 2383, "url": "http://patchwork.ozlabs.org/api/series/2383/?format=api", "web_url": "http://patchwork.ozlabs.org/project/uboot/list/?series=2383", "date": "2017-09-10T11:21:17", "name": "efi_loader: enough UEFI for standard distro boot", "version": 2, "mbox": "http://patchwork.ozlabs.org/series/2383/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/812121/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/812121/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=\"s1ESsyG6\"; dkim-atps=neutral" ], "Received": [ "from lists.denx.de (dione.denx.de [81.169.180.215])\n\tby ozlabs.org (Postfix) with ESMTP id 3xqpy823rcz9sDB\n\tfor <incoming@patchwork.ozlabs.org>;\n\tSun, 10 Sep 2017 21:40:00 +1000 (AEST)", "by lists.denx.de (Postfix, from userid 105)\n\tid 09D51C21F88; Sun, 10 Sep 2017 11:31:22 +0000 (UTC)", "from lists.denx.de (localhost [IPv6:::1])\n\tby lists.denx.de (Postfix) with ESMTP id 5BB99C21F71;\n\tSun, 10 Sep 2017 11:27:44 +0000 (UTC)", "by lists.denx.de (Postfix, from userid 105)\n\tid 40DA4C21F67; Sun, 10 Sep 2017 11:24:16 +0000 (UTC)", "from mail-qt0-f193.google.com (mail-qt0-f193.google.com\n\t[209.85.216.193])\n\tby lists.denx.de (Postfix) with ESMTPS id B8007C21F51\n\tfor <u-boot@lists.denx.de>; Sun, 10 Sep 2017 11:24:07 +0000 (UTC)", "by mail-qt0-f193.google.com with SMTP id b1so1748192qtc.0\n\tfor <u-boot@lists.denx.de>; Sun, 10 Sep 2017 04:24:07 -0700 (PDT)", "from localhost ([2601:184:4780:aac0:25f8:dd96:a084:785a])\n\tby smtp.gmail.com with ESMTPSA id\n\tf6sm4184549qtb.68.2017.09.10.04.24.05\n\t(version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256);\n\tSun, 10 Sep 2017 04:24:05 -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=tTjJNgm+knfE2IVXbgcSZPd7Q9s0s6Q4yiWNU5LVgTo=;\n\tb=s1ESsyG65rLQ/6Rlzdh3C3i4Xk22lvWe31+JZiL9wIRhC1vVzCk1E6yqqe5QTve/sd\n\tLATgRored6ptYfP8QIM2v6UbLkrhCHF49YiKw8sjgmy/xr4pCLd42SWUjrDMOVO4JYhi\n\tQrkfwrq0UocvOluDd0SspJsqC0ZKwc5w+i4ubQNCUbCcyA6VkI22b01EMPuoJF3eZnt7\n\tSAVUcVZgA+1/YVIxZOQLRdTAVDX0UOGnsr6qKnO4QMde/rbJcweUgpdTPsbzXiw4suyP\n\tw6GBP7l7MdVxJQhDlGI3CWyqDIiVtbtjjSfF3B6Zmv5TOQ6LvGPoIlkC211+h9oIr5Y8\n\tzf3g==", "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=tTjJNgm+knfE2IVXbgcSZPd7Q9s0s6Q4yiWNU5LVgTo=;\n\tb=Pk3jDHfNKMDutvf6USsdc5mBoxAEPx1qRvJabFuiQUidFOspHFwxHwDGZxUIxwAJ66\n\tsKpvUmoLEW0XI1jQiYzt85apocd5AvYvmTDsx9e976U3eXtxaodNA7hNTsC59tI8Phwb\n\tlmuuAEeDSvne6KLfb7i3kwwR2Of+bGaS98ic+flLMSp/B7s6+wd2V6hSm4wyjPugkEas\n\t/vDR6dEGRQdU15+hJqrMUAIxZZ80J3wgmWTrhuKt52Y6TfauxG1kAjBrvbi93VHc8GIF\n\t+JquQN+HNTUVj7Oka2o+KZrtvk8Ek00OZeH3yLFmmFMmDm6wAOmweGK4/iazO4vTvW7c\n\txEWA==", "X-Gm-Message-State": "AHPjjUiWlVAmtu4YnGqQm/LTNHhucjHXXzBKNmRau5zOjWMDeoC4KeS3\n\t2u3uDRKWulinjbXWxLQ=", "X-Google-Smtp-Source": "AOwi7QBbP9gMRkJrZvZDdu65PQPUeD8DlGPC9Ph+CUYPjp25ykz9ust586etfP4W9cTSgo2gOdHKXA==", "X-Received": "by 10.237.63.124 with SMTP id q57mr12042083qtf.23.1505042646474; \n\tSun, 10 Sep 2017 04:24:06 -0700 (PDT)", "From": "Rob Clark <robdclark@gmail.com>", "To": "U-Boot Mailing List <u-boot@lists.denx.de>", "Date": "Sun, 10 Sep 2017 07:21:47 -0400", "Message-Id": "<20170910112149.21358-31-robdclark@gmail.com>", "X-Mailer": "git-send-email 2.13.5", "In-Reply-To": "<20170910112149.21358-1-robdclark@gmail.com>", "References": "<20170910112149.21358-1-robdclark@gmail.com>", "Cc": "Heinrich Schuchardt <xypron.glpk@gmx.de>, Peter Jones <pjones@redhat.com>", "Subject": "[U-Boot] [PATCH v2 21/21] efi_loader: Some console improvements for\n\tvidconsole", "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": "1) use fputs() to reduce cache flushes from once-per-char to\n once-per-string\n2) handle \\r, \\t, and \\b in addition to just \\n for tracking\n cursor position\n3) cursor row/col are zero based, not one based\n\nSigned-off-by: Rob Clark <robdclark@gmail.com>\n---\n include/efi_api.h | 6 +++--\n lib/efi_loader/efi_console.c | 58 ++++++++++++++++++++++++++------------------\n 2 files changed, 39 insertions(+), 25 deletions(-)", "diff": "diff --git a/include/efi_api.h b/include/efi_api.h\nindex 604c5b7ec4..c3b9032a48 100644\n--- a/include/efi_api.h\n+++ b/include/efi_api.h\n@@ -29,6 +29,8 @@ enum efi_timer_delay {\n };\n \n #define UINTN size_t\n+typedef long INTN;\n+typedef uint16_t *efi_string_t;\n \n #define EVT_TIMER\t\t\t\t0x80000000\n #define EVT_RUNTIME\t\t\t\t0x40000000\n@@ -427,10 +429,10 @@ struct efi_simple_text_output_protocol {\n \tvoid *reset;\n \tefi_status_t (EFIAPI *output_string)(\n \t\t\tstruct efi_simple_text_output_protocol *this,\n-\t\t\tconst unsigned short *str);\n+\t\t\tconst efi_string_t str);\n \tefi_status_t (EFIAPI *test_string)(\n \t\t\tstruct efi_simple_text_output_protocol *this,\n-\t\t\tconst unsigned short *str);\n+\t\t\tconst efi_string_t str);\n \tefi_status_t(EFIAPI *query_mode)(\n \t\t\tstruct efi_simple_text_output_protocol *this,\n \t\t\tunsigned long mode_number, unsigned long *columns,\ndiff --git a/lib/efi_loader/efi_console.c b/lib/efi_loader/efi_console.c\nindex 9048a8d32c..afc725a2c7 100644\n--- a/lib/efi_loader/efi_console.c\n+++ b/lib/efi_loader/efi_console.c\n@@ -140,34 +140,46 @@ static efi_status_t EFIAPI efi_cout_reset(\n \treturn EFI_EXIT(EFI_UNSUPPORTED);\n }\n \n-static void print_unicode_in_utf8(u16 c)\n-{\n-\tchar utf8[MAX_UTF8_PER_UTF16] = { 0 };\n-\tutf16_to_utf8((u8 *)utf8, &c, 1);\n-\tputs(utf8);\n-}\n-\n static efi_status_t EFIAPI efi_cout_output_string(\n \t\t\tstruct efi_simple_text_output_protocol *this,\n-\t\t\tconst unsigned short *string)\n+\t\t\tconst efi_string_t string)\n {\n-\tstruct cout_mode *mode;\n-\tu16 ch;\n+\tstruct simple_text_output_mode *con = &efi_con_mode;\n+\tstruct cout_mode *mode = &efi_cout_modes[con->mode];\n \n-\tmode = &efi_cout_modes[efi_con_mode.mode];\n \tEFI_ENTRY(\"%p, %p\", this, string);\n-\tfor (;(ch = *string); string++) {\n-\t\tprint_unicode_in_utf8(ch);\n-\t\tefi_con_mode.cursor_column++;\n-\t\tif (ch == '\\n') {\n-\t\t\tefi_con_mode.cursor_column = 1;\n-\t\t\tefi_con_mode.cursor_row++;\n-\t\t} else if (efi_con_mode.cursor_column > mode->columns) {\n-\t\t\tefi_con_mode.cursor_column = 1;\n-\t\t\tefi_con_mode.cursor_row++;\n+\n+\tunsigned n16 = utf16_strlen(string);\n+\tchar buf[MAX_UTF8_PER_UTF16 * n16 + 1];\n+\tchar *p;\n+\n+\t*utf16_to_utf8((u8 *)buf, string, n16) = '\\0';\n+\n+\tfputs(stdout, buf);\n+\n+\tfor (p = buf; *p; p++) {\n+\t\tswitch (*p) {\n+\t\tcase '\\r': /* carriage-return */\n+\t\t\tcon->cursor_column = 0;\n+\t\t\tbreak;\n+\t\tcase '\\n': /* newline */\n+\t\t\tcon->cursor_column = 0;\n+\t\t\tcon->cursor_row++;\n+\t\t\tbreak;\n+\t\tcase '\\t': /* tab, assume 8 char align */\n+\t\t\tbreak;\n+\t\tcase '\\b': /* backspace */\n+\t\t\tcon->cursor_column = max(0, con->cursor_column - 1);\n+\t\t\tbreak;\n+\t\tdefault:\n+\t\t\tcon->cursor_column++;\n+\t\t\tbreak;\n+\t\t}\n+\t\tif (con->cursor_column >= mode->columns) {\n+\t\t\tcon->cursor_column = 0;\n+\t\t\tcon->cursor_row++;\n \t\t}\n-\t\tif (efi_con_mode.cursor_row > mode->rows)\n-\t\t\tefi_con_mode.cursor_row = mode->rows;\n+\t\tcon->cursor_row = min(con->cursor_row, (s32)mode->rows - 1);\n \t}\n \n \treturn EFI_EXIT(EFI_SUCCESS);\n@@ -175,7 +187,7 @@ static efi_status_t EFIAPI efi_cout_output_string(\n \n static efi_status_t EFIAPI efi_cout_test_string(\n \t\t\tstruct efi_simple_text_output_protocol *this,\n-\t\t\tconst unsigned short *string)\n+\t\t\tconst efi_string_t string)\n {\n \tEFI_ENTRY(\"%p, %p\", this, string);\n \treturn EFI_EXIT(EFI_SUCCESS);\n", "prefixes": [ "U-Boot", "v2", "21/21" ] }