linux-console.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Skip setfont/getfont calls when card is already in graphics mode
@ 2017-10-04  9:43 Dirk Mueller
  0 siblings, 0 replies; only message in thread
From: Dirk Mueller @ 2017-10-04  9:43 UTC (permalink / raw)
  To: linux-console; +Cc: Dirk Mueller, Hannes Reinecke

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.

Signed-off-by: Hannes Reinecke <hare@suse.de>
---
 drivers/video/console/vgacon.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/video/console/vgacon.c b/drivers/video/console/vgacon.c
index 445b1dc5d441..1d948b159a05 100644
--- a/drivers/video/console/vgacon.c
+++ b/drivers/video/console/vgacon.c
@@ -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;
-- 
2.14.1


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2017-10-04  9:43 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-04  9:43 [PATCH] Skip setfont/getfont calls when card is already in graphics mode Dirk Mueller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).