nanogui: Messed-up Colours in 16bpp Mode...


Previous by date: 8 Nov 2001 09:34:18 -0000 problem with display char!, li hui
Next by date: 8 Nov 2001 09:34:18 -0000 Re: Messed-up Colours in 16bpp Mode..., Greg Haerr
Previous in thread:
Next in thread: 8 Nov 2001 09:34:18 -0000 Re: Messed-up Colours in 16bpp Mode..., Greg Haerr

Subject: Messed-up Colours in 16bpp Mode...
From: "Brian" ####@####.####
Date: 8 Nov 2001 09:34:18 -0000
Message-Id: <002501c16839$4c312bc0$5301a8c0@mltc.com.tw>

Hello all,

My name is Brian.  My company is working on a port of Microwindows to our
ARM-based chip.
We have gotten the uClinux (for non-MMU CPUs) to run on our chip.  Nano-X is
compiled successfully and running.
The problem is that when we run nanowm + hello-world, the colours are all
messed up even though the shape is preserved
(it was very exciting when we saw the window popped up :-).

The hardware setting is an LCD controller embedded in our chip plus a TFT
LCD panel.  The LCD controller is set in
16bpp mode.  The video data format is as follows:

bit    15------11  10-------5  4--------0
              B               G              R

We're not sure what to modify to correctly configure Nano-X in 16bpp mode.
So far, we've set:
    SCREEN_PIXTYPE           = MWPF_TRUECOLOR565
in the config file and also, inside fb_open():
    psd->pixtype = MWPF_TRUECOLOR565;
in our own scr_driver.c

We also replaced the PIXVAL <-> COLOR macros in device.h:
#define RGB2PIXEL565(r,g,b) \
  ((((b) & 0xf8) << 8) | (((g) & 0xfc) << 3) | (((r) & 0xf8) >> 3))
#define COLOR2PIXEL565(c) \
  ( ( ((c)&0xf8)>>3 ) | ( ((c)&0xfc00)>>5 ) | ( ((c)&0xf80000)>>8 ) )

#define PIXEL565BLUE(pixelval)  (((pixelval) >> 11) & 0x1f)
#define PIXEL565GREEN(pixelval)  (((pixelval) >> 5) & 0x3f)
#define PIXEL565RED(pixelval)  ((pixelval) & 0x1f)

#define PIXEL565TOCOLORVAL(p) \
  ((((p) & 0xf800) << 8) | (((p) & 0x07e0) << 5) | (((p) & 0x1f) << 3))

I'm not sure if the modifications on the macros make sense.  The original
macros don't seem to match our video data format.

Could anyone give me a hand?  Any help is appreciated.  A short tutorial on
how Microwindows manages colours will be very helpful.

Thank you. : )


Brian



Previous by date: 8 Nov 2001 09:34:18 -0000 problem with display char!, li hui
Next by date: 8 Nov 2001 09:34:18 -0000 Re: Messed-up Colours in 16bpp Mode..., Greg Haerr
Previous in thread:
Next in thread: 8 Nov 2001 09:34:18 -0000 Re: Messed-up Colours in 16bpp Mode..., Greg Haerr


Powered by ezmlm-browse 0.20.