Skip to contentSkip to conversation

Skip setfont/getfont calls when card is already in graphics mode

PATCH New Dirk Mueller 1 participant 1 message Oct 4, 2017

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Skip setfont/getfont calls when card is already in graphics mode

The patch prevents setfont from accessing vga registers on the card when the card is in graphics mode KD_GRAPHICS as we assume, that someone else (ie. the Xserver) is in charge of the HW in which case accessing the vga registers may (at best) have no effect (not even the desired one) or (at worst) interfer with settings the graphics driver has made.

---
 drivers/video/console/vgacon.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/video/console/vgacon.c +2 -2
index 445b1dc5d441..1d948b159a05 100644
@@ -1259,7 +1259,7 @@ static int vgacon_font_set(struct vc_data *c, struct console_font *font, unsigne
 	unsigned charcount = font->charcount;
 	int rc;
 
-	if (vga_video_type < VIDEO_TYPE_EGAM)
+	if (vga_video_type < VIDEO_TYPE_EGAM || vga_is_gfx)
 		return -EINVAL;
 
 	if (font->width != VGA_FONTWIDTH ||
@@ -1277,7 +1277,7 @@ static int vgacon_font_set(struct vc_data *c, struct console_font *font, unsigne
 
 static int vgacon_font_get(struct vc_data *c, struct console_font *font)
 {
-	if (vga_video_type < VIDEO_TYPE_EGAM)
+	if (vga_video_type < VIDEO_TYPE_EGAM || vga_is_gfx)
 		return -EINVAL;
 
 	font->width = VGA_FONTWIDTH;
Signature · 1 line
2.14.1