Skip to contentSkip to conversation

color map vs. pseudo-palette vs. RAMDAC registers

DISCUSSION Rolf Offermanns 3 participants 4 messages Oct 24, 2005 Framebuffer layer

lore
Share & tools
lore
#0 lore raw

Hi All,
I tried to understand the skeletonfb driver code, and I am confused by some comments in it:

I do not understand what the color map and pseudo palette stuff is used for.

From the c file:
--------------------------------------------------------------------
Pseudocolor:
* cmap is not used
* DAC[X] is programmed to (red, green, blue)
--------------------------------------------------------------------
Does that mean, I do not need to allocate a color map, if my driver would only support pseudocolor visual? Is pseudocolor always used for 8bpp or are there situations where 16bpp pseudocolor makes sense?

-----------------------------------------------------------------------------
Truecolor:

     *    does not use RAMDAC (usually has 3 of them).
     *    var->{color}.offset contains start of bitfield
     *    var->{color}.length contains length of bitfield
     *    cmap is programmed to (red << red.offset) | 

(green << green.offset) | (blue << blue.offset) | (transp << transp.offset)
* RAMDAC does not exist
-----------------------------------------------------------------------------
Now I am lost:
-> does not use RAMDAC.
I understand this. It states the same in my chip reference. But what means "usually has 3 of them" in this context?

-> cmap is programmed to...
In the code that follows this comment, not the cmap is programmed, but the pseudo palette.
1. Why do I need a pseudo palette and where does its size 16 comes from?
2. What do I need a color map for?

-> RAMDAC does not exist <-> "usually has 3 of them" ???

Please shed some light on me.

Thanks,
Rolf

-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course Free Certification Exam for All Training Attendees Through End of 2005 Visit http://www.jboss.com/services/certification for more information

#1 lore raw
Quoted 9 lines · Rolf Offermanns

I tried to understand the skeletonfb driver code, and I am confused by some comments in it:

I do not understand what the color map and pseudo palette stuff is used for.

Quoted 1 line

From the c file:

--------------------------------------------------------------------
Pseudocolor:
* cmap is not used

That should be `pseudo palette is not used'.

Quoted 3 lines

* DAC[X] is programmed to (red, green, blue)
--------------------------------------------------------------------
Does that mean, I do not need to allocate a color map, if my driver would only

It means you don't have to fill in the pseudo palette in this mode.

Quoted 2 lines

support pseudocolor visual? Is pseudocolor always used for 8bpp or are there situations where 16bpp pseudocolor makes sense?

Pseudocolor is not always 8 bpp (1, 2, 4 are common values as well), but large values are very uncommon, since 16 bpp pseudocolor would mean a 65536-entries colormap.

Quoted 6 lines

-----------------------------------------------------------------------------
Truecolor:

     *    does not use RAMDAC (usually has 3 of them).
     *    var->{color}.offset contains start of bitfield
     *    var->{color}.length contains length of bitfield
     *    cmap is programmed to (red << red.offset) | 
Quoted 9 lines

(green << green.offset) | (blue << blue.offset) | (transp << transp.offset)
* RAMDAC does not exist
-----------------------------------------------------------------------------
Now I am lost:
-> does not use RAMDAC.
I understand this. It states the same in my chip reference. But what means "usually has 3 of them" in this context?

Red, green, and blue.

Quoted 3 lines

-> cmap is programmed to...
In the code that follows this comment, not the cmap is programmed, but the pseudo palette.

That should be `pseudo palette' again.

Quoted 1 line

1. Why do I need a pseudo palette and where does its size 16 comes from?

It's used to translate from the 16 text console colors to actual pixel values.

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

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 the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course Free Certification Exam for All Training Attendees Through End of 2005 Visit http://www.jboss.com/services/certification for more information

#2 lore raw
Quoted 4 lines · Geert Uytterhoeven
Quoted 3 lines

--------------------------------------------------------------------
Pseudocolor:
* cmap is not used

Quoted 8 lines

That should be `pseudo palette is not used'.

Quoted 4 lines

* DAC[X] is programmed to (red, green, blue)
--------------------------------------------------------------------
Does that mean, I do not need to allocate a color map, if my driver would only

It means you don't have to fill in the pseudo palette in this mode.

OK.

Quoted 6 lines
Quoted 2 lines

support pseudocolor visual? Is pseudocolor always used for 8bpp or are there situations where 16bpp pseudocolor makes sense?

Pseudocolor is not always 8 bpp (1, 2, 4 are common values as well), but large values are very uncommon, since 16 bpp pseudocolor would mean a 65536-entries colormap.

OK.

Quoted 16 lines
Quoted 6 lines

-------------------------------------------------------------------------
---- Truecolor:

     *    does not use RAMDAC (usually has 3 of them).
     *    var->{color}.offset contains start of bitfield
     *    var->{color}.length contains length of bitfield
     *    cmap is programmed to (red << red.offset) |
Quoted 9 lines

(green << green.offset) | (blue << blue.offset) | (transp << transp.offset)
* RAMDAC does not exist
-------------------------------------------------------------------------
---- Now I am lost:
-> does not use RAMDAC.
I understand this. It states the same in my chip reference. But what means "usually has 3 of them" in this context?

Quoted 1 line

Red, green, and blue.

OK. But this is for H/W with DirectColor support where each color has its own CLUT, right?

Quoted 5 lines
Quoted 3 lines

-> cmap is programmed to...
In the code that follows this comment, not the cmap is programmed, but the pseudo palette.

That should be `pseudo palette' again.

OK.

Quoted 5 lines
Quoted 2 lines

1. Why do I need a pseudo palette and where does its size 16 comes from?

It's used to translate from the 16 text console colors to actual pixel values.

OK, and these 16 color can be set/defined by text mode apps, right?

Thanks for these explanations Gerd. Shall I provide a patch for the skeletonfb driver comments?

The one thing, I still do not understand is:
What are color maps used for in the different visuals? In pseudo mode they are not used at all. In TrueColor mode there should be no need to map anything? I checked the documentation again, but there must be something I have overread.

Could you please explain this?

Thanks,
Rolf

-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course Free Certification Exam for All Training Attendees Through End of 2005 Visit http://www.jboss.com/services/certification for more information

#3 lore raw
Quoted 17 lines · Rolf Offermanns
Quoted 16 lines · Geert Uytterhoeven
Quoted 15 lines

-------------------------------------------------------------------------
---- Truecolor:

     *    does not use RAMDAC (usually has 3 of them).
     *    var->{color}.offset contains start of bitfield
     *    var->{color}.length contains length of bitfield
     *    cmap is programmed to (red << red.offset) |

(green << green.offset) | (blue << blue.offset) | (transp << transp.offset)
* RAMDAC does not exist
-------------------------------------------------------------------------
---- Now I am lost:
-> does not use RAMDAC.
I understand this. It states the same in my chip reference. But what means "usually has 3 of them" in this context?

Quoted 3 lines
Quoted 1 line

Red, green, and blue.

OK. But this is for H/W with DirectColor support where each color has its own CLUT, right?

No, `RAM' part of the RAMDAC is used for both pseudocolor and directcolor.

Quoted 2 lines

Thanks for these explanations Gerd. Shall I provide a patch for the skeletonfb driver comments?

Please do so, thx!

Quoted 5 lines

The one thing, I still do not understand is:
What are color maps used for in the different visuals? In pseudo mode they are not used at all. In TrueColor mode there should be no need to map anything? I checked the documentation again, but there must be something I have overread.

Colormaps are definitely used in pseudocolor mode, since they specify how to map the index in the pixel value to the actual color.

In truecolor mode colormaps are indeed not used.

In directcolor mode colormaps specify how the red, green, and blue (and alpha) indices in the pixel values are mapped to actual values for the color components.

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

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 the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course Free Certification Exam for All Training Attendees Through End of 2005 Visit http://www.jboss.com/services/certification for more information