From patchwork Wed Sep 13 22:05:43 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Clark X-Patchwork-Id: 813659 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="CZZWr+aZ"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 3xsx3N2lxfz9sxR for ; Thu, 14 Sep 2017 08:21:52 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 1106FC2217C; Wed, 13 Sep 2017 22:11:26 +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 4BC2CC22616; Wed, 13 Sep 2017 22:08:44 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id B3D90C22625; Wed, 13 Sep 2017 22:06:57 +0000 (UTC) Received: from mail-qt0-f195.google.com (mail-qt0-f195.google.com [209.85.216.195]) by lists.denx.de (Postfix) with ESMTPS id 07AFFC2257F for ; Wed, 13 Sep 2017 22:06:54 +0000 (UTC) Received: by mail-qt0-f195.google.com with SMTP id t46so942351qtj.3 for ; Wed, 13 Sep 2017 15:06:53 -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=CZZWr+aZ+0bGwQsRMyVu6H21zKVUsJPeebt7qc74hiVLuY5OWehTnzCi1q738YNDpb D/nk2SLrDVR2vNq0ODXuTHly8tQhLmuz1zJ3M61ZqCOxjJBI+g/CQFIjJP3N7NGjGE9W 5wBQdsRHMWE8zZN5Hlud2xSGWrXMWJiSza2GHudDa284+HmY6YqHf5wOC/KA/bs4xdm0 vkDNz4NCDj0TyLwODRvonlY3Zl8UWZgeb7Xbq4h8MmjQj1pn2a1TAXCIYPKV+Y6GgUWh CbIh/9HGMYJHS1d4mIkqHy2p1jgjop/7Ike0xv50uhTk2kzF29+MsPyimmrLuEFgX7tt eiLg== 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=DCK122Yq3bFBns+mXFHRUJwFuCAWL/HakWE1+8XgNoQ1X5ZwDEl4yHbeGENSy1xmqu 1y9K1ZSW+s9TlXjBqmWy8KL3JuObKRTCXaMQG8/1dv20UmyjNW9k6coVljcQvWPbJvAm G1KFHfHFT309A/dk8Q8l1ArJwqYEWXYFhdOPj7UhM6JAM8NczX6dz/uHCval1ui8/N1L oxV/Bwb+OgnrRrGV+Uvltx9vK22o3vR+PGejN4UXcEWjAa5MzuiRxa23KIC4OcNErfuD dejj6zd5sn4axOTlfy/6RPRxdzmwtFeg8/o9F7xx2rpZoXEQkA1QANO60EUOArl5zkHb EV7Q== X-Gm-Message-State: AHPjjUiZ4JEdnNrqRKHvaYJIxX/9oVu6UL0a+MzGvFbGx6au8c5ueniq 8yyqJTxw6WHUDTbkxoc= X-Google-Smtp-Source: AOwi7QAbI5G8EwB2WJ12nhpBCu0rm90R59bF58pP8CqaokOva4luSAsMYpKWwI9U4zzQETJ1nc4obw== X-Received: by 10.200.15.210 with SMTP id f18mr29063129qtk.226.1505340412749; Wed, 13 Sep 2017 15:06:52 -0700 (PDT) Received: from localhost ([2601:184:4780:aac0:25f8:dd96:a084:785a]) by smtp.gmail.com with ESMTPSA id s7sm9872594qkf.4.2017.09.13.15.06.51 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 13 Sep 2017 15:06:51 -0700 (PDT) From: Rob Clark To: U-Boot Mailing List Date: Wed, 13 Sep 2017 18:05:43 -0400 Message-Id: <20170913220546.19560-21-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 Subject: [U-Boot] [PATCH v3 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) {