Re: [PATCH v2 5/9] vgacon: remove screen_info dependency
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
- To: Arnd Bergmann <arnd@xxxxxxxxxx>, linux-fbdev@xxxxxxxxxxxxxxx, Thomas Zimmermann <tzimmermann@xxxxxxx>, Helge Deller <deller@xxxxxx>, Javier Martinez Canillas <javierm@xxxxxxxxxx>
- Subject: Re: [PATCH v2 5/9] vgacon: remove screen_info dependency
- From: Philippe Mathieu-Daudé <philmd@xxxxxxxxxx>
- Date: Wed, 19 Jul 2023 15:49:22 +0200
- Cc: Arnd Bergmann <arnd@xxxxxxxx>, "David S. Miller" <davem@xxxxxxxxxxxxx>, "K. Y. Srinivasan" <kys@xxxxxxxxxxxxx>, Ard Biesheuvel <ardb@xxxxxxxxxx>, Borislav Petkov <bp@xxxxxxxxx>, Brian Cain <bcain@xxxxxxxxxxx>, Catalin Marinas <catalin.marinas@xxxxxxx>, Christophe Leroy <christophe.leroy@xxxxxxxxxx>, Daniel Vetter <daniel@xxxxxxxx>, Dave Hansen <dave.hansen@xxxxxxxxxxxxxxx>, David Airlie <airlied@xxxxxxxxx>, Deepak Rawat <drawat.floss@xxxxxxxxx>, Dexuan Cui <decui@xxxxxxxxxxxxx>, Dinh Nguyen <dinguyen@xxxxxxxxxx>, Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>, Guo Ren <guoren@xxxxxxxxxx>, Haiyang Zhang <haiyangz@xxxxxxxxxxxxx>, Huacai Chen <chenhuacai@xxxxxxxxxx>, Ingo Molnar <mingo@xxxxxxxxxx>, John Paul Adrian Glaubitz <glaubitz@xxxxxxxxxxxxxxxxxxx>, Khalid Aziz <khalid@xxxxxxxxxxxxxx>, Linus Walleij <linus.walleij@xxxxxxxxxx>, Matt Turner <mattst88@xxxxxxxxx>, Max Filippov <jcmvbkbc@xxxxxxxxx>, Michael Ellerman <mpe@xxxxxxxxxxxxxx>, Nicholas Piggin <npiggin@xxxxxxxxx>, Palmer Dabbelt <palmer@xxxxxxxxxxx>, Russell King <linux@xxxxxxxxxxxxxxx>, Thomas Bogendoerfer <tsbogend@xxxxxxxxxxxxxxxx>, Thomas Gleixner <tglx@xxxxxxxxxxxxx>, WANG Xuerui <kernel@xxxxxxxxxx>, Wei Liu <wei.liu@xxxxxxxxxx>, Will Deacon <will@xxxxxxxxxx>, x86@xxxxxxxxxx, linux-alpha@xxxxxxxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx, linux-arm-kernel@xxxxxxxxxxxxxxxxxxx, linux-efi@xxxxxxxxxxxxxxx, linux-csky@xxxxxxxxxxxxxxx, linux-hexagon@xxxxxxxxxxxxxxx, linux-ia64@xxxxxxxxxxxxxxx, loongarch@xxxxxxxxxxxxxxx, linux-mips@xxxxxxxxxxxxxxx, linuxppc-dev@xxxxxxxxxxxxxxxx, linux-riscv@xxxxxxxxxxxxxxxxxxx, linux-sh@xxxxxxxxxxxxxxx, sparclinux@xxxxxxxxxxxxxxx, linux-hyperv@xxxxxxxxxxxxxxx, dri-devel@xxxxxxxxxxxxxxxxxxxxx
- In-reply-to: <20230719123944.3438363-6-arnd@kernel.org>
- References: <20230719123944.3438363-1-arnd@kernel.org> <20230719123944.3438363-6-arnd@kernel.org>
- User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.13.0
Hi Arnd,
On 19/7/23 14:39, Arnd Bergmann wrote:
From: Arnd Bergmann <arnd@xxxxxxxx>
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 <arnd@xxxxxxxx>
---
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;
+}
[Index of Archives]
[Linux Kernel]
[Sparc Linux]
[DCCP]
[Linux ARM]
[Yosemite News]
[Linux SCSI]
[Linux x86_64]
[Linux for Ham Radio]