aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichal Januszewski <spock@gentoo.org>2009-04-13 17:39:41 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2009-04-13 18:04:29 -0400
commitebde441177da3bad156701d351509f34295282ab (patch)
tree816eca54fcde1e42d4ba81ab80533188724a64ee
parent513adb58685615b0b1d47a3f0d40f5352beff189 (diff)
fbdev: fix color component field length documentation
The documentation about the meaning of the color component bitfield lengths in pseudocolor modes is inconsistent. Fix it, so that it indicates the correct interpretation everywhere, i.e. that 1 << length is the number of palette entries. Signed-off-by: Michal Januszewski <spock@gentoo.org> Acked-by: Krzysztof Helt <krzysztof.h1@poczta.fm> Cc: <syrjala@sci.fi> Acked-by: Geert Uytterhoeven <geert.uytterhoeven@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--drivers/video/skeletonfb.c8
-rw-r--r--drivers/video/vfb.c11
-rw-r--r--include/linux/fb.h8
3 files changed, 18 insertions, 9 deletions
diff --git a/drivers/video/skeletonfb.c b/drivers/video/skeletonfb.c
index a439159204a8..89158bc71da2 100644
--- a/drivers/video/skeletonfb.c
+++ b/drivers/video/skeletonfb.c
@@ -308,9 +308,11 @@ static int xxxfb_setcolreg(unsigned regno, unsigned red, unsigned green,
308 * color depth = SUM(var->{color}.length) 308 * color depth = SUM(var->{color}.length)
309 * 309 *
310 * Pseudocolor: 310 * Pseudocolor:
311 * var->{color}.offset is 0 311 * var->{color}.offset is 0 unless the palette index takes less than
312 * var->{color}.length contains width of DAC or the number of unique 312 * bits_per_pixel bits and is stored in the upper
313 * colors available (color depth) 313 * bits of the pixel value
314 * var->{color}.length is set so that 1 << length is the number of
315 * available palette entries
314 * pseudo_palette is not used 316 * pseudo_palette is not used
315 * RAMDAC[X] is programmed to (red, green, blue) 317 * RAMDAC[X] is programmed to (red, green, blue)
316 * color depth = var->{color}.length 318 * color depth = var->{color}.length
diff --git a/drivers/video/vfb.c b/drivers/video/vfb.c
index cc919ae46571..050d432c7d95 100644
--- a/drivers/video/vfb.c
+++ b/drivers/video/vfb.c
@@ -318,13 +318,16 @@ static int vfb_setcolreg(u_int regno, u_int red, u_int green, u_int blue,
318 * {hardwarespecific} contains width of RAMDAC 318 * {hardwarespecific} contains width of RAMDAC
319 * cmap[X] is programmed to (X << red.offset) | (X << green.offset) | (X << blue.offset) 319 * cmap[X] is programmed to (X << red.offset) | (X << green.offset) | (X << blue.offset)
320 * RAMDAC[X] is programmed to (red, green, blue) 320 * RAMDAC[X] is programmed to (red, green, blue)
321 * 321 *
322 * Pseudocolor: 322 * Pseudocolor:
323 * uses offset = 0 && length = RAMDAC register width. 323 * var->{color}.offset is 0 unless the palette index takes less than
324 * var->{color}.offset is 0 324 * bits_per_pixel bits and is stored in the upper
325 * var->{color}.length contains widht of DAC 325 * bits of the pixel value
326 * var->{color}.length is set so that 1 << length is the number of available
327 * palette entries
326 * cmap is not used 328 * cmap is not used
327 * RAMDAC[X] is programmed to (red, green, blue) 329 * RAMDAC[X] is programmed to (red, green, blue)
330 *
328 * Truecolor: 331 * Truecolor:
329 * does not use DAC. Usually 3 are present. 332 * does not use DAC. Usually 3 are present.
330 * var->{color}.offset contains start of bitfield 333 * var->{color}.offset contains start of bitfield
diff --git a/include/linux/fb.h b/include/linux/fb.h
index f563c5013932..330c4b1bfcaa 100644
--- a/include/linux/fb.h
+++ b/include/linux/fb.h
@@ -173,8 +173,12 @@ struct fb_fix_screeninfo {
173/* Interpretation of offset for color fields: All offsets are from the right, 173/* Interpretation of offset for color fields: All offsets are from the right,
174 * inside a "pixel" value, which is exactly 'bits_per_pixel' wide (means: you 174 * inside a "pixel" value, which is exactly 'bits_per_pixel' wide (means: you
175 * can use the offset as right argument to <<). A pixel afterwards is a bit 175 * can use the offset as right argument to <<). A pixel afterwards is a bit
176 * stream and is written to video memory as that unmodified. This implies 176 * stream and is written to video memory as that unmodified.
177 * big-endian byte order if bits_per_pixel is greater than 8. 177 *
178 * For pseudocolor: offset and length should be the same for all color
179 * components. Offset specifies the position of the least significant bit
180 * of the pallette index in a pixel value. Length indicates the number
181 * of available palette entries (i.e. # of entries = 1 << length).
178 */ 182 */
179struct fb_bitfield { 183struct fb_bitfield {
180 __u32 offset; /* beginning of bitfield */ 184 __u32 offset; /* beginning of bitfield */