All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <syrjala@sci.fi>
To: Geert Uytterhoeven <geert.uytterhoeven@gmail.com>
Cc: Linux-fbdev-devel <linux-fbdev-devel@lists.sourceforge.net>,
	Michal Januszewski <michalj@gmail.com>
Subject: Re: Fix 8bpp RGB fields length
Date: Mon, 30 Mar 2009 00:18:19 +0300	[thread overview]
Message-ID: <20090329211819.GX10127@sci.fi> (raw)
In-Reply-To: <10f740e80903291226m68689d51vf8b52a2e3beb9cf2@mail.gmail.com>

On Sun, Mar 29, 2009 at 09:26:02PM +0200, Geert Uytterhoeven wrote:
> On Sun, Mar 29, 2009 at 21:14, Michal Januszewski <michalj@gmail.com> wrote:
> > On Mon, Mar 2, 2009 at 19:02, Krzysztof Helt <krzysztof.h1@poczta.fm> wrote:
> > A slight omission in the fbdev API I suppose since the LUT entries are
> >>> nearly always 3*8bits wide. VGA being the exception.
> >>
> >> If offsets of all RGB components are the same the length field says
> >> how lone the pallete index is. It does not say anything how long
> >> the LUT entries are. This is the same misunderstanding as done
> >> inside the driver.
> >
> > Where is this meaning of the length field defined?  While I agree
> > that interpreting it as the length of the palette seems to make
> > more sense (considering the current FB API), there are several
> > places in the fbdev code contradicting this interpretation
> > (comments in skeletonfb.c, vfb.c, code in vga16fb.c, ..).
> 
> Originally it was the width of the color component in the DAC, i.e. 6
> for VGA with 18 bit color palettes.
> Later is was redefined to be the width of the bitfield in the pixel
> data, for consistency with
> other visuals (pseudocolor is directcolor where the R, G, B, and A
> bitfields overlap),
> and to handle hardware where the number of palette entries is not 1 << bpp
> (e.g. 64 colors in 8 bpp packed pixels).
> 
> That's why vfb.c has an (obsolete) comment:
> 
>          * Pseudocolor:
>          *    uses offset = 0 && length = RAMDAC register width.
>          *    var->{color}.offset is 0
>          *    var->{color}.length contains widht of DAC
> 
> while the (newer) skeletonfb mentions both:
> 
>      * Pseudocolor:
>      *    var->{color}.offset is 0
>      *    var->{color}.length contains width of DAC or the number of unique
>      *                        colors available (color depth)
> 
> vga16fb.c is also an old driver.
> 
> > IMO, if we're going to fix uvesafb, we should also fix all the
> > other drivers and documentation along with it.
> 
> Yep.

The comment explaining fb_bitfield in linux/fb.h seems to need some
fixing too ie. remove the big-endian comment as I think everyone just
assumes the fb_bitfield values are in the device's native endianness.

-- 
Ville Syrjälä
syrjala@sci.fi
http://www.sci.fi/~syrjala/

------------------------------------------------------------------------------

      reply	other threads:[~2009-03-29 21:18 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-01 20:55 Fix 8bpp RGB fields length Krzysztof Helt
2009-03-02 13:02 ` Ville Syrjälä
2009-03-02 17:02   ` Krzysztof Helt
2009-03-02 17:40     ` Ville Syrjälä
2009-03-29 19:14     ` Michal Januszewski
2009-03-29 19:26       ` Geert Uytterhoeven
2009-03-29 21:18         ` Ville Syrjälä [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090329211819.GX10127@sci.fi \
    --to=syrjala@sci.fi \
    --cc=geert.uytterhoeven@gmail.com \
    --cc=linux-fbdev-devel@lists.sourceforge.net \
    --cc=michalj@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.