Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.2 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D4864C4338F for ; Sat, 7 Aug 2021 06:57:43 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9517B61163 for ; Sat, 7 Aug 2021 06:57:42 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 9517B61163 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmx.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 9258282C24; Sat, 7 Aug 2021 08:57:39 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=gmx.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; secure) header.d=gmx.net header.i=@gmx.net header.b="d/bO4jlH"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id E13D482C89; Sat, 7 Aug 2021 08:57:37 +0200 (CEST) Received: from mout.gmx.net (mout.gmx.net [212.227.15.19]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 896A482C04 for ; Sat, 7 Aug 2021 08:57:34 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmx.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=xypron.glpk@gmx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1628319442; bh=SWZ87ArSNDGiMooYBi+MKIQzSsIxdqxRJnPWSyXtg5g=; h=X-UI-Sender-Class:Subject:To:Cc:References:From:Date:In-Reply-To; b=d/bO4jlHsTN1gixrWZJQWM7OYec33wQ1Szz6B8sEfUhOEzatpO8Kwx1g/KUIgoAYu 3/7lIOMulMt02YgUuXXVYTypIylVqhCJFqJj1EDNO4q8UQtUtTVscg3M/eSUAA/54w hLrv3V4Vbl+W3uXb7cKNrQV9sJB/2sj3JQSqKAY4= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from [192.168.123.35] ([88.152.144.157]) by mail.gmx.net (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1N9dsV-1nFcKy42XF-015brj; Sat, 07 Aug 2021 08:57:22 +0200 Subject: Re: [PATCH 3/4] EFI: console: max rows and cols user limit To: Art Nikpal Cc: Neil Armstrong , u-boot@lists.denx.de, u-boot-amlogic@groups.io, agraf@csgraf.de, trini@konsulko.com, Christian Hewitt , Artem Lapkin , Nick Xie , Gouwa Wang References: <20210804102217.2419510-1-art@khadas.com> <20210804102217.2419510-4-art@khadas.com> From: Heinrich Schuchardt Message-ID: <55d1c70b-e7fd-7d4a-a4a3-aea5345fa46c@gmx.de> Date: Sat, 7 Aug 2021 08:57:09 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:vpJdzTq71m69tLXcRQml7NSvqF59ivAak7RLdIQK8fazyXo6z2H xqvLnfNKdLX+jUjeGEkB25WafVj23ZKmKTOtxqkcW9Cw3JgW20vptHaanRUpgqdqGB4t4h3 /jyfGrzS3Va2elyQjSHNfXXAOHFcabZ47Bf6WVIqkMavIhT2dn7MAo8oweOJparsAmUqdcn 2Mfs4ea77Lhylpboxf5Ig== X-UI-Out-Filterresults: notjunk:1;V03:K0:8Dn1VB1dPuI=:bPO1xe+fUGvybaz79l3f23 tbPcUFTzDeK3PruRrFlf0pVWU8VSvBwjbTav+W6zpNJPnSWjWzgp8BY8/0nqd0bPDi7oAfOrA Oh5MlJXCWuarPD03azL/iZXFqA5uuQNE/+rdDc/cF/pTAa2UqnOiz9JhAsLUbkYS32814P8w9 5aj8aQSvd9aRqMyi+6+bmdbJ2HBX42v/2kzxMdH75ORDhUGbFcK++fCiw9IlAcXGg++lKAmjE Cg5RLumeChE9dLRSVVH4+6Xirnj5Oc1/MVvbTOCmCJD6JZBU7prNW/r8KqC6LBJYiDTswIzL6 AY9rK3ee4qv9zypYhLk/0T85EqnRtI0sE7iXqLU95IM830zrO7eXEYSb5RhpRuAphrQBUrgNn kLfIzDaIs5I4KT+dytAbcChoDiOkk/auajXGieR6klXxs5eVxVsW74f/1qX7rHsIHvFOn7b6V sOEX4VrKWmd99mIXzzvRJuCxjuGGhRp8Rf1VkJrEHauarKejqszRN57p1Gp4PWD749dZVVetC NSLu3ckfMIbwJnjzuDnE8Bv7A02/BkPNvoQuNDhTsecUvbmtnUMcrM5vZ0Vvvm+ITfBXjUa4M bazA2eqI+9tWVxxt6SpbtQpkWxsUi4tRGA/QYLNfsUPjJp63NerTaqChoXjiXxz3Tue5sTIUs 86yw5yn0wM4LI9GrtEFKgRuGGi/s1r9YU8IytDVsw9eJrXRjO+DwgiJ854KYrV5yUxZY15r8q nIyybtqGeLAjVPTwcnu599YF4eJkND3CLuP5fpcGt24InoavMNNSxWmrnaFX+DlV8R1qom2ui 8d/JT8uxYrCe0ijeXd7stj177bdg4wvwUBwSVKtp8vHdntD1Xxsr/4gFgJ3C/SNK7jjv5jREL vpRDNcMcDrW+P9pHF8dsFCNPq2tHGoTEE4qJvjTJDxJ91XCRSkHPmtYXS7bfhziuBH2EUKMgu X3slfU0SUgUbs2GLRSwIQdRaGABq0MsnM39H2pCachkm5nccH/kwEaKqvWDG5zCzwb0kt7T19 PUQT9+Du0JstG6lLZ7MbAP2+BaVDa09LBQNSte2EjBKe8vGB2vCwisc2akK7SYx4wCKepPpHg kul9GqaALwHivTp7D0bn9HF9u++8m1jXr0kajygOyHuXZ0KY4bg73KQRQ== X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean On 8/6/21 9:58 AM, Art Nikpal wrote: >> Why should a user set this up? > > only if user need it! by default is 0 no limit > > EFI console not usable for some cases: big screen sizes + mux with > serial console > > for example > > EFI console - fullscreen (1080P) vidconsole - SLUGGISH FRAMERATES AND NO= T USABLE > > CONFIG_CONSOLE_MUX=3Dy > CONFIG_CONSOLE_NORMAL=3Dy > CONFIG_EFI_CONSOLE_MAX_ROWS=3D0 > CONFIG_EFI_CONSOLE_MAX_COLS=3D0 > > https://dl.khadas.com/test/uboot_efi_examples/media/07-EFI_console_examp= le_normal_vidconsole_and_serial_multiplex_adaptation_utf_safe_SLOW_NOT_USA= BLE.mp4 > > EFI console - vidconsole with row and column limits - USABLE FRAMERATES > > CONFIG_CONSOLE_MUX=3Dy > CONFIG_CONSOLE_NORMAL=3Dy > CONFIG_EFI_CONSOLE_MAX_ROWS=3D90 > CONFIG_EFI_CONSOLE_MAX_COLS=3D25 > > https://dl.khadas.com/test/uboot_efi_examples/media/06-EFI_console_examp= le_normal_vidconsole_and_serial_multiplex_adaptation_utf_safe_and_max_cols= _90_limit_USABLE.mp4 > > Please check more information and examples about this > > + https://dl.khadas.com/test/uboot_efi_examples/#readme > > > On Thu, Aug 5, 2021 at 7:59 PM Heinrich Schuchardt = wrote: >> >> On 8/4/21 12:22 PM, Artem Lapkin wrote: >>> Setup the max rows and columns limit for the EFI console output. >> >> Why should a user set this up? >> >> The size of serial console depends on the remote computers console >> windows size. >> >> The size of a video console depends on the attached monitor. >> >> So we have to detect the size dynamically. Hardcoding it does not make >> any sense. >> >> Best regards >> >> Heinrich >> >>> >>> Signed-off-by: Artem Lapkin >>> --- >>> lib/efi_loader/Kconfig | 12 ++++++++++++ >>> lib/efi_loader/efi_console.c | 5 +++++ >>> 2 files changed, 17 insertions(+) >>> >>> diff --git a/lib/efi_loader/Kconfig b/lib/efi_loader/Kconfig >>> index dacc3b5881..7d00d6cde5 100644 >>> --- a/lib/efi_loader/Kconfig >>> +++ b/lib/efi_loader/Kconfig >>> @@ -381,4 +381,16 @@ config EFI_ESRT >>> help >>> Enabling this option creates the ESRT UEFI system table. >>> >>> +config EFI_CONSOLE_MAX_ROWS >>> + int "setup console max rows" This allows negative values. Add an allowable range, e.g: range 0 65535 >>> + default 0 >>> + help >>> + Set console max rows limit or set to zero to disable limit. >>> + >>> +config EFI_CONSOLE_MAX_COLS >>> + int "setup console max cols" range 0 65535 >>> + default 0 >>> + help >>> + Set console max rows limit or set to zero to disable limit. >>> + >>> endif >>> diff --git a/lib/efi_loader/efi_console.c b/lib/efi_loader/efi_console= .c >>> index 847069212e..b5d79d788f 100644 >>> --- a/lib/efi_loader/efi_console.c >>> +++ b/lib/efi_loader/efi_console.c >>> @@ -351,6 +351,11 @@ static void query_console_size(void) >>> } else if (query_console_serial(&rows, &cols)) >>> return; >>> >>> + if (CONFIG_EFI_CONSOLE_MAX_ROWS > 0) >>> + rows =3D min(rows, CONFIG_EFI_CONSOLE_MAX_ROWS); >>> + if (CONFIG_EFI_CONSOLE_MAX_COLS > 0) >>> + cols =3D min(cols, CONFIG_EFI_CONSOLE_MAX_COLS); >>> + We should not neither call query_vidconsole() nor query_console_serial() if both CONFIG_EFI_CONSOLE_MAX_ROWS and CONFIG_EFI_CONSOLE_MAX_COLS are se= t. The UEFI specification requires that a device providing the EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL must at least support a mode with size 80x25. But some LCD screens are smaller. So if CONFIG_EFI_CONSOLE_MAX_ROWS or CONFIG_EFI_CONSOLE_MAX_COLS doesn't fit into 80x25, we should use CONFIG_EFI_CONSOLE_MAX_ROWS and CONFIG_EFI_CONSOLE_MAX_COLS for mode 0. Best regards Heinrich >>> /* Test if we can have Mode 1 */ >>> if (cols >=3D 80 && rows >=3D 50) { >>> efi_cout_modes[1].present =3D 1; >>> >>