* writing a framebuffer driver and font problem..
@ 2003-10-31 8:16 Kaj-Michael Lang
2003-10-31 10:41 ` Geert Uytterhoeven
0 siblings, 1 reply; 4+ messages in thread
From: Kaj-Michael Lang @ 2003-10-31 8:16 UTC (permalink / raw)
To: linux-fbdev-devel
Hello..
I hope someone here can help me. I've started writing support for the b/w
framebuffer on
VAXstation for the Linux/VAX project. And I've got so far that it sort-of
works, I can output text
on the framebuffer and such. Problem is that all font are flipped/mirrored,
like a "b" looks like "d", this picture
might show it a little bit better: http://home.tal.org/~milang/vax/2.html
And as you can se from the picture the logo looks strange.
What might be the problem, and what should I do to fix it ?
I'm totaly new a writing kernel code so it might be something obvious that
I'm missing.
--
Kaj-Michael Lang , milang@tal.org
-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive? Does it
help you create better code? SHARE THE LOVE, and help us help
YOU! Click Here: http://sourceforge.net/donate/
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: writing a framebuffer driver and font problem..
2003-10-31 8:16 writing a framebuffer driver and font problem Kaj-Michael Lang
@ 2003-10-31 10:41 ` Geert Uytterhoeven
2003-10-31 11:34 ` Kaj-Michael Lang
0 siblings, 1 reply; 4+ messages in thread
From: Geert Uytterhoeven @ 2003-10-31 10:41 UTC (permalink / raw)
To: Kaj-Michael Lang; +Cc: Linux Frame Buffer Device Development
On Fri, 31 Oct 2003, Kaj-Michael Lang wrote:
> I hope someone here can help me. I've started writing support for the b/w
> framebuffer on
> VAXstation for the Linux/VAX project. And I've got so far that it sort-of
> works, I can output text
> on the framebuffer and such. Problem is that all font are flipped/mirrored,
> like a "b" looks like "d", this picture
> might show it a little bit better: http://home.tal.org/~milang/vax/2.html
> And as you can se from the picture the logo looks strange.
>
> What might be the problem, and what should I do to fix it ?
>
> I'm totaly new a writing kernel code so it might be something obvious that
> I'm missing.
Are you using 2.4 or 2.6?
You have to swap the character data in
drivers/video/fbcon-mfb.c:fbcon_mfb_putc{,s}() (2.4.x) or
drivers/video/cfbimgblt.c.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
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
-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive? Does it
help you create better code? SHARE THE LOVE, and help us help
YOU! Click Here: http://sourceforge.net/donate/
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: writing a framebuffer driver and font problem..
2003-10-31 10:41 ` Geert Uytterhoeven
@ 2003-10-31 11:34 ` Kaj-Michael Lang
2003-10-31 12:16 ` Geert Uytterhoeven
0 siblings, 1 reply; 4+ messages in thread
From: Kaj-Michael Lang @ 2003-10-31 11:34 UTC (permalink / raw)
To: Geert Uytterhoeven; +Cc: Linux Frame Buffer Device Development
On Fri, 2003-10-31 at 12:41, Geert Uytterhoeven wrote:
> Are you using 2.4 or 2.6?
2.4 for now, but I'm going to port it over to 2.6.
> You have to swap the character data in
> drivers/video/fbcon-mfb.c:fbcon_mfb_putc{,s}() (2.4.x) or
> drivers/video/cfbimgblt.c.
Ok.. stupid question.. how do I do that ?
--
Kaj-Michael Lang <milang@tal.org>
-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive? Does it
help you create better code? SHARE THE LOVE, and help us help
YOU! Click Here: http://sourceforge.net/donate/
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: writing a framebuffer driver and font problem..
2003-10-31 11:34 ` Kaj-Michael Lang
@ 2003-10-31 12:16 ` Geert Uytterhoeven
0 siblings, 0 replies; 4+ messages in thread
From: Geert Uytterhoeven @ 2003-10-31 12:16 UTC (permalink / raw)
To: Kaj-Michael Lang; +Cc: Linux Frame Buffer Device Development
On Fri, 31 Oct 2003, Kaj-Michael Lang wrote:
> On Fri, 2003-10-31 at 12:41, Geert Uytterhoeven wrote:
> > Are you using 2.4 or 2.6?
>
> 2.4 for now, but I'm going to port it over to 2.6.
>
> > You have to swap the character data in
> > drivers/video/fbcon-mfb.c:fbcon_mfb_putc{,s}() (2.4.x) or
> > drivers/video/cfbimgblt.c.
>
> Ok.. stupid question.. how do I do that ?
This (untested) patch should do the trick...
--- linux-2.4.x/drivers/video/fbcon-mfb.c.orig 2001-10-02 11:47:46.000000000 +0200
+++ linux-2.4.x/drivers/video/fbcon-mfb.c 2003-10-31 13:14:47.000000000 +0100
@@ -19,6 +19,15 @@
#include <video/fbcon-mfb.h>
+static inline u8 swap_byte(u8 in)
+{
+ in = ((in & 0xf0) >> 4) | ((in & 0x0f) << 4);
+ in = ((in & 0xcc) >> 2) | ((in & 0x33) << 2);
+ in = ((in & 0xaa) >> 1) | ((in & 0x55) << 1);
+ return in;
+}
+
+
/*
* Monochrome
*/
@@ -97,7 +106,7 @@
underl = attr_underline(p,c);
for (rows = fontheight(p); rows--; dest += p->next_line) {
- d = *cdat++;
+ d = swap_byte(*cdat++);
if (underl && !rows)
d = 0xff;
else if (bold)
@@ -127,7 +136,7 @@
dest = dest0++;
cdat = p->fontdata+c*fontheight(p);
for (rows = fontheight(p); rows--; dest += p->next_line) {
- d = *cdat++;
+ d = swap_byte(*cdat++);
if (underl && !rows)
d = 0xff;
else if (bold)
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
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
-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive? Does it
help you create better code? SHARE THE LOVE, and help us help
YOU! Click Here: http://sourceforge.net/donate/
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2003-10-31 12:16 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-10-31 8:16 writing a framebuffer driver and font problem Kaj-Michael Lang
2003-10-31 10:41 ` Geert Uytterhoeven
2003-10-31 11:34 ` Kaj-Michael Lang
2003-10-31 12:16 ` Geert Uytterhoeven
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).