Commit ebde4411 authored by Michal Januszewski's avatar Michal Januszewski Committed by Linus Torvalds

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: default avatarMichal Januszewski <spock@gentoo.org>
Acked-by: default avatarKrzysztof Helt <krzysztof.h1@poczta.fm>
Cc: <syrjala@sci.fi>
Acked-by: default avatarGeert Uytterhoeven <geert.uytterhoeven@gmail.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 513adb58
...@@ -308,9 +308,11 @@ static int xxxfb_setcolreg(unsigned regno, unsigned red, unsigned green, ...@@ -308,9 +308,11 @@ static int xxxfb_setcolreg(unsigned regno, unsigned red, unsigned green,
* color depth = SUM(var->{color}.length) * color depth = SUM(var->{color}.length)
* *
* Pseudocolor: * Pseudocolor:
* var->{color}.offset is 0 * var->{color}.offset is 0 unless the palette index takes less than
* var->{color}.length contains width of DAC or the number of unique * bits_per_pixel bits and is stored in the upper
* colors available (color depth) * bits of the pixel value
* var->{color}.length is set so that 1 << length is the number of
* available palette entries
* pseudo_palette is not used * pseudo_palette is not used
* RAMDAC[X] is programmed to (red, green, blue) * RAMDAC[X] is programmed to (red, green, blue)
* color depth = var->{color}.length * color depth = var->{color}.length
......
...@@ -318,13 +318,16 @@ static int vfb_setcolreg(u_int regno, u_int red, u_int green, u_int blue, ...@@ -318,13 +318,16 @@ static int vfb_setcolreg(u_int regno, u_int red, u_int green, u_int blue,
* {hardwarespecific} contains width of RAMDAC * {hardwarespecific} contains width of RAMDAC
* cmap[X] is programmed to (X << red.offset) | (X << green.offset) | (X << blue.offset) * cmap[X] is programmed to (X << red.offset) | (X << green.offset) | (X << blue.offset)
* RAMDAC[X] is programmed to (red, green, blue) * RAMDAC[X] is programmed to (red, green, blue)
* *
* Pseudocolor: * Pseudocolor:
* uses offset = 0 && length = RAMDAC register width. * var->{color}.offset is 0 unless the palette index takes less than
* var->{color}.offset is 0 * bits_per_pixel bits and is stored in the upper
* var->{color}.length contains widht of DAC * bits of the pixel value
* var->{color}.length is set so that 1 << length is the number of available
* palette entries
* cmap is not used * cmap is not used
* RAMDAC[X] is programmed to (red, green, blue) * RAMDAC[X] is programmed to (red, green, blue)
*
* Truecolor: * Truecolor:
* does not use DAC. Usually 3 are present. * does not use DAC. Usually 3 are present.
* var->{color}.offset contains start of bitfield * var->{color}.offset contains start of bitfield
......
...@@ -173,8 +173,12 @@ struct fb_fix_screeninfo { ...@@ -173,8 +173,12 @@ struct fb_fix_screeninfo {
/* Interpretation of offset for color fields: All offsets are from the right, /* Interpretation of offset for color fields: All offsets are from the right,
* inside a "pixel" value, which is exactly 'bits_per_pixel' wide (means: you * inside a "pixel" value, which is exactly 'bits_per_pixel' wide (means: you
* can use the offset as right argument to <<). A pixel afterwards is a bit * can use the offset as right argument to <<). A pixel afterwards is a bit
* stream and is written to video memory as that unmodified. This implies * stream and is written to video memory as that unmodified.
* big-endian byte order if bits_per_pixel is greater than 8. *
* For pseudocolor: offset and length should be the same for all color
* components. Offset specifies the position of the least significant bit
* of the pallette index in a pixel value. Length indicates the number
* of available palette entries (i.e. # of entries = 1 << length).
*/ */
struct fb_bitfield { struct fb_bitfield {
__u32 offset; /* beginning of bitfield */ __u32 offset; /* beginning of bitfield */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment