From: Takashi Iwai <tiwai@suse.de>
To: linux-kernel@vger.kernel.org
Cc: Egbert Eich <eich@suse.de>
Subject: [PATCH] VGA console font problems on 2.6 kernel
Date: Fri, 24 Sep 2004 15:23:23 +0200 [thread overview]
Message-ID: <s5hvfe33ino.wl@alsa2.suse.de> (raw)
Hi,
Egbert Eich of Xorg reported the problems of VGA console on 2.6
kernels. I forward his original post and proposed patches here to
LKML, since this should be discussed / audited better here.
The patch below can be applied to 2.6.9-rc2.
Any comments, please?
Thanks.
--
Takashi Iwai <tiwai@suse.de> ALSA Developer - www.alsa-project.org
> Subject: [kernel] VGA Text Console Issues
> From: Egbert Eich <eich@suse.de>
>
> I would like to utilize kernel ioctls to save/restore console fonts
> in VGA text mode when running X. So far the Xserver takes care of this
> however there more and more problems with this:
> 1. On some platforms (IA64) we need to POST the BIOS before
> we even have a chance to access the hardware ourselves.
> This POSTing will usually undo any changes to the graphics
> hardware that the kernel may have done.
> 2. More and more drivers fully rely on BIOS support however
> the BIOS functions which could be used to save/restore
> register settings may be broken so the only way of mode
> save/restore is getting/setting the BIOS mode ID.
>
> I've hacked up some code for X however I ran into two problems:
>
> 1. con_font_get() in linux/drivers/char/vt.c seems to be broken as
> the font parameters (height, width, charcount) are never reported
> back. Therefore this function seems to be pretty useless.
> The fix is simple (please see below).
>
> 2. fb consoles seem to allow to install fonts per vt so that the user
> can have a different font on every console. The text console driver
> doesn't support this: the font is downloaded to the video card
> and will be used for all systems. Still the vga_con driver stores
> the font parameters per console with the effect that setting a
> font with different parameters on one console will result in the
> wron values when this font information is read back from another
> console.
> Appearantly this broken feature has been introduced in 2.6 as
> in the 2.4 kernel the vga_con font information is stored in one
> single global variable.
>
> The IA64 platform at least still heavily relies on the VGA text console.
> To be able to fix some VT switching issues with X on this platform I
> need these two issues resolved.
>
> Egbert.
--- linux/drivers/char/vt.c.orig 2004-09-22 07:12:15.000000000 -0700
+++ linux/drivers/char/vt.c 2004-09-23 07:39:50.206885656 -0700
@@ -3079,6 +3079,10 @@
if (rc)
goto out;
+ op->height = font.height;
+ op->width = font.width;
+ op->charcount = font.charcount;
+
if (op->data && copy_to_user(op->data, font.data, c))
rc = -EFAULT;
--- linux/drivers/video/console/vgacon.c 2004-09-23 16:54:02.096337495 +0200
+++ linux/drivers/video/console/vgacon.c 2004-09-23 16:57:32.149761950 +0200
@@ -901,8 +901,10 @@ static int vgacon_adjust_height(struct v
for (i = 0; i < MAX_NR_CONSOLES; i++) {
struct vc_data *c = vc_cons[i].d;
- if (c && c->vc_sw == &vga_con)
+ if (c && c->vc_sw == &vga_con) {
+ c->vc_font.height = fontheight;
vc_resize(c->vc_num, 0, rows); /* Adjust console size */
+ }
}
return 0;
}
reply other threads:[~2004-09-24 13:23 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=s5hvfe33ino.wl@alsa2.suse.de \
--to=tiwai@suse.de \
--cc=eich@suse.de \
--cc=linux-kernel@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