[U-Boot-Users] [PATCH] wrong lcd splashscreen colors (pxa)

Francesco Mandracci francesco.mandracci at primaelectronics.com
Fri Sep 16 12:41:19 CEST 2005


Wolfgang Denk wrote:
> It's working fine on all the PowerPC systems where I am able to test.
you forgot to quote this:
  The error is not evident until you use full colors (i.e. if color RGB
  components/bytes are either 0x00 of 0xff).

In other (maybe clearer) words: "all bitmaps with palette colors whose
RGB components don't differ in the 5 high bits in the blue byte and in
the 6 high bits in the green byte" will display correctly.

That may seem not so important, but if you are testing the lcd wirings
of the brand new hardware then you really want each color to be ok down
to the last bit!
[http://www.dreamvideo.it/video/immagini/monoscopio.jpg]

>>I'm working on a PXA270 but this seems general (as far as I understand).
> Probably not general, but maybe byte-order dependent ?
No, it's not endianness dependent:
1) "bmp_color_table_entry_t" is byte order independent (4 packed __u8
fields)
2) "ushort colreg" is used coherently in each operation

The C code fills a 16bit palette entry with 3 RGB bytes in the form

  RRRR RGGG GGGB BBBB
 [....|....|....|....]  masks: (R,G,B) (0xf800, 0x07e0, 0x001f)
  fedc ba98 7654 3210

The used bits are the highest 5 bits for the red and blue bytes and the
 6 high bits for the green byte. This did not change neither in PowerPC
nor in PXA in all cvs.sf.net revisions I've found.

The computation may be either:
colreg = ((red   & 0xf8) << 8)  /* [RRRR|Rrrr|....|....]     */
       | ((green & 0xfc) << 3)  /* [....|.GGG|GGGg|g...]     */
       | ((blue  & 0xf8) >> 3); /* [....|....|...B|BBBB]bbb. */
or:
colreg = ((red   << 8) & 0xf800)
       | ((green << 3) & 0x07e0)   /* versus " << 4" */
       | ((blue  >> 3) & 0x001f);  /* versus " >> 0" */
I choose the latter form because it's the way you adopted.

> Please see section "Submitting Patches" in the README. In  this  form
> this  is  not  acceptable.
Yes Sir! :) :) :)
Actually, please forgive me if I didn't follow all your recommendations.
As an excuse: I understand your heavy efforts (not only in this mailing
list), but it was only a two-lines very-punctual not-show-stopper patch. :)

Anyway, if we'll going to use Das U-Boot in the company product then
I'll ask for MACH_TYPE_ stuff and propose some bigger patches regarding
CONFIGS_PXA27x. But today there is still nothing stable enough on my
side... with the exception of this little splashscreen issue.

Ciao
    Francesco Mandracci




More information about the U-Boot mailing list