From: "Antonino A. Daplas" <adaplas@hotpop.com>
To: linux-fbdev-devel@lists.sourceforge.net
Cc: jjaakkol@cs.Helsinki.FI
Subject: Re: [PATCH] fix for using >16 pixel wide font in fb console
Date: Mon, 8 Nov 2004 18:16:12 +0800 [thread overview]
Message-ID: <200411081816.15633.adaplas@hotpop.com> (raw)
In-Reply-To: <Pine.LNX.4.58.0411080202040.5524@glomgold-9.cs.helsinki.fi>
On Monday 08 November 2004 08:17, Jani Jaakkola wrote:
> [ Please, CC any replies to me, I am not a regular kernel hacker ]
>
> I wrote a small tool to convert fonts understood by freetype to linux
> console fonts, since I wanted to use larger fonts than the ones shipped
> with kbd package on my console. This exposed (at least) two bugs in fb
> console driver.
>
> The first one was that fbcon_set_font() used one byte padding for fonts
> having width 16 <= width < 24, which was wrong since the pieces of code
> actually using the font did not use any padding. This is fixed in the
> included patch and also fbcon_set_font() is made a little cleaner. After
> the patch the following font is not garbled in fb console:
> http://www.cs.helsinki.fi/u/jjaakkol/psf/bitstream_vera_sans_mono_roman.16x
>30.psf
>
Nice, I just checked it on vesafb and rivafb and it works.
> The other bug is that fonts having height == 32 crash the kernel. I have
> no fix for this (at least not yet), but it can be reproduced with font:
> http://www.cs.helsinki.fi/u/jjaakkol/psf/bitstream_vera_sans_mono_roman.17x
>32.psf
I think I know where the problem is. The src bitmap is statically allocated
at 64 bytes, enough for a 16x32 font, previously the maximum font dimension
allowed. Dynamically allocating it based on the font dimension fixes the
problem (patch attached), at least for drivers with no hardware cursor
implementation, such as vesafb. (I tested it on rivafb, but I get cursor
corruption, probably a driver problem. Also nvidia's maximum cursor
dimension is 32x32, so it's probably hitting a corner case bug).
>
> + /* Is there a reason why fbconsole couldn't handle any charcount >256?
> + * If not this check should be changed to charcount < 256 */
This is because the console was based on VGA in which each character is
described in 16 bits. The upper byte is for the attributes and the lower byte
is for the character. Sometimes, one can use bit 8, giving 9-bits allowing
for 512 bytes of character count.
Tony
PS: Diff is against 2.6.10-rc1-mm3
-------------------------------------------------------
This SF.Net email is sponsored by:
Sybase ASE Linux Express Edition - download now for FREE
LinuxWorld Reader's Choice Award Winner for best database on Linux.
http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click
next prev parent reply other threads:[~2004-11-08 10:16 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-11-08 0:17 [PATCH] fix for using >16 pixel wide font in fb console Jani Jaakkola
2004-11-08 10:16 ` Antonino A. Daplas [this message]
2004-11-08 10:34 ` Antonino A. Daplas
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=200411081816.15633.adaplas@hotpop.com \
--to=adaplas@hotpop.com \
--cc=jjaakkol@cs.Helsinki.FI \
--cc=linux-fbdev-devel@lists.sourceforge.net \
/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).