Linux Framebuffer Layer development
 help / color / mirror / Atom feed
* Endian issue
@ 2006-11-27 14:59 Laurent Lagrange
  0 siblings, 0 replies; only message in thread
From: Laurent Lagrange @ 2006-11-27 14:59 UTC (permalink / raw)
  To: linux-fbdev-devel


Hi
 
I'm writing a framebuffer driver and I have some endian problems. 
My board is big endian (powerpc inside) and I use a little endian 
graphic card. I try to get a 16 bpp RGBA (5/5/5/1) true color mode 
working. Nevertheless, I have troubles with the framebuffer layer.
 
For example, in the color_imageblit function of cfbimgblt.c, if I 
want to draw two 16bpp rgba pixels P0 (0xFFFE) and P1 (0x0001), 
they are packed together like this 0xFFFE_0001. 
In memory, 0xFF is LSB, 0x01 is MSB (big endian). Then this 32bit 
value is "__raw_writel" to the memory of the video card. 

As my videocard works in little endian, I get 0x0100_FEFF. So the 
pixels are at the correct place, but don't have the correct color. 
It would be OK if it was 0x0001_FFFE.
 
My question is :
- is it possible to use generic drawing function (blit, fillrect...) 
on a big endian board with a little endian graphics card ?
- if yes, how can I describe the colors bitfields, without 
patching the kernel code, to get the correct color ?
 
Thanks
Laurent
 

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2006-11-27 14:55 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-11-27 14:59 Endian issue Laurent Lagrange

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox