public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Antonino A. Daplas" <adaplas@gmail.com>
To: Adrian McMenamin <adrianmcmenamin@gmail.com>
Cc: Adrian McMenamin <lkmladrian@gmail.com>,
	linux-kernel@vger.kernel.org, lethal@users.sourceforge.net
Subject: Re: Problems with framebuffer in 2.6.22-git17
Date: Sat, 28 Jul 2007 10:14:46 +0800	[thread overview]
Message-ID: <1185588887.26603.42.camel@daplas> (raw)
In-Reply-To: <92a12cdb0707271806q60fcaa91s77a628b31cd65b4d@mail.gmail.com>

On Sat, 2007-07-28 at 02:06 +0100, Adrian McMenamin wrote:
> On 28/07/07, Antonino A. Daplas <adaplas@gmail.com> wrote:
> 
> >
> But certainly better at 16bpp
> 
> Can mess about with it later to see if I can get the colours right I suppose.
> 

You can start with pvr2fb_setcolreg() and pvr2fb_set_pal_entry().

A few things I've noticed:

1. In pvr2fb_setcolreg(), pvr2fb_set_pal_entry() is called for bpp 16
and 32.  This means that the palette is modifiable, so
FB_VISUAL_TRUECOLOR is probably not the correct visual for this driver,
FB_VISUAL_DIRECTCOLOR is more appropriate.

So, you either remove the call to set_pal_entry() in setcolreg() or
change the visual to FB_VISUAL_DIRECTCOLOR. Of course, with directcolor,
the pseudo_palette is now written with tmp as:

tmp = transp << var->transp.offset | red << var->red.offset |
	green << var->green.offset | blue << var->green.offset;
 

2. Perhaps, the 3rd parameter passed to set_pal_entry() is not  correct?
Maybe you can try doing it like this for all bpp's, assuming ARGB?

pvr2fb_set_pal_entry(par, regno, transp << 24 | red << 16 | green << 8 |
			blue);

And if you want to maintain FB_VISUAL_TRUECOLOR format, initialize the
palette once on init:

for (i = 0; i < 256; i++)
	pvr2fb_set_pal_entry(par, i, i << 24 | i << 16 | i << 8 | i);

to create a linear color map consistent with truecolor, then remove all
other calls to pvr2fb_set_pal_entry().

Tony



  reply	other threads:[~2007-07-28  2:15 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-22 18:41 Problems with framebuffer in 2.6.22-git17 Adrian McMenamin
2007-07-22 21:02 ` Adrian McMenamin
2007-07-22 23:22 ` Antonino A. Daplas
     [not found]   ` <8b67d60707231324k28f3cd45p287418fd77feaf00@mail.gmail.com>
2007-07-23 20:35     ` Adrian McMenamin
2007-07-23 21:06     ` Paul Mundt
2007-07-24 21:45   ` Adrian McMenamin
2007-07-25 23:33     ` Antonino A. Daplas
2007-07-27 19:47       ` Adrian McMenamin
2007-07-27 20:18         ` Adrian McMenamin
2007-07-27 21:31           ` Antonino A. Daplas
2007-07-27 22:25             ` Adrian McMenamin
2007-07-27 23:22               ` Antonino A. Daplas
2007-07-28  0:32                 ` Adrian McMenamin
2007-07-28  0:52                   ` Antonino A. Daplas
2007-07-28  1:06                     ` Adrian McMenamin
2007-07-28  2:14                       ` Antonino A. Daplas [this message]
2007-07-28  2:18                         ` Antonino A. Daplas
2007-07-27 21:43         ` Antonino A. Daplas

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=1185588887.26603.42.camel@daplas \
    --to=adaplas@gmail.com \
    --cc=adrianmcmenamin@gmail.com \
    --cc=lethal@users.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lkmladrian@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox