Re: [PATCH] fbdev: fix color component field length documentation

From: Geert Uytterhoeven
Date: Tue Mar 31 2009 - 03:18:23 EST


On Tue, Mar 31, 2009 at 00:00, Michal Januszewski <spock@xxxxxxxxxx> wrote:
> 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 the 1 << length is the number
> of palette entries.
>
> Signed-off-by: Michal Januszewski <spock@xxxxxxxxxx>
> Cc: Krzysztof Helt <krzysztof.h1@xxxxxxxxx>
> Cc: Ville SyrjÃlà <syrjala@xxxxxx>
> Cc: Geert Uytterhoeven <geert.uytterhoeven@xxxxxxxxx>

Acked-by: Geert Uytterhoeven <geert@xxxxxxxxxxxxxx>

Except for this:

> --- a/include/linux/fb.h
> +++ b/include/linux/fb.h
> @@ -172,8 +172,11 @@ struct fb_fix_screeninfo {
> Â/* 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
> Â* 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
> - * big-endian byte order if bits_per_pixel is greater than 8.
> + * stream and is written to video memory as that unmodified.
> + *
> + * For pseudocolor, offset is always 0 and length, which should be the same
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
This is not correct. Offset can be non-zero, e.g. for a 8 bpp frame buffer with
64 palette entries, where the palette index is stored in the upper 6 bits of the
8-bit pixel value, offset would be 2, and length would be 6.
Not that I've seen that (so far)...

> + * for all color components, indicates the number of available palette entries
> + * (i.e. # of entries = 1 << length).
> Â*/
> Âstruct fb_bitfield {
>    Â__u32 offset;          /* beginning of bitfield    Â*/
>

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx

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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/