| 
      
      
      From: Geert U. <ge...@li...> - 2001-11-22 12:34:49
      
     | 
| On Thu, 22 Nov 2001 be...@ke... wrote:
> I'm trying to fix some problem with palette/gamma table in radeonfb
> (and possibly aty128fb too), but I'm having trouble figuring out how
> things are supposed to work.
> 
> I've compared what is done in atyfb and aty128fb and it's quite 
> different.
> 
> atyfb unconditionally sets the passed values in the HW registers,
> and then, for color index < 16, sets fbcon_cmap to a linear value
> (regno scaled), not taking into account the passed in rgb value.
In directcolor mode, there are two possible approaches to emulate console
colors:
  - Use a linear ramp as colormap, and write the RGB triplets corresponding to
    the console colors into the pixel values.
  - Store the RGB triples corresponding to the console colors in the colormap,
    and set all of R, G and B in the pixel value to the console color index
    (i.e. the value you'd use in pseudocolor mode).
The second approach has the advantage that you can change the console palette
without having to redraw the screen, so atyfb uses that.
> So here are the questions:
> 
>  - What is the fbcon_cmap.cfbX array supposed to contain ?
It should contain the 16 pixel values corresponding to the 16 console colors,
so fbcon-* knows how to draw pixels in the 16 console colors.
In 2.5.x, the 17th entry will contain the cursor XOR mask.
>  - When using > 8 bit depth, who is supposed to set the linear
>    gamma ramp ? (My understanding is that a client app is responsible
>    to set it's own cmap properly, but it also looks like some apps
>    rely on the default beeing set to a linear gamma ramp). Should
>    I set it this way in set_par by default and then let the app
>    eventually change it ?
If your fbdev claims to be in truecolor mode, your fbdev should do it.
If your fbdev claims to be in directcolor mode, the application should do it
(if the app wants truecolor mode).
>  - When using fbcon (that is no client app), who is responsible
>    for restoring the proper console cmap (in 8 bits) or the linear
>    gamma ramp (in > 8 bits) on console switch ?
If your fbdev claims to be in truecolor mode, your fbdev should do it.
> Note that the TRUECOLOR vs. DIRECTCOLOR distinction isn't really
> mattering here as apparently, the ATI chip always go thru the DAC
> cmap, thus we must always make sure we have a liner gamma ramp
> programmed for > 8 bits modes unless the client app provides it's own
> gamme table.
So ATI always does directcolor mode.
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
 |