From patchwork Sun Sep 10 11:21:46 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Clark X-Patchwork-Id: 812119 X-Patchwork-Delegate: agraf@suse.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="FLqNBvcD"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 3xqpxr2SB3z9sDB for ; Sun, 10 Sep 2017 21:39:44 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id D4743C21F6A; Sun, 10 Sep 2017 11:31:38 +0000 (UTC) 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, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 7E3CBC21EA8; Sun, 10 Sep 2017 11:29:26 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 1DBD3C21F12; Sun, 10 Sep 2017 11:24:13 +0000 (UTC) Received: from mail-qt0-f193.google.com (mail-qt0-f193.google.com [209.85.216.193]) by lists.denx.de (Postfix) with ESMTPS id 3507FC21F5B for ; Sun, 10 Sep 2017 11:24:04 +0000 (UTC) Received: by mail-qt0-f193.google.com with SMTP id b1so1748041qtc.0 for ; Sun, 10 Sep 2017 04:24:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=vtK1zZTLszv9J+4U8WH5KLG+0f5uZYnvDQoIBqpAXI4=; b=FLqNBvcDzWl+xPdi1uy7SNJqaf5h2slDJUNiRes2rQLmLYIMPQqBOPyGyQaAKQpuCQ Kn275vLQdFIHtkK4Vjij/wn1aieRmZVymmzUgqqSijR+WFeiqjKKCoJsIUYFq9odyJw1 q3XUvA1eZ2Q4R+P7EYIFj/dEgAZA4kT8gwvbdaLxacVNuP+FoFOe8yoiMxHqeyYKJUrZ f5yCn28rpTpJBUA2yAQmwuejp3gcOj87FUfPBL01NWAYXGeKfAG4sL2SRxuHQrNx/+4y dMfzLd0/uDtAno0J6VIRtPMU6Lh0ze2X3zp8fqMOFlJJ1+B6cOVcElgcKgssX7Z1RFf2 rrtQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=vtK1zZTLszv9J+4U8WH5KLG+0f5uZYnvDQoIBqpAXI4=; b=FIyGO5kLpUSZC7U3drjtrRIvrhqVA4SPcLucQ/xcL5pVUirCgi78nxguPid2tfMe8g d7jEt1FP1OZWADSgQCCkZi/MmbYvL+BjGi1PoLGY5ERvmpStlSP7e2WzBsuiRoTW7OSx pjRo5BwiP+m+sPIyz2v2/9Qxy2ZgmRjPNX7irJLJrJTUObtJemiuJ/D884pQn3aCwZUa 92UG6z9wbtCrw2CoyXqpSDhL+tfELSxguWhaBqkxJkjAuTz6YizWics9VXn+zle5tDhi jdcl/5fAmUjFvElPQWmkic9IJ4ycUFM0cX2AqMluD2HNhyRsuTUD91VJ1MYX96Pj1xj8 7YqQ== X-Gm-Message-State: AHPjjUgpplo08I/S53M0vtI8z9IV2cROhKTCCn94JbJK/934lLAvqzyC BVK461D3myhogy4BARY= X-Google-Smtp-Source: AOwi7QBx3Z0YISaGH6IhfzUh3vj8OaGfn5Ds5XMX+rMV27atAoRPUgqxvGzBXUj7KCZYQqRvLcj5LA== X-Received: by 10.200.36.132 with SMTP id s4mr11390958qts.4.1505042642947; Sun, 10 Sep 2017 04:24:02 -0700 (PDT) Received: from localhost ([2601:184:4780:aac0:25f8:dd96:a084:785a]) by smtp.gmail.com with ESMTPSA id a91sm4608856qka.90.2017.09.10.04.24.01 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 10 Sep 2017 04:24:02 -0700 (PDT) From: Rob Clark To: U-Boot Mailing List Date: Sun, 10 Sep 2017 07:21:46 -0400 Message-Id: <20170910112149.21358-30-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 Subject: [U-Boot] [PATCH v2 20/21] efi_loader: Correctly figure out size for vidconsole X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" If stdout is vidconsole, we cannot rely on ANSI escape sequences to query the size, as vidconsole cannot reply on stdin. Instead special- case this if stdout is vidconsole. Signed-off-by: Rob Clark --- lib/efi_loader/efi_console.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/lib/efi_loader/efi_console.c b/lib/efi_loader/efi_console.c index e8c02870eb..9048a8d32c 100644 --- a/lib/efi_loader/efi_console.c +++ b/lib/efi_loader/efi_console.c @@ -8,7 +8,10 @@ #include #include +#include #include +#include +#include static bool console_size_queried; @@ -222,12 +225,23 @@ static efi_status_t EFIAPI efi_cout_query_mode( EFI_ENTRY("%p, %ld, %p, %p", this, mode_number, columns, rows); if (!console_size_queried) { + const char *stdout_name = env_get("stdout"); int rows, cols; console_size_queried = true; - if (query_console_serial(&rows, &cols)) + if (stdout_name && !strcmp(stdout_name, "vidconsole") && + IS_ENABLED(CONFIG_DM_VIDEO)) { + struct stdio_dev *stdout_dev = + stdio_get_by_name("vidconsole"); + struct udevice *dev = stdout_dev->priv; + struct vidconsole_priv *priv = + dev_get_uclass_priv(dev); + rows = priv->rows; + cols = priv->cols; + } else if (query_console_serial(&rows, &cols)) { goto out; + } /* Test if we can have Mode 1 */ if (cols >= 80 && rows >= 50) {