|
From: Geert U. <ge...@li...> - 2003-01-12 11:27:17
|
On 12 Jan 2003, Antonino Daplas wrote:
> On Sun, 2003-01-12 at 03:15, Geert Uytterhoeven wrote:
> > I'm trying out different fonts with amifb (based on 2.5.56 from Linus).
> > - PEARL8x8: OK
> > - SUN12x22: garbage (random characters)
> > - ProFont6x11: garbage (each different line is filled with a different
> > character)
> > - MINI4x6: garbage (each different line is filled with a different
> > character)
> >
> > At first I thought it may be caused by xres and yres not divisible by the
> > fontsize, so I tried a 800x600 mode with MINI4x6. But the problem stayed the
> > same, except that only a 640x600 window in the right part of the screen was
> > used.
> >
> > Is my planar code in amifb to blane, or have other people seen the same?
> >
>
> The cfb_imageblit() function exhibited the same behavior. I think we
> both made the wrong assumption that all monochrome bitmaps are packed. I
> think the rule is:
>
> The first pixel on the next scanline is always at the next byte from
> the last pixel of the current scanline.
>
> So a 12x22 font has 16 bits per scanline but only 12 are usable, and the
> last 4 are used as padding. It's worse with a 4x6 fonts where the
> 4-bits are just duplicated in the other nibble.
Yes.
But that was not my problem. Currently accel_putcs() falls back to individual
character drawing if the fontwidth is not a multiple of 8, and reuses the same
struct fb_image for each call of fb_imageblit(). And since my fb_imageblit()
had a loop like `while (image->height--) { ... }' it failed. Not modifying the
passed struct fb_image fixed the problem. Yes, we need the const there :-)
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- ge...@li...
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
|