[PATCH v2 5/9] vgacon: remove screen_info dependency
Arnd Bergmann
arnd at arndb.de
Wed Jul 19 07:38:57 PDT 2023
On Wed, Jul 19, 2023, at 15:49, Philippe Mathieu-Daudé wrote:
> On 19/7/23 14:39, Arnd Bergmann wrote:
>> @@ -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.
>
I think it cannot happen because the only way that anything calls
into vgacon.c is through the "conswitchp = &vga_con;" that now happens
at the same time as the "vga_si = &screen_info;". It's definitely
possible that I'm missing something as well here.
Arnd
More information about the linux-riscv
mailing list