{"id":813654,"url":"http://patchwork.ozlabs.org/api/patches/813654/?format=json","web_url":"http://patchwork.ozlabs.org/project/uboot/patch/20170913220546.19560-20-robdclark@gmail.com/","project":{"id":18,"url":"http://patchwork.ozlabs.org/api/projects/18/?format=json","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":"<20170913220546.19560-20-robdclark@gmail.com>","list_archive_url":null,"date":"2017-09-13T22:05:42","name":"[U-Boot,v3,19/21] efi_loader: split out escape sequence based size query","commit_ref":null,"pull_url":null,"state":"accepted","archived":false,"hash":"99afb8d2d872ac028f1fc2d7c292812624f1d045","submitter":{"id":18760,"url":"http://patchwork.ozlabs.org/api/people/18760/?format=json","name":"Rob Clark","email":"robdclark@gmail.com"},"delegate":{"id":3400,"url":"http://patchwork.ozlabs.org/api/users/3400/?format=json","username":"agraf","first_name":"Alexander","last_name":"Graf","email":"agraf@suse.de"},"mbox":"http://patchwork.ozlabs.org/project/uboot/patch/20170913220546.19560-20-robdclark@gmail.com/mbox/","series":[{"id":2990,"url":"http://patchwork.ozlabs.org/api/series/2990/?format=json","web_url":"http://patchwork.ozlabs.org/project/uboot/list/?series=2990","date":"2017-09-13T22:05:23","name":"efi_loader: enough UEFI for standard distro boot","version":3,"mbox":"http://patchwork.ozlabs.org/series/2990/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/813654/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/813654/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=\"kFuTe9iF\"; dkim-atps=neutral"],"Received":["from lists.denx.de (dione.denx.de [81.169.180.215])\n\tby ozlabs.org (Postfix) with ESMTP id 3xswzp0HkGz9s76\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu, 14 Sep 2017 08:18:45 +1000 (AEST)","by lists.denx.de (Postfix, from userid 105)\n\tid CDD4AC22721; Wed, 13 Sep 2017 22:13:46 +0000 (UTC)","from lists.denx.de (localhost [IPv6:::1])\n\tby lists.denx.de (Postfix) with ESMTP id 70DDDC2259B;\n\tWed, 13 Sep 2017 22:13:43 +0000 (UTC)","by lists.denx.de (Postfix, from userid 105)\n\tid 901DFC225AC; Wed, 13 Sep 2017 22:06:54 +0000 (UTC)","from mail-qt0-f196.google.com (mail-qt0-f196.google.com\n\t[209.85.216.196])\n\tby lists.denx.de (Postfix) with ESMTPS id 43DA3C21F60\n\tfor <u-boot@lists.denx.de>; Wed, 13 Sep 2017 22:06:51 +0000 (UTC)","by mail-qt0-f196.google.com with SMTP id t46so942300qtj.3\n\tfor <u-boot@lists.denx.de>; Wed, 13 Sep 2017 15:06:51 -0700 (PDT)","from localhost ([2601:184:4780:aac0:25f8:dd96:a084:785a])\n\tby smtp.gmail.com with ESMTPSA id\n\tv11sm10398324qkl.45.2017.09.13.15.06.48\n\t(version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256);\n\tWed, 13 Sep 2017 15:06:49 -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=zmASFMSzYWSBSdugC77vjUNtmmQgCCSF2tHQAtczTpw=;\n\tb=kFuTe9iFoM7alWc7OE//IW/e/FV9tGgl3TmgTr+eO3FfQ5DSYjJ3wT1R+OBdYJWUVN\n\tTo7NgcPgMSHiv5B14sFvJDUyyW2pHFwR+nHM5oseqzbSkpFyU5RTsSrlkVitTl4wv5tc\n\ttFGsnkT6p+oYOAFKeZPsjaSMMnIa6iFGdjotOiTrZgJqQ4gae8yjEkiD7cbmQf52O6y5\n\ts5U9Nk4lady+7rLd2ColCYfLnLAtwpdWRG1oKNgYD7wdEWYeNCZ0zwwuIgO4LhhFmMPl\n\tGu3gQPQNdU9ulemvIpyrbZNAthwia5M3aQT4026flN4VrIYRYs6CRT3VNNtbwLPglINq\n\tz93A==","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=zmASFMSzYWSBSdugC77vjUNtmmQgCCSF2tHQAtczTpw=;\n\tb=ncHBabtQIREf3nzqcTcD04pqNTPlQN5QL7RDlbcKAytx6hXn1aRaOMYHGeoEbWGliV\n\ttUcX+ecirmHWPEHxo7hJgFMjmtITcQzoc1HtCPvlIbXzAvznq0a9fHO8U4kCtNhPhZ/J\n\tA3kZOys/IRpEcpssDZlSyd2Q1LJWC7Y8p//mu1vhbNmqpyvcrWJR3jp6BKTo1OXwwrMm\n\tbK5Z2fi1XAQbgmHViPZ0rpk4Eoi9FRjLRpYgAvlJk4/k6ukDu20o0rZvmYDI9ZpFz6aD\n\t/UiPP+oYCRIFpAnimZlu/ys4wH07stj51rKpEOkKR1AO0srq1IZ/ldaictIdeAKV/KFM\n\tS9zg==","X-Gm-Message-State":"AHPjjUg5QvLZoY1nms5ryxt2wF/1uP1JwuYqW2xIrPZYJfoobrIv8I0e\n\tI0sbse8QSPC9/n3y6s8=","X-Google-Smtp-Source":"AOwi7QB5D3vB68JYN/LWdw+ga3IalxQ5ZmDXLtqToxqIs0x6Gbcpxt1klz1ZA41gXUW3fSuafiNl1w==","X-Received":"by 10.200.3.111 with SMTP id w47mr18698830qtg.144.1505340409985; \n\tWed, 13 Sep 2017 15:06:49 -0700 (PDT)","From":"Rob Clark <robdclark@gmail.com>","To":"U-Boot Mailing List <u-boot@lists.denx.de>","Date":"Wed, 13 Sep 2017 18:05:42 -0400","Message-Id":"<20170913220546.19560-20-robdclark@gmail.com>","X-Mailer":"git-send-email 2.13.5","In-Reply-To":"<20170913220546.19560-1-robdclark@gmail.com>","References":"<20170913220546.19560-1-robdclark@gmail.com>","Cc":"Heinrich Schuchardt <xypron.glpk@gmx.de>","Subject":"[U-Boot] [PATCH v3 19/21] efi_loader: split out escape sequence\n\tbased size query","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":"We need to do something different for vidconsole, since it cannot\nrespond to the query on stdin.  Prep work for next patch.\n\nSigned-off-by: Rob Clark <robdclark@gmail.com>\n---\n lib/efi_loader/efi_console.c | 53 +++++++++++++++++++++++++-------------------\n 1 file changed, 30 insertions(+), 23 deletions(-)","diff":"diff --git a/lib/efi_loader/efi_console.c b/lib/efi_loader/efi_console.c\nindex 3fc82b8726..e8c02870eb 100644\n--- a/lib/efi_loader/efi_console.c\n+++ b/lib/efi_loader/efi_console.c\n@@ -186,6 +186,34 @@ static bool cout_mode_matches(struct cout_mode *mode, int rows, int cols)\n \treturn (mode->rows == rows) && (mode->columns == cols);\n }\n \n+static int query_console_serial(int *rows, int *cols)\n+{\n+\t/* Ask the terminal about its size */\n+\tint n[3];\n+\tu64 timeout;\n+\n+\t/* Empty input buffer */\n+\twhile (tstc())\n+\t\tgetc();\n+\n+\tprintf(ESC\"[18t\");\n+\n+\t/* Check if we have a terminal that understands */\n+\ttimeout = timer_get_us() + 1000000;\n+\twhile (!tstc())\n+\t\tif (timer_get_us() > timeout)\n+\t\t\treturn -1;\n+\n+\t/* Read {depth,rows,cols} */\n+\tif (term_read_reply(n, 3, 't'))\n+\t\treturn -1;\n+\n+\t*cols = n[2];\n+\t*rows = n[1];\n+\n+\treturn 0;\n+}\n+\n static efi_status_t EFIAPI efi_cout_query_mode(\n \t\t\tstruct efi_simple_text_output_protocol *this,\n \t\t\tunsigned long mode_number, unsigned long *columns,\n@@ -194,33 +222,12 @@ static efi_status_t EFIAPI efi_cout_query_mode(\n \tEFI_ENTRY(\"%p, %ld, %p, %p\", this, mode_number, columns, rows);\n \n \tif (!console_size_queried) {\n-\t\t/* Ask the terminal about its size */\n-\t\tint n[3];\n-\t\tint cols;\n-\t\tint rows;\n-\t\tu64 timeout;\n+\t\tint rows, cols;\n \n \t\tconsole_size_queried = true;\n \n-\t\t/* Empty input buffer */\n-\t\twhile (tstc())\n-\t\t\tgetc();\n-\n-\t\tprintf(ESC\"[18t\");\n-\n-\t\t/* Check if we have a terminal that understands */\n-\t\ttimeout = timer_get_us() + 1000000;\n-\t\twhile (!tstc())\n-\t\t\tif (timer_get_us() > timeout)\n-\t\t\t\tgoto out;\n-\n-\t\t/* Read {depth,rows,cols} */\n-\t\tif (term_read_reply(n, 3, 't')) {\n+\t\tif (query_console_serial(&rows, &cols))\n \t\t\tgoto out;\n-\t\t}\n-\n-\t\tcols = n[2];\n-\t\trows = n[1];\n \n \t\t/* Test if we can have Mode 1 */\n \t\tif (cols >= 80 && rows >= 50) {\n","prefixes":["U-Boot","v3","19/21"]}