Skip to contentSkip to conversation

Voyager GX color mapping

DISCUSSION Clemens Koller 3 participants 8 messages Dec 14, 2004 Framebuffer layer

lore
Share & tools
lore
#0 lore raw

Hello, again,

well, my version of the Silicon Motion SM501 driver works now quite well on the PowerMac (after some data integrity problems with the card having in a dusty PCI slot. :-(( )

Only one thing is missing: The color mapping in the 32bit mode doesn't fit with X. The fb memory map has a BGRA color mapping but X11 writes it in RGBA.

I have tried to change the fb_var_screeninfo.fb_bitfield values in the driver and via fbset -rgba ... but it seems as X doesn't care at all.

Where do I need to tweak to get it working?
Is there a performance penalty to remap the pixels in software? Which is the optimum way to get correct color mapping?

Thank you in advance,

Clemens Koller
_______________________________
R&D Imaging Devices
Anagramm GmbH
Rupert-Mayer-Str. 45/1
81379 Muenchen
Germany

http://www.anagramm.de
Phone: +49-89-741518-50
Fax: +49-89-741518-19

-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. http://productguide.itmanagersjournal.com/

#1 lore raw
Quoted 9 lines · Clemens Koller

well, my version of the Silicon Motion SM501 driver works now quite well on the PowerMac (after some data integrity problems with the card having in a dusty PCI slot. :-(( )

Only one thing is missing: The color mapping in the 32bit mode doesn't fit with X. The fb memory map has a BGRA color mapping but X11 writes it in RGBA.

I have tried to change the fb_var_screeninfo.fb_bitfield

You should indeed make sure the fb_var_screeninfo.fb_bitfield values are correct. BTW, have you tried fbtest to verify the correctness of your driver? You can check it out from CVS on SourceForge.

Quoted 2 lines

values in the driver and via fbset -rgba ... but it seems as X doesn't care at all.

Fbset wouldn't help here.

Quoted 1 line

Where do I need to tweak to get it working?

X should obey the fb_var_screeninfo.fb_bitfield values. If it doesn't, it's a bug in X.

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds

-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now.
http://productguide.itmanagersjournal.com/

#2 lore raw

Hello, Geert!

Quoted 8 lines
Quoted 8 lines

well, my version of the Silicon Motion SM501 driver works now quite well on the PowerMac (after some data integrity problems with the card having in a dusty PCI slot. :-(( )

Only one thing is missing: The color mapping in the 32bit mode doesn't fit with X. The fb memory map has a BGRA color mapping but X11 writes it in RGBA.

Quoted 5 lines
Quoted 1 line

I have tried to change the fb_var_screeninfo.fb_bitfield

You should indeed make sure the fb_var_screeninfo.fb_bitfield values are correct. BTW, have you tried fbtest to verify the correctness of your driver? You can check it out from CVS on SourceForge.

I got fbset already... thanks.

Well, whenever I change the (yet hardcoded) structs in the driver, fbset -fb /dev/fb2 shows me the correct (changed) values. But there is no change in X at all if I play around with the values. Is it possible that X doesn't get my fb_var_screeninfo? Maybe I need to check xorg.cfg again...
The same things happen in all 32bit (RGBA8888) as well as in 16bit (RGB565) modes (i haven't tried 8bit, as I don't need it). Is this an PPC-endian related problem?
Is the SM501's BGRA mapping usual?
Hmm...

Quoted 3 lines
Quoted 1 line

Where do I need to tweak to get it working?

X should obey the fb_var_screeninfo.fb_bitfield values. If it doesn't, it's a bug in X.

Unlikely, I think?

I use a primary "ATI Radeon If" (fb0, fb1) on Depth 16 successfuly. The SMI501 is the secondary graphics board (fb2) on Depth 16, 24, 32. Does X listen only to the mapping of the primary card? I guess I will get offtopic with the X questions.

Clemens Koller
_______________________________
R&D Imaging Devices
Anagramm GmbH
Rupert-Mayer-Str. 45/1
81379 Muenchen
Germany

http://www.anagramm.de
Phone: +49-89-741518-50
Fax: +49-89-741518-19

-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. http://productguide.itmanagersjournal.com/

#3 lore raw
Quoted 8 lines · Clemens Koller
Quoted 8 lines
Quoted 8 lines

well, my version of the Silicon Motion SM501 driver works now quite well on the PowerMac (after some data integrity problems with the card having in a dusty PCI slot. :-(( )

Only one thing is missing: The color mapping in the 32bit mode doesn't fit with X. The fb memory map has a BGRA color mapping but X11 writes it in RGBA.

Quoted 8 lines
Quoted 6 lines
Quoted 1 line

I have tried to change the fb_var_screeninfo.fb_bitfield

You should indeed make sure the fb_var_screeninfo.fb_bitfield values are correct. BTW, have you tried fbtest to verify the correctness of your driver?
You can check it out from CVS on SourceForge.

I got fbset already... thanks.

I wrote fbtest', not fbset' ;-)

Quoted 5 lines

Well, whenever I change the (yet hardcoded) structs in the driver, fbset -fb /dev/fb2 shows me the correct (changed) values. But there is no change in X at all if I play around with the values. Is it possible that X doesn't get my fb_var_screeninfo? Maybe I need to check xorg.cfg again...

X may try to change the values again. If you're driver allows that (like it seem to do, as per your description above), it may become confusion. Please don't allow to change the bitfields in your driver, only allow the values that the hardware does support.

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds

-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now.
http://productguide.itmanagersjournal.com/

#4 lore raw

Hi, Geert!

Quoted 1 line

I wrote fbtest', not fbset' ;-)

Okay... I will get it... very soon, tomorrow :-)

Quoted 11 lines
Quoted 5 lines

Well, whenever I change the (yet hardcoded) structs in the driver, fbset -fb /dev/fb2 shows me the correct (changed) values. But there is no change in X at all if I play around with the values. Is it possible that X doesn't get my fb_var_screeninfo? Maybe I need to check xorg.cfg again...

X may try to change the values again. If you're driver allows that (like it seem to do, as per your description above), it may become confusion. Please don't allow to change the bitfields in your driver, only allow the values that the hardware does support.

Okay... interesting... How does it (try and fail to) change it? Through IOCTL FBIOPUT_VSCREENINFO? Can I get more debug info out of it? It's all unread-code-land for me yet. My driver might not implement that yet... Is there good documentation in addition to RTFC?

Thanks again... I'll keep on learning.

Clemens

-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. http://productguide.itmanagersjournal.com/

#5 lore raw
Quoted 6 lines · Clemens Koller
Quoted 6 lines
Quoted 5 lines

Well, whenever I change the (yet hardcoded) structs in the driver, fbset -fb /dev/fb2 shows me the correct (changed) values. But there is no change in X at all if I play around with the values. Is it possible that X doesn't get my fb_var_screeninfo? Maybe I need to check xorg.cfg again...

Quoted 8 lines
Quoted 5 lines

X may try to change the values again. If you're driver allows that (like it seem to do, as per your description above), it may become confusion. Please don't allow to change the bitfields in your driver, only allow the values that
the hardware does support.

Okay... interesting... How does it (try and fail to) change it? Through IOCTL FBIOPUT_VSCREENINFO? Can I get more debug info out of it?

Yes, through FBIOPUT_VSCREENINFO. Your driver should refuse invalid values, unless it can round them _up_ to make them valid.

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds

-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now.
http://productguide.itmanagersjournal.com/

#6 lore raw
In reply to Clemens Koller
Quoted 4 lines · Clemens Koller

well, my version of the Silicon Motion SM501 driver works now quite well on the PowerMac (after some data integrity problems with the card having in a dusty PCI slot. :-(( )

Do you have this driver in a tree somewhere? We have a version now in the sh tree that needs to be tossed out and rewritten, and it would be good not to duplicate effort..

#7 lore raw

Hello, Paul,

Quoted 7 lines
Quoted 3 lines

well, my version of the Silicon Motion SM501 driver works now quite well on the PowerMac (after some data integrity problems with the card having in a dusty PCI slot. :-(( )

Do you have this driver in a tree somewhere? We have a version now in the sh tree that needs to be tossed out and rewritten, and it would be good not to duplicate effort..

Currently, it's only local, it's work in progress... PPC tested only. I did quite some code cleanup and removed some redundant/unused code. I added some (my first time) module load/unload capability and lots of test/debug things for HW testing also.

I don't maintain a local CVS tree here yet...
Tell me if I can put it somewhere to the public.

Best greets,

Clemens Koller
_______________________________
R&D Imaging Devices
Anagramm GmbH
Rupert-Mayer-Str. 45/1
81379 Muenchen
Germany

http://www.anagramm.de
Phone: +49-89-741518-50
Fax: +49-89-741518-19

-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. http://productguide.itmanagersjournal.com/