|
From: Antonino D. <ad...@us...> - 2002-04-11 04:11:11
|
On Wed, 2002-04-10 at 21:14, Geert Uytterhoeven wrote: > On Wed, 10 Apr 2002, Peter Horton wrote: > > On Wed, Apr 10, 2002 at 01:06:09PM +0200, Geert Uytterhoeven wrote: > > > On Wed, 10 Apr 2002, Peter Horton wrote: > > > > > > > > The colour map is only used by the kernel and the kernel only uses 16 > > > > entries so there isn't any reason to waste memory by making it any > > > > larger. I checked a few other drivers and they do the same (aty128fb for > > > > one). > > > > > > However, this change will make the driver not save/restore all color map > > > entries on VC switch in graphics mode. > > > > Well I thought this didn't matter because if we only use 16 entries they > > will all be saved / restored. But there is a problem because the copy of > > the entire palette that we keep is per card and will be lost on VC > > switch, though the kernel will restore the first 16 entries. Really we > > need to keep a copy of the relevant part of the palette for each display > > (256 for 8bpp, 32 for 15 bit mode, 64 for 16bpp and 256 for 32bpp). > > Looking at a handful of drivers this seems to be a common error, so it > > can't be causing users much grief. I don't think changing the size of > > the colour map fixes this though (I need to look at the code when I get > > home). > I think most drivers do save/restore the entire colormap, at least the vesafb. From what I can understand from the code, the display->dispsw which is a 16- or 17-entry palette is primarily used by the console, but is just a subset of display->cmap, which is an arbitrarily sized colormap. Also display->cmap can be set by applications from userspace and can be saved on a per console basis. Most drivers have a do_install_cmap in set_var or fbcon_switch which effectively restores the hardware CLUT registers from display->cmap, aside from restoring display->dispsw. The vesafb also does an addistional save of the old colormap (using fb_get_cmap) before installing the new colormap. This is just based on how I understand the code, so correct me if I'm wrong. Tony |