Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp8217829rwp; Wed, 19 Jul 2023 06:59:10 -0700 (PDT) X-Google-Smtp-Source: APBJJlEKuG5GkeKWlYQwckqUdO+UkncpxyzDoPWQmhxshMvsLXQ/sZXKM/VtUoEfXPclAvJy9GjG X-Received: by 2002:a05:6a00:995:b0:686:4733:44da with SMTP id u21-20020a056a00099500b00686473344damr1769663pfg.7.1689775150149; Wed, 19 Jul 2023 06:59:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689775150; cv=none; d=google.com; s=arc-20160816; b=0y43bWa6ANSu0i2I/T5SHdXaJdBRsZfl+wBhAcL//RoNt91UjDy+FWTqQimUYYO/sh p/6kjiCsyCMJjnrpr+y9A+1qVDYDwiYdDM5VCeRTCpMdntPPdKqQEgp1WAJS6kEQwC65 GA1PxiNCvSYmX163VU8HWi+1IytTAcuGhUrOw1EF9mK6Zg1FAv0zDfK7pz3Gzr67i3eP Io44d8g8xZbSWb0Zk+IS1urMfXu0K6CvUBi14yqetyR4YUkDflkmAco8+sxPVCVJAt9U D4NxIvWjJoNHCKjrB0NsVrI5E1Ajgv5ne4xCHT+EAZq9r0DF7ydkEiZL6JN0W3YWz9LT VWyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=JeaSSoZd0P4aBDcnBZ8BgOhayrU2NW5OGYbO05NkL/4=; fh=qQsfIRe+KrHos14OylI1b5eq80a7yfSyp0vtjelkOXc=; b=QCFTSLvMB51g2f34Ow9GZqliWfTRyiP94vE6zgHD8XNq8Ci3x5ltjo8FQn2UN3UJsG NyVlrPM+zm396nLxfCg883eRHeD7W6fKw/kw5RDW6N+eHHYvlR2ZMCkl9WXVP22HavJ1 QPeKtAyMEX1CUs8Ws8xipxiZHp080caWMCjZSMNFBPoTN6T/H57XAEixyBcVD9ceXU9S 40vlRmk3mQZFwL2wgP0ijujPkugvAqTkljfYD0LVLOsg0y6lSH5W/8o9kjfnyligHykx HklgTSOwEwi1R2Uvj4O6OfZVA3cLaiqWldp5kbA7GFNVjT8JI06Lv+i+PucYkjG+GLfp kIrA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=mSLGK2c7; 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=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j184-20020a6380c1000000b0055ffed90ccasi3471239pgd.459.2023.07.19.06.58.57; Wed, 19 Jul 2023 06:59:10 -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=@linaro.org header.s=google header.b=mSLGK2c7; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231274AbjGSNuC (ORCPT + 99 others); Wed, 19 Jul 2023 09:50:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34000 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231252AbjGSNt6 (ORCPT ); Wed, 19 Jul 2023 09:49:58 -0400 Received: from mail-wr1-x430.google.com (mail-wr1-x430.google.com [IPv6:2a00:1450:4864:20::430]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E34B31993 for ; Wed, 19 Jul 2023 06:49:31 -0700 (PDT) Received: by mail-wr1-x430.google.com with SMTP id ffacd0b85a97d-3142970df44so6510584f8f.3 for ; Wed, 19 Jul 2023 06:49:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1689774570; x=1692366570; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=JeaSSoZd0P4aBDcnBZ8BgOhayrU2NW5OGYbO05NkL/4=; b=mSLGK2c7L5EE4FfadrFnGKrx8rHqMorl3CkK/H11fHsq3cy4XSsKtutECoQcxj7VUH 6217O/9tcynPgDcZCiS5kwgKPRQ9yaxcBfet9pGpjP3OtetZCluXE3f4KQeLL37dXcdq Shyafc4xZzvzAf3/I3duYT0A6Lan59ePh67EPf8B6LGZv9LJEeK4tH3b6lkOaji6veEW jV3wN5L8eRb0FEZEQdFL5i8bBvckl20VHoXJydGdhlh18d4M6Z7KwE4oD2NfJGaix4SY m60NOgE8+OkCmcQdiCC141H+NDbenv1Kvjlt/AYNlG4in4PaDFI5cUWT/kWWjIB6GhTf 8q+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689774570; x=1692366570; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=JeaSSoZd0P4aBDcnBZ8BgOhayrU2NW5OGYbO05NkL/4=; b=BcbtgEDax43PELLn+bGVBQMz8jfsaRgW+5k72uW3VM0L5TDcf/8budajno7ZsYCccV baK0mRdICP6jxP5pDRNyLtJZcsDf/QUiP5j7Xpq8gQve79G81/ih/im/yfh4vq+CRML9 Azn1mfiIs0DQj4WgfZNXJJ9CEyipyR/w1c75Gsxffh6+9rswiKejXu3D/7laHjg8eMnm nsEccfy0A/YKc2jF8alyBkj+7iAcdXf2L270OW0FS3x1kq4tzsJ/p2J2yZoyN8ZSLzYx WQpOWziDozx/qhII6kYx008GjMT2x6ffjtdLzciQehn0/HCG/h0EPY9qE67jX9FxLVXe mjbA== X-Gm-Message-State: ABy/qLZ6TKVIjZRHaYsJQV7xrRc1mwgVga9JuY/D/HVFTRAkEUphWyE/ 4NG8RtPPnOKbDenXD5uJPmpxiQ== X-Received: by 2002:adf:d0d1:0:b0:314:824:3777 with SMTP id z17-20020adfd0d1000000b0031408243777mr13524380wrh.48.1689774570336; Wed, 19 Jul 2023 06:49:30 -0700 (PDT) Received: from [192.168.69.115] ([176.187.201.220]) by smtp.gmail.com with ESMTPSA id w17-20020adfde91000000b00315a57f1128sm5357828wrl.115.2023.07.19.06.49.23 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 19 Jul 2023 06:49:29 -0700 (PDT) Message-ID: <32595080-dd79-5cf0-46e7-b82d0df8f067@linaro.org> Date: Wed, 19 Jul 2023 15:49:22 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: [PATCH v2 5/9] vgacon: remove screen_info dependency Content-Language: en-US To: Arnd Bergmann , linux-fbdev@vger.kernel.org, Thomas Zimmermann , Helge Deller , Javier Martinez Canillas Cc: Arnd Bergmann , "David S. Miller" , "K. Y. Srinivasan" , Ard Biesheuvel , Borislav Petkov , Brian Cain , Catalin Marinas , Christophe Leroy , Daniel Vetter , Dave Hansen , David Airlie , Deepak Rawat , Dexuan Cui , Dinh Nguyen , Greg Kroah-Hartman , Guo Ren , Haiyang Zhang , Huacai Chen , Ingo Molnar , John Paul Adrian Glaubitz , Khalid Aziz , Linus Walleij , Matt Turner , Max Filippov , Michael Ellerman , Nicholas Piggin , Palmer Dabbelt , Russell King , Thomas Bogendoerfer , Thomas Gleixner , WANG Xuerui , Wei Liu , Will Deacon , x86@kernel.org, linux-alpha@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-efi@vger.kernel.org, linux-csky@vger.kernel.org, linux-hexagon@vger.kernel.org, linux-ia64@vger.kernel.org, loongarch@lists.linux.dev, linux-mips@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-riscv@lists.infradead.org, linux-sh@vger.kernel.org, sparclinux@vger.kernel.org, linux-hyperv@vger.kernel.org, dri-devel@lists.freedesktop.org References: <20230719123944.3438363-1-arnd@kernel.org> <20230719123944.3438363-6-arnd@kernel.org> From: =?UTF-8?Q?Philippe_Mathieu-Daud=c3=a9?= In-Reply-To: <20230719123944.3438363-6-arnd@kernel.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED autolearn=unavailable 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 Hi Arnd, On 19/7/23 14:39, Arnd Bergmann wrote: > From: Arnd Bergmann > > The vga console driver is fairly self-contained, and only used by > architectures that explicitly initialize the screen_info settings. > > Chance every instance that picks the vga console by setting conswitchp > to call a function instead, and pass a reference to the screen_info > there. > > Signed-off-by: Arnd Bergmann > --- > arch/alpha/kernel/setup.c | 2 +- > arch/arm/kernel/setup.c | 2 +- > arch/ia64/kernel/setup.c | 2 +- > arch/mips/kernel/setup.c | 2 +- > arch/x86/kernel/setup.c | 2 +- > drivers/firmware/pcdp.c | 2 +- > drivers/video/console/vgacon.c | 68 ++++++++++++++++++++-------------- > include/linux/console.h | 7 ++++ > 8 files changed, 53 insertions(+), 34 deletions(-) > @@ -1074,13 +1077,13 @@ static int vgacon_resize(struct vc_data *c, unsigned int width, > * Ho ho! Someone (svgatextmode, eh?) may have reprogrammed > * the video mode! Set the new defaults then and go away. > */ > - screen_info.orig_video_cols = width; > - screen_info.orig_video_lines = height; > + vga_si->orig_video_cols = width; > + vga_si->orig_video_lines = height; > vga_default_font_height = c->vc_cell_height; > return 0; > } > - if (width % 2 || width > screen_info.orig_video_cols || > - height > (screen_info.orig_video_lines * vga_default_font_height)/ > + if (width % 2 || width > vga_si->orig_video_cols || > + height > (vga_si->orig_video_lines * vga_default_font_height)/ > c->vc_cell_height) > return -EINVAL; > > @@ -1110,8 +1113,8 @@ static void vgacon_save_screen(struct vc_data *c) > * console initialization routines. > */ > vga_bootup_console = 1; > - c->state.x = screen_info.orig_x; > - c->state.y = screen_info.orig_y; > + c->state.x = vga_si->orig_x; > + c->state.y = vga_si->orig_y; Not really my area, so bare with me if this is obviously not possible :) If using DUMMY_CONSOLE, can we trigger a save_screen / resize? If so, we'd reach here with vga_si=NULL. > } > > /* We can't copy in more than the size of the video buffer, > @@ -1204,4 +1207,13 @@ const struct consw vga_con = { > }; > EXPORT_SYMBOL(vga_con); > > +void vgacon_register_screen(struct screen_info *si) > +{ > + if (!si || vga_si) > + return; > + > + conswitchp = &vga_con; > + vga_si = si; > +}