Re: FB_VISUAL_TRUECOLOR vs.FB_VISUAL_DIRECTCOLOR

"James Lehman" <[email protected]> Sat, 5 Aug 2006 22:47:10 -0400
Newsgroups gmane.linux.fbdev.user
Message-ID <000001c6b903$20dd91f0$0b00a8c0@bug>
Awesome!

Thanks so much!

I still have some tweaking to do, but I now have code that works for ATI,
Nvidia and several others (DIRECTCOLOR). Before it really only worked well
with Matrox (TRUECOLOR).

The first thing that I notice is that if I run fbset before any of my code
and set the fb to be 32 bits per pixel, then my code, at 32 bpp, looks
perfect.

But if I leave the fb at 8 bpp and my code changes the bpp at runtime to 32,
it looks like the first 16 console colors have been written into the color
map.

No matter what, I'm successfully putting a picture into video cards that I
had no luck with before!

Thanks again!      James.    :o)



----- Original Message ----- 
From: "Antonino A. Daplas" <[email protected]>
To: "Antonino A. Daplas" <[email protected]>
Cc: "James Lehman" <[email protected]>;
<[email protected]>
Sent: Saturday, August 05, 2006 8:02 PM
Subject: Re: [Linux-fbdev-users] FB_VISUAL_TRUECOLOR
vs.FB_VISUAL_DIRECTCOLOR


> Antonino A. Daplas wrote:
> > James Lehman wrote:
> >> Can someone please explain the difference between these two display
types?
> >>
> >> FB_VISUAL_TRUECOLOR
> >> FB_VISUAL_DIRECTCOLOR
> >>
> >> My frame buffer API, ezfb, works well with cards that are
> >> FB_VISUAL_TRUECOLOR, but not so well with cards that are
> >> FB_VISUAL_DIRECTCOLOR.
> >>
> >> http://www.akrobiz.com/ezfb/
> >
> > Truecolor:
> >
> > pixel = red << offset | green << offset | blue << offset | alpha <<
offset;
> >
> > where red, green, blue, alpha are the actual values of each pixel
component
> >
> > Directcolor:
> >
> > pixel = red_index << offset | green_index << offset |
> > blue_index << offset | alpha_index << offset;
> >
> > where *_index's are the index to the Hardware LUT, ie:
> >
> > red = red_map[red_index];
> >
> > Thusly:  In Directcolor, you have to initialize the LUT first, by
> > sending an FBIOPUTCMAP ioctl. If you want Directcolor to behave like
> > Truecolor, then send a linear colormap where:
> >
> > {red|green|blue|alpha}_map[i] = i;
>
> One more note, the above is fine if each color component is 8-bits in
> size (RGB888, for instance), but for RGB555, you have
> to downscale. So the untested code below will work better:
>
> red_map[i/(1 << (8 - red_length))] = i;
> red_map[i/(1 << (8 - 5))] = i;
> red_map[i/8] = i;
>
> Tony
>
> -------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share
your
> opinions on IT & business topics through brief surveys -- and earn cash
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> _______________________________________________
> Linux-fbdev-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/linux-fbdev-users
>


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV