linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* radeonfb and 16bit color problem
@ 2002-06-21  3:29 Bryan Stillwell
  2002-06-24  3:24 ` Benjamin Herrenschmidt
  0 siblings, 1 reply; 4+ messages in thread
From: Bryan Stillwell @ 2002-06-21  3:29 UTC (permalink / raw)
  To: linux-fbdev-devel

I'm using version 0.1.5 of the radeonfb driver that Ani Joshi posted on
this list earlier this month with kernel 2.4.19pre10, and I've run into
a problem with the colors not being right in 16bit color mode.  In 15bit
color mode, everything seems to look good...

Since running `fbset 800x600-75 -depth 16` seems to want to switch to
15bit color and not 16bit color, I had to use `fbset 800x600-75 -depth
16 -rgba 5,6,5,0` to get into 16bit color mode.  However, once I'm in
16bit color and try to view some jpegs using fbi, the colors are messed
up.

Based of of how the colors in the images are changing, I'm guessing
that the video card is only using the lower 5 bits of green instead of
all 6 bits (chopping off the most significant bit.)  This causes colors
that were only 50% green before to become 100% green (and 25% green
before to become 50%.)

Any ideas would be helpful.  I tried looking at the code myself, but I'm
still quite new to the framebuffer code.  However, this part looked kind
of strange to me:

   /* For 565, the green component is mixed one order below */
   if (rinfo->depth == 16) {
      OUTREG(PALETTE_INDEX, pindex>>1);
      OUTREG(PALETTE_DATA, (rinfo->palette[regno>>1].red << 16) |
             (green << 8) | (rinfo->palette[regno>>1].blue));
      green = rinfo->palette[regno<<1].green;
   }


BTW, I have a Radeon 8500 (QL).

Thanks,
Bryan


-------------------------------------------------------
Sponsored by:
ThinkGeek at http://www.ThinkGeek.com/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: radeonfb and 16bit color problem
  2002-06-21  3:29 radeonfb and 16bit color problem Bryan Stillwell
@ 2002-06-24  3:24 ` Benjamin Herrenschmidt
  2002-06-25 16:41   ` Bryan Stillwell
  0 siblings, 1 reply; 4+ messages in thread
From: Benjamin Herrenschmidt @ 2002-06-24  3:24 UTC (permalink / raw)
  To: Bryan Stillwell, linux-fbdev-devel

>Any ideas would be helpful.  I tried looking at the code myself, but I'm
>still quite new to the framebuffer code.  However, this part looked kind
>of strange to me:
>
>   /* For 565, the green component is mixed one order below */
>   if (rinfo->depth == 16) {
>      OUTREG(PALETTE_INDEX, pindex>>1);
>      OUTREG(PALETTE_DATA, (rinfo->palette[regno>>1].red << 16) |
>             (green << 8) | (rinfo->palette[regno>>1].blue));
>      green = rinfo->palette[regno<<1].green;
>   }
>
>
>BTW, I have a Radeon 8500 (QL).

I wrote that part and it works just fine on my powerbook... at least with
the radeonfb version that is in my tree, but I don't think it differs
from the official one in this regard. You can try making sure it's properly
setting 32 palette entries for green when using that mode.

Ben.




-------------------------------------------------------
Sponsored by:
ThinkGeek at http://www.ThinkGeek.com/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: radeonfb and 16bit color problem
  2002-06-25 16:41   ` Bryan Stillwell
@ 2002-06-24  5:41     ` Benjamin Herrenschmidt
  0 siblings, 0 replies; 4+ messages in thread
From: Benjamin Herrenschmidt @ 2002-06-24  5:41 UTC (permalink / raw)
  To: Bryan Stillwell; +Cc: linux-fbdev-devel

>I thought that piece of code looked weird because it's setting green
>equal to rinfo->palette[regno<<1].green, but doesn't seem to ever use
>green during the rest of the function...

It should about 2 lines below ... at least in my tree.

>BTW, don't you mean 64 palette entries for green (being that it's 6
>bits)? 

Yah, sorry, typing too fast ;)

>Anyways, I took some time this weekend to look over the code
>some more, and I really doubt my problems originates in that function.
>As I understand it, the palette (colormap?) will only be used when
>displaying colors in text mode.

Hrm... there HW colormap is used in all modes in recent drivers, thus
you can actually set a gamma table. The driver should set it to a
linear ramp by default though that may be broken.

>My problem seems to affect many more colors (practically all 65536 of
>them), but I've yet to track it down.  I put in a request on ATI's
>website to get access to the specs (hoping that'll help me), but I
>haven't heard anything back from them yet.

Ben.



-------------------------------------------------------
This sf.net email is sponsored by: Jabber Inc.
Don't miss the IM event of the season | Special offer for OSDN members! 
JabConf 2002, Aug. 20-22, Keystone, CO http://www.jabberconf.com/osdn

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: radeonfb and 16bit color problem
  2002-06-24  3:24 ` Benjamin Herrenschmidt
@ 2002-06-25 16:41   ` Bryan Stillwell
  2002-06-24  5:41     ` Benjamin Herrenschmidt
  0 siblings, 1 reply; 4+ messages in thread
From: Bryan Stillwell @ 2002-06-25 16:41 UTC (permalink / raw)
  To: Benjamin Herrenschmidt; +Cc: linux-fbdev-devel

On Mon, Jun 24, 2002 at 05:24:11AM +0200, Benjamin Herrenschmidt wrote:
>>Any ideas would be helpful.  I tried looking at the code myself, but I'm
>>still quite new to the framebuffer code.  However, this part looked kind
>>of strange to me:
>>
>>   /* For 565, the green component is mixed one order below */
>>   if (rinfo->depth == 16) {
>>      OUTREG(PALETTE_INDEX, pindex>>1);
>>      OUTREG(PALETTE_DATA, (rinfo->palette[regno>>1].red << 16) |
>>             (green << 8) | (rinfo->palette[regno>>1].blue));
>>      green = rinfo->palette[regno<<1].green;
>>   }
>>
>>
>>BTW, I have a Radeon 8500 (QL).
>
>I wrote that part and it works just fine on my powerbook... at least
>with the radeonfb version that is in my tree, but I don't think it
>differs from the official one in this regard. You can try making sure
>it's properly setting 32 palette entries for green when using that
>mode.

I thought that piece of code looked weird because it's setting green
equal to rinfo->palette[regno<<1].green, but doesn't seem to ever use
green during the rest of the function...

BTW, don't you mean 64 palette entries for green (being that it's 6
bits)?  Anyways, I took some time this weekend to look over the code
some more, and I really doubt my problems originates in that function.
As I understand it, the palette (colormap?) will only be used when
displaying colors in text mode.

My problem seems to affect many more colors (practically all 65536 of
them), but I've yet to track it down.  I put in a request on ATI's
website to get access to the specs (hoping that'll help me), but I
haven't heard anything back from them yet.

Thanks,
Bryan

PS I'll try checking out your tree the next time I get a chance and see
if I still see the problem.


-------------------------------------------------------
This sf.net email is sponsored by: Jabber Inc.
Don't miss the IM event of the season | Special offer for OSDN members! 
JabConf 2002, Aug. 20-22, Keystone, CO http://www.jabberconf.com/osdn

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2002-06-25 17:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-06-21  3:29 radeonfb and 16bit color problem Bryan Stillwell
2002-06-24  3:24 ` Benjamin Herrenschmidt
2002-06-25 16:41   ` Bryan Stillwell
2002-06-24  5:41     ` Benjamin Herrenschmidt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).