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=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT 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 9AC23C4338F for ; Wed, 4 Aug 2021 10:23:31 +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 E5B0960EB2 for ; Wed, 4 Aug 2021 10:23:30 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org E5B0960EB2 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com 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 D43FA82E1E; Wed, 4 Aug 2021 12:23:15 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="t96t04kL"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 834F482E7D; Wed, 4 Aug 2021 12:23:12 +0200 (CEST) Received: from mail-pj1-x1031.google.com (mail-pj1-x1031.google.com [IPv6:2607:f8b0:4864:20::1031]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 9094382E1E for ; Wed, 4 Aug 2021 12:23:02 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=email2tema@gmail.com Received: by mail-pj1-x1031.google.com with SMTP id l19so2338560pjz.0 for ; Wed, 04 Aug 2021 03:23:02 -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 :mime-version:content-transfer-encoding; bh=55Yfyg0FWF5oM+GUEHTp/Ta8y5jG6AmDuBYZbgDAnqY=; b=t96t04kLq9xXdyR3L2gXxAd7OhjDcwgTZF8F22pad2sSurHWp+EoKejMD5IDM5ui+s 0xaOdvecyjqZXt65Ho+pXaBCus7XxQbDY8sMu8bVBX3JFhW1AfuswSfeXhbPd6yK+vcO 8Kkn0nHWH/HB78u0kOZWTGiysi9ZTKQaLENNahBhbJrTvzpbASW0qrqcHzFxi2By+UCW uVKdsJ0MfjHsoknTquSjD98rCIco9mJm7sX0BGyL4LEwvDyXC9bn/qpJTFH2O6x7oJt3 nWiVEFF7dIqKxPU7AB/SIj9SMeLDIAtZhb5MvTOJPd5CLsuW+zK+2HjcS5KzRyIRR0YW wWpA== 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:mime-version:content-transfer-encoding; bh=55Yfyg0FWF5oM+GUEHTp/Ta8y5jG6AmDuBYZbgDAnqY=; b=It9LP9wyjg3knG0DghV8/cAfnumetLbPtkU4XxCfd14UU/f3p2E9FdW36TbMdmEsr3 xB4XBTJFv6+5+ST2AaOoIRG947KgPfb/nIT1u4ADCTNnd2gqJpVNAJmVVxerlt33zzra tNKkeLBEXeFkzceJEJB6D7HoACTd+WFebS5VRQ8m7Mh9SEJVErn6M4drENkmzQEwh1ZB jurFKvdpW19Vt47JdID69g3gN9HwngCmj2VIof3cU0yv8jmDRKnBlP9RMbooZP3dEnp1 Inlrx26UVn8BlBItPvZjrqJtCw+TOi2u0Oppwyq5ZiXsgWA4SWjDCNFGNzvGdZ/YXrbB +zMQ== X-Gm-Message-State: AOAM532afESzcE0iIH8MeUJx4zD3JfxlK/vGLU5DuLrQZ/bIwRhaT1sg N+k1F6a1F1Pn85Y8NVkCrpA= X-Google-Smtp-Source: ABdhPJx5aOnqEyTXGfBsNnOYc7BKX8TccGNeSiP10BYFyQkKCWh39MaSWprMb+1DZ9W3KLaqfoKluQ== X-Received: by 2002:a17:903:2352:b029:12c:afb8:fadb with SMTP id c18-20020a1709032352b029012cafb8fadbmr9389145plh.34.1628072580974; Wed, 04 Aug 2021 03:23:00 -0700 (PDT) Received: from localhost.localdomain (104.194.74.249.16clouds.com. [104.194.74.249]) by smtp.gmail.com with ESMTPSA id z14sm2291976pfr.121.2021.08.04.03.22.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Aug 2021 03:23:00 -0700 (PDT) From: Artem Lapkin X-Google-Original-From: Artem Lapkin To: narmstrong@baylibre.com Cc: u-boot@lists.denx.de, u-boot-amlogic@groups.io, xypron.glpk@gmx.de, agraf@csgraf.de, trini@konsulko.com, christianshewitt@gmail.com, art@khadas.com, nick@khadas.com, gouwa@khadas.com Subject: [PATCH 3/4] EFI: console: max rows and cols user limit Date: Wed, 4 Aug 2021 18:22:16 +0800 Message-Id: <20210804102217.2419510-4-art@khadas.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210804102217.2419510-1-art@khadas.com> References: <20210804102217.2419510-1-art@khadas.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 Setup the max rows and columns limit for the EFI console output. 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" + 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" + 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 = min(rows, CONFIG_EFI_CONSOLE_MAX_ROWS); + if (CONFIG_EFI_CONSOLE_MAX_COLS > 0) + cols = min(cols, CONFIG_EFI_CONSOLE_MAX_COLS); + /* Test if we can have Mode 1 */ if (cols >= 80 && rows >= 50) { efi_cout_modes[1].present = 1; -- 2.25.1