From patchwork Fri Jul 7 09:52:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 117076 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp3158332vqx; Fri, 7 Jul 2023 03:18:39 -0700 (PDT) X-Google-Smtp-Source: APBJJlE+aAVxqUsN46n+NqZKq/QAE0CIApsbTnz8Iwdh9PgSU/GXtOOySdMKRWt8f3Fe5hKer+wb X-Received: by 2002:a9d:7a83:0:b0:6b7:1e57:aa96 with SMTP id l3-20020a9d7a83000000b006b71e57aa96mr4587457otn.6.1688725119400; Fri, 07 Jul 2023 03:18:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688725119; cv=none; d=google.com; s=arc-20160816; b=XcRGvP3XYcl5ULnvCSfN7jmu357E92+a/nvQtHQbFTk1n+Fwr+FOCfqH+x+CVRYFhH pJzhHRojNL8p7MeScP1gOWBQW6PQxfc7wZr3nth78GxrT+y/4aHn7+gteu8nRDJa1PtE v0nie1E5gjdm+iZ3MAQrCp5mYA6rIL1iajyd8SpW76CgItUK/A3p/cstNec4fDY3aRdT IYCYFveTy5LwUBrfIn/3i7YltNOquaIKuX3GQbeFnepwivAOKgKnyOQB1okkkQKAnlqO zP+PMMRMKr2z3pxzd7w/sjEV/JG2PVafEYYKGddI9k0ougknX15ZYKCJGtK/e0pCPHTD 62Ng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=cFsufhx02R3N6gySg4BfuQl3r0MTOrfXVx7qg3p6fco=; fh=lfxYWWE5npP/X1+MXiRtUZPaJT/qimzGu0Y9uGV9uWc=; b=mGQyEnNfQ2LQ09Lkbf67KkIwamKKi4kesBWCFDrfASLvfYhvwGY5f3PkwKigoaianJ wxwXdGeSFRAHHjBoi8D+RGyYcpb14hVd7vhdpqTOgtfQja9t8jZrMJLrfDS+x86jRlx9 sJEtVpW7a42CiS7x3R3Ho+vxwrn7slH7KuC6aSJXMgOLoPSqMbPw3/qIBOhSm7hdugIx JQakctTL3pkJHRZl7OqSl6il5bsAt+3DOAOC2eIXeduROwfVvAq9U7Yd8+wUA1kT50z7 x2ghFMteDjmnWyoY07df6Lm8cvI39ViJe3NH2QysQfCMMjAekJaxrUTaneu9spKmybPU sVmA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=m46OaoBs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i4-20020a63e444000000b0055bc30ae086si3500743pgk.594.2023.07.07.03.18.24; Fri, 07 Jul 2023 03:18:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=m46OaoBs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233016AbjGGJ5h (ORCPT + 99 others); Fri, 7 Jul 2023 05:57:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33310 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232882AbjGGJ41 (ORCPT ); Fri, 7 Jul 2023 05:56:27 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 01B7926B6; Fri, 7 Jul 2023 02:56:00 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 7D30561929; Fri, 7 Jul 2023 09:56:00 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 262D9C433C7; Fri, 7 Jul 2023 09:55:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1688723759; bh=ZlrPUR4qDwFuSSAmVs8BdIFko0degkyaq4+ixUSpArQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=m46OaoBs45HlaUEZMk7dtWry+k569Hsec688GU34tSmZ+dRaDfCZgbatKcMkoJb4W L+0sjRZOaq7fnXzEKqBRJ2P+kPiY3iobRJLvCN7cmCiV7bvnwyfCb9oLGJRV8u+INh nnkcI5UabsNZZTkO/zaZ+OeDPuMeskyUoUAeflYFXT70X/eLC7KMD+HtNQ0mnLxBxr 9nrfbs3wYnhn+evE0EBsrUQ0eGoYcbj65uoozC1VZHBXTFuYTc52YtRPNOlifWzWQl BkXonaqPwL/TgLz1wZZAGwrEB4yqcrZb4E2SD8mf6sEm0HkkcApeZku5KPb+vS/sz2 WGPb0b0Bu/Fyw== From: Arnd Bergmann To: Thomas Zimmermann Cc: javierm@redhat.com, linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org, Russell King , dri-devel@lists.freedesktop.org, Ard Biesheuvel , Helge Deller , Greg Kroah-Hartman , Arnd Bergmann , Linus Walleij , "Russell King (Oracle)" , linux-arm-kernel@lists.infradead.org Subject: [PATCH 3/4] dummycon: limit Arm console size hack to footbridge Date: Fri, 7 Jul 2023 11:52:25 +0200 Message-Id: <20230707095415.1449376-3-arnd@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230707095415.1449376-1-arnd@kernel.org> References: <20230707095415.1449376-1-arnd@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1770756630562941390?= X-GMAIL-MSGID: =?utf-8?q?1770756630562941390?= From: Arnd Bergmann The dummycon default console size used to be determined by architecture, but now this is a Kconfig setting on everything except ARM. Tracing this back in the historic git trees, this was used to match the size of VGA console or VGA framebuffer on early machines, but nowadays that code is no longer used, except probably on the old footbridge/netwinder since that is the only one that supports vgacon. On machines with a framebuffer, booting with DT so far results in always using the hardcoded 80x30 size in dummycon, while on ATAGS the setting can come from a bootloader specific override. Both seem to be worse choices than the Kconfig setting, since the actual text size for fbcon also depends on the selected font. Make this work the same way as everywhere else and use the normal Kconfig setting, except for the footbridge with vgacon, which keeps using the traditional code. If vgacon is disabled, footbridge can also ignore the setting. This means the screen_info only has to be provided when either vgacon or EFI are enabled now. To limit the amount of surprises on Arm, change the Kconfig default to the previously used 80x30 setting instead of the usual 80x25. Signed-off-by: Arnd Bergmann Tested-by: Linus Walleij Reviewed-by: Javier Martinez Canillas --- arch/arm/kernel/atags_parse.c | 2 +- arch/arm/kernel/setup.c | 3 +-- drivers/video/console/Kconfig | 5 +++-- drivers/video/console/dummycon.c | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/arch/arm/kernel/atags_parse.c b/arch/arm/kernel/atags_parse.c index 33f6eb5213a5a..4c815da3b77b0 100644 --- a/arch/arm/kernel/atags_parse.c +++ b/arch/arm/kernel/atags_parse.c @@ -69,7 +69,7 @@ static int __init parse_tag_mem32(const struct tag *tag) __tagtable(ATAG_MEM, parse_tag_mem32); -#if defined(CONFIG_VGA_CONSOLE) || defined(CONFIG_DUMMY_CONSOLE) +#if defined(CONFIG_ARCH_FOOTBRIDGE) && defined(CONFIG_VGA_CONSOLE) static int __init parse_tag_videotext(const struct tag *tag) { screen_info.orig_x = tag->u.videotext.x; diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c index c66b560562b30..40326a35a179b 100644 --- a/arch/arm/kernel/setup.c +++ b/arch/arm/kernel/setup.c @@ -928,8 +928,7 @@ static void __init request_standard_resources(const struct machine_desc *mdesc) request_resource(&ioport_resource, &lp2); } -#if defined(CONFIG_VGA_CONSOLE) || defined(CONFIG_DUMMY_CONSOLE) || \ - defined(CONFIG_EFI) +#if defined(CONFIG_VGA_CONSOLE) || defined(CONFIG_EFI) struct screen_info screen_info = { .orig_video_lines = 30, .orig_video_cols = 80, diff --git a/drivers/video/console/Kconfig b/drivers/video/console/Kconfig index 47c498defc211..a3e4e9a6bf79d 100644 --- a/drivers/video/console/Kconfig +++ b/drivers/video/console/Kconfig @@ -52,7 +52,7 @@ config DUMMY_CONSOLE config DUMMY_CONSOLE_COLUMNS int "Initial number of console screen columns" - depends on DUMMY_CONSOLE && !ARM + depends on DUMMY_CONSOLE && !ARCH_FOOTBRIDGE default 160 if PARISC default 80 help @@ -62,8 +62,9 @@ config DUMMY_CONSOLE_COLUMNS config DUMMY_CONSOLE_ROWS int "Initial number of console screen rows" - depends on DUMMY_CONSOLE && !ARM + depends on DUMMY_CONSOLE && !ARCH_FOOTBRIDGE default 64 if PARISC + default 30 if ARM default 25 help On PA-RISC, the default value is 64, which should fit a 1280x1024 diff --git a/drivers/video/console/dummycon.c b/drivers/video/console/dummycon.c index f1711b2f9ff05..70549fecee12c 100644 --- a/drivers/video/console/dummycon.c +++ b/drivers/video/console/dummycon.c @@ -18,7 +18,7 @@ * Dummy console driver */ -#if defined(__arm__) +#if defined(CONFIG_ARCH_FOOTBRIDGE) && defined(CONFIG_VGA_CONSOLE) #define DUMMY_COLUMNS screen_info.orig_video_cols #define DUMMY_ROWS screen_info.orig_video_lines #else