Re: 8 bit to 18 bit per pixel lookup palette
- From: "Voidcoder" <voidcoder@xxxxxxxxx>
- Date: Mon, 27 Mar 2006 09:26:40 +0200
Ok, forget about two extra pixels, just have checked
the PXA manual. You are shifting it right.
I do it this way:
palette[i] =
(
((DWORD)(source[i].peBlue >> 2) << 2) |
((DWORD)(source[i].peGreen >> 2) << 10) |
((DWORD)(source[i].peRed >> 2) << 18)
);
You may want to check what palette size you are
programming to the LDCMD? Any chance you
are writing less than 1024 bytes?
"Voidcoder" <voidcoder@xxxxxxxxx> wrote in message news:O8e0W4WUGHA.1564@xxxxxxxxxxxxxxxxxxxxxxx
Hi Bill,
The idea is right, but DO NOT cast the color bits to BYTE
because they got cutted, use DWORD instead. Also it seems
you are missing 2-bits per color when shifting. Try this instead:
v_PaletteBuffer->palette[i]=
(
((DWORD)(source[i].peBlue & 0xFC) << 2) |
((DWORD)(source[i].peGreen & 0xFC) << 10) |
((DWORD)(source[i].peRed & 0xFC) << 18)
);
"authorwjf" <authorwjf@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:36748FE6-F86E-4713-83DE-08CB47479E81@xxxxxxxxxxxxxxxx
Hi Voidcoder,
I am about to call it quits for the day. But i wanted to say I feel like I
am getting very close thanks to your insights. I have modifed the SetPalette
routine to look like this:
v_PaletteBuffer->palette[i]=(DWORD)(
(BYTE) (source[i].peBlue) & 0xfc) |
(BYTE) ((source[i].peGreen & 0xfc)<<8)) |
(BYTE) ((source[i].peRed & 0xfc)<<16)));
The result is close. The blue is there but red and green need work. It
looks like I just have an issue with how I am dropping the bits into the
palette. Any chance I could get a look at what you did here?
Have a good weekend :)
"Voidcoder" wrote:
Well, here are some tips to enable this mode:
1. Correct the frame buffer size to be (Width x Height x 1),
ie. 8-bpp. A properly written driver will calculate
frame size automatically depending on the BPP.
2. Among the main video buffer in RAM, allocate one
more buffer for the palette memory. You will need also
to setup one more DMA descriptor for it, which has
PAL bit (26) set in the LDCMD field.
3. In your GPE::SetPalette(const PALETTEENTRY * source, ...)
method store "source" entries to the pallete buffer in RAM.
Note you have to pack the entries properly, depending on the
pixel format (see PXA documentation) and the actual LCD
connection.
4. Make sure you are using 8-bpp format in the following places:
- When creating your primary DDGPESurf surface.
- When returning the mode info in your GPE::GetModeInfo().
- Drawing primitives and cursor functions.
"voidcoder" <voidcoder@xxxxxxxxx> wrote in message news:u5rixvsTGHA.2816@xxxxxxxxxxxxxxxxxxxxxxx
Sorry, don't have my sources close at hand
right now. I can give you some tips tomorrow.
"authorwjf" <authorwjf@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:07951CCB-EB95-4AFA-80FE-A975DA3BF6D9@xxxxxxxxxxxxxxxx
Thanks voidcoder. I honestly don't have a problem with 8 to 18 bit lookup.
I just have no idea how to go about it. Is there some reference you could
maybe point me to that explains the basics of implementing palette lookups?
"voidcoder" wrote:
There is nothing to do about it. 8 to 18 lookup palette is the only
possible solution on PXA. I'm using it too in several xscale projects.
The GDI does not support 18bpp. The only supported pixel formats
are 1, 2, 4, 8, 16, 24, 32.
"authorwjf" <authorwjf@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:D162F489-0093-4B73-BE34-1FCB9B8AD764@xxxxxxxxxxxxxxxx
Hi All,
I am hoping someone out there can point me in the right direction. I have
found several posts discussing this issue but none of them give me a good
idea of where to start. I have an 18-bpp panel connected to an XSCALE 270
design based on the MAINSTONE reference. I am supporting 3 panels: an 8,
16,
and 18bpp. The first two came along nicely but the last looks awful. I
have
come to believe I must confiugre the controller for 8-bpp, and then use
some
kind of look up palette to correct the color issues. Has anyone out there
got any suggestions for me on where to start? I'd very much appreciate
any
clues. I am hoping its just a matter of modifying syspal.h, but even if
that
is the case I have no idea what sort of modifications I'd be making.
Thanks in advance to anyone who might have some suggestions for me.
Bill
.
- Follow-Ups:
- Re: 8 bit to 18 bit per pixel lookup palette
- From: authorwjf
- Re: 8 bit to 18 bit per pixel lookup palette
- References:
- Re: 8 bit to 18 bit per pixel lookup palette
- From: voidcoder
- Re: 8 bit to 18 bit per pixel lookup palette
- From: Voidcoder
- Re: 8 bit to 18 bit per pixel lookup palette
- From: authorwjf
- Re: 8 bit to 18 bit per pixel lookup palette
- From: Voidcoder
- Re: 8 bit to 18 bit per pixel lookup palette
- Prev by Date: Re: 8 bit to 18 bit per pixel lookup palette
- Next by Date: Re: Bluetooth ftp profile failure?!!
- Previous by thread: Re: 8 bit to 18 bit per pixel lookup palette
- Next by thread: Re: 8 bit to 18 bit per pixel lookup palette
- Index(es):
Relevant Pages
|