From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 667F4C001E0 for ; Wed, 19 Jul 2023 13:50:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231449AbjGSNuF (ORCPT ); Wed, 19 Jul 2023 09:50:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33994 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231411AbjGSNt7 (ORCPT ); Wed, 19 Jul 2023 09:49:59 -0400 Received: from mail-wr1-x42e.google.com (mail-wr1-x42e.google.com [IPv6:2a00:1450:4864:20::42e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 79BF61BD5 for ; Wed, 19 Jul 2023 06:49:32 -0700 (PDT) Received: by mail-wr1-x42e.google.com with SMTP id ffacd0b85a97d-316f589549cso4060597f8f.1 for ; Wed, 19 Jul 2023 06:49:32 -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=SYDftmSbVOTcbv1LEjEPToZA0ETWtaeH2l95GemvbS2tON6Y1yL1jYWTvUddHRa0bx JFQYZtCo68XaizhSdkIBxBRGeo1NRmg+/1xPI5dxOMCHRMl9kpMGwUcHpCwZ2rP5uzq3 7gmCt7buNObU4IsJOpSn60JgGqjuGOVpXSw5+KFb3t0I9DmngQdGzfpzS8HeUP68VRD4 69aeXP6ifwHkCNBzJLwTYmVWHz2keh1UI+gflE5cp9gP/Q56h9TbeBD8QDbHkIxT2f/+ 2uqSPsMU3ZP+dGGlF3eAes2ePJh1f98+mNWF+t3vv9C/lIv4id33LDSxxvxuZZPim3MW z7Sg== X-Gm-Message-State: ABy/qLZfR7RB6JbfnBt0PA/h22rt4+9cZ1cTLOqM6mQRnNDdZhp6Kwbs BGQLZ199L2pGRjBcxKQEIGw3eg== X-Google-Smtp-Source: APBJJlEbRVrqi3m5ZvwiJaNOZocZP7fbMQ7EmoV04cKWj5tMJSoThE8C5X94lSqKcc5w5KB/JoRc7Q== 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 Precedence: bulk List-ID: X-Mailing-List: linux-csky@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; > +}