[Libdlo] Endian Problem in udlfb

S.K Han hsk1385 at postech.ac.kr
Fri Jun 12 09:40:03 PDT 2009


 Hello.

 I tried modifying udlfb.c to prove endian problem in PowerPC (big-endian architecture)
 
 I modified pseudo palette bit definition part in dlfb_setcolreg()  function. but, It don't works, too
 
 Please give some clue :)

 My modified code is

in the header (endian convert function)
----------------------------
+#define SWAP32(l) \
+(((((l) & 0xff000000) >> 24)| \
+(((l) & 0x00ff0000) >> 8)  | \
+(((l) & 0x0000ff00) << 8)  | \
+(((l) & 0x000000ff) << 24)))

in dlfb_setcolreg() function
--------------------------- 
+ u32 endian_temp;
- ((u32 *) (info->pseudo_palette))[regno] =
+ endian_temp =
                            ((red & 0xf800) >> 1) |
                            ((green & 0xf800) >> 6) | ((blue & 0xf800) >> 11);
+                          ((u32 *) (info->pseudo_palette))[regno] = SWAP32(endian_temp);
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freedesktop.org/archives/libdlo/attachments/20090613/d0af72c8/attachment.html 


More information about the Libdlo mailing list