{"id":812116,"url":"http://patchwork.ozlabs.org/api/patches/812116/?format=json","web_url":"http://patchwork.ozlabs.org/project/uboot/patch/20170910112149.21358-29-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":"<20170910112149.21358-29-robdclark@gmail.com>","list_archive_url":null,"date":"2017-09-10T11:21:45","name":"[U-Boot,v2,19/21] efi_loader: split out escape sequence based size query","commit_ref":null,"pull_url":null,"state":"superseded","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/20170910112149.21358-29-robdclark@gmail.com/mbox/","series":[{"id":2383,"url":"http://patchwork.ozlabs.org/api/series/2383/?format=json","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/812116/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/812116/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=\"boxm05w7\"; dkim-atps=neutral"],"Received":["from lists.denx.de (dione.denx.de [81.169.180.215])\n\tby ozlabs.org (Postfix) with ESMTP id 3xqpvj447Bz9sDB\n\tfor <incoming@patchwork.ozlabs.org>;\n\tSun, 10 Sep 2017 21:37:53 +1000 (AEST)","by lists.denx.de (Postfix, from userid 105)\n\tid 4C9B6C21E8C; Sun, 10 Sep 2017 11:29:51 +0000 (UTC)","from lists.denx.de (localhost [IPv6:::1])\n\tby lists.denx.de (Postfix) with ESMTP id 5D41FC21F2D;\n\tSun, 10 Sep 2017 11:26:26 +0000 (UTC)","by lists.denx.de (Postfix, from userid 105)\n\tid 85C7DC21E41; Sun, 10 Sep 2017 11:24:10 +0000 (UTC)","from mail-qt0-f194.google.com (mail-qt0-f194.google.com\n\t[209.85.216.194])\n\tby lists.denx.de (Postfix) with ESMTPS id 5F7DBC21F0A\n\tfor <u-boot@lists.denx.de>; Sun, 10 Sep 2017 11:24:01 +0000 (UTC)","by mail-qt0-f194.google.com with SMTP id q8so4090729qtb.1\n\tfor <u-boot@lists.denx.de>; Sun, 10 Sep 2017 04:24:01 -0700 (PDT)","from localhost ([2601:184:4780:aac0:25f8:dd96:a084:785a])\n\tby smtp.gmail.com with ESMTPSA id\n\tk20sm4185334qtj.2.2017.09.10.04.23.58\n\t(version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256);\n\tSun, 10 Sep 2017 04:23:58 -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=boxm05w7nVv48S45/bKwIKjF/Gp5Wtx9LgdVGxLs4c1upk7qJyh6zakp5SigduKBZO\n\tPINwNEdq3jfhH96AQds5mmT0/kfpaCQG7johB8Mgp7wvldhvsZxMWZfgBIgEEY57WfL0\n\tZ3yTvA45ewyhnGjCvAeDWmFGvT3ucrvifLl/sOfUWWI0BBJ6cNu/2YQ69T33teQOO/pe\n\t89pIj3Rj3wLr94wBtgl89/Zfu5IqJ6Rfu7WPsM6FHxO+tnSFJb5ZtjjlPrKIrRlV2oD/\n\tBNarFUIYM8Q1SBgWfz/DNvuSDAu0TeiPLN1D37+BGJdpFyiT060tba4DK8iKR+GcYJLe\n\ttCGA==","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=UlnP43pYeNuq3ZLXolFVUuCl5EGcAh2wi1DmL2ugyPotkgECCFOvCCtz9uyRySNwlG\n\tV6lYbcG6XilDrhFDcZVhBa6fDoUweusrgJNo9IgP6RiYn1jFRBpF9CTy9hf73wgKNWwJ\n\tk2FDGXzoh25MM8bnel8Td92WGhnM2n+nAOy5EesrDhiYZxAxFG61XY0pxCr94+04xrSd\n\tt4aoG4ZEfeYnO1G2hpKBc4y+yc5jjYtSC4h1pyOf1xclLK1wZlGyhs5lcr3sxK+6l8pi\n\tsp0D8FobaQCP86ysmNGmVRdTtmN28jLqpYcyHs+luslV/YbcaQxdIcPWaGZPc52vgYG8\n\te+Hg==","X-Gm-Message-State":"AHPjjUjUX4L3f7R3yzpAyqpao5bkUf41cydAvvaWiW0kA/reor9mpd36\n\tsJ81NNQdTs2aU30krxk=","X-Google-Smtp-Source":"AOwi7QDbGNeIw41Jee/zf19SfBxERxFMhqM2sxKduamVZLkC2TWM0sE/Kw2cM89WP9iDael+VaBxOw==","X-Received":"by 10.200.50.149 with SMTP id z21mr12918338qta.37.1505042640131; \n\tSun, 10 Sep 2017 04:24:00 -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:45 -0400","Message-Id":"<20170910112149.21358-29-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>","Subject":"[U-Boot] [PATCH v2 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","v2","19/21"]}