Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

vgacon: drop BROKEN_GRAPHICS_PROGRAMS

BROKEN_GRAPHICS_PROGRAMS is defined when CONFIG_VGA_CONSOLE=y. And
vgacon.c is built exclusively in that case too. So the check for
BROKEN_GRAPHICS_PROGRAMS is pointless in vgacon.c as it is always true.
So remove the test and BROKEN_GRAPHICS_PROGRAMS completely.

This also eliminates the need for vga_font_is_default global as it is
only set and never read.

Cc: dri-devel@lists.freedesktop.org
Cc: linux-fbdev@vger.kernel.org
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Link: https://lore.kernel.org/r/20210105120239.28031-9-jslaby@suse.cz
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Jiri Slaby and committed by
Greg Kroah-Hartman
cac8a630 ff2047fb

-31
-19
drivers/video/console/vgacon.c
··· 90 90 static bool vga_can_do_color; /* Do we support colors? */ 91 91 static unsigned int vga_default_font_height __read_mostly; /* Height of default screen font */ 92 92 static unsigned char vga_video_type __read_mostly; /* Card type */ 93 - static bool vga_font_is_default = true; 94 93 static int vga_vesa_blanked; 95 94 static bool vga_palette_blanked; 96 95 static bool vga_is_gfx; ··· 877 878 beg = 0x0a; 878 879 } 879 880 880 - #ifdef BROKEN_GRAPHICS_PROGRAMS 881 881 /* 882 882 * All fonts are loaded in slot 0 (0:1 for 512 ch) 883 883 */ ··· 884 886 if (!arg) 885 887 return -EINVAL; /* Return to default font not supported */ 886 888 887 - vga_font_is_default = false; 888 889 font_select = ch512 ? 0x04 : 0x00; 889 - #else 890 - /* 891 - * The default font is kept in slot 0 and is never touched. 892 - * A custom font is loaded in slot 2 (256 ch) or 2:3 (512 ch) 893 - */ 894 - 895 - if (set) { 896 - vga_font_is_default = !arg; 897 - if (!arg) 898 - ch512 = false; /* Default font is always 256 */ 899 - font_select = arg ? (ch512 ? 0x0e : 0x0a) : 0x00; 900 - } 901 - 902 - if (!vga_font_is_default) 903 - charmap += 4 * cmapsz; 904 - #endif 905 890 906 891 raw_spin_lock_irq(&vga_lock); 907 892 /* First, the Sequencer */
-12
include/linux/vt_kern.h
··· 16 16 #include <linux/consolemap.h> 17 17 #include <linux/notifier.h> 18 18 19 - /* 20 - * Presently, a lot of graphics programs do not restore the contents of 21 - * the higher font pages. Defining this flag will avoid use of them, but 22 - * will lose support for PIO_FONTRESET. Note that many font operations are 23 - * not likely to work with these programs anyway; they need to be 24 - * fixed. The linux/Documentation directory includes a code snippet 25 - * to save and restore the text font. 26 - */ 27 - #ifdef CONFIG_VGA_CONSOLE 28 - #define BROKEN_GRAPHICS_PROGRAMS 1 29 - #endif 30 - 31 19 void kd_mksound(unsigned int hz, unsigned int ticks); 32 20 int kbd_rate(struct kbd_repeat *rep); 33 21