linux-console.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dirk Mueller <dmueller@suse.com>
To: linux-console@vger.kernel.org
Cc: Dirk Mueller <dmueller@suse.com>, Hannes Reinecke <hare@suse.de>
Subject: [PATCH] Skip setfont/getfont calls when card is already in graphics mode
Date: Wed,  4 Oct 2017 11:43:21 +0200	[thread overview]
Message-ID: <20171004094321.21150-1-dmueller@suse.com> (raw)

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


                 reply	other threads:[~2017-10-04  9:43 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171004094321.21150-1-dmueller@suse.com \
    --to=dmueller@suse.com \
    --cc=hare@suse.de \
    --cc=linux-console@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).