Thread (3 messages) 3 messages, 2 authors, 2004-11-08

Re: [PATCH] fix for using >16 pixel wide font in fb console

From: Antonino A. Daplas <hidden>
Date: 2004-11-08 10:16:32

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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help