kernel 2.4.18 endianness logical mistakes correction on fbcon-cfb2.c and fbcon-cfb4.c

kernel 2.4.18 endianness logical mistakes correction on fbcon-cfb2.c and fbcon-cfb4.c

Post by Fran?ois Leblan » Sat, 25 May 2002 19:00:13



DESCRIPTIONS:

2 small patchs to apply to:

drivers\video\fbcon-cfb2.c
drivers\video\fbcon-cf4.c o

This patchs correct the endianness logical of nibbletab, the first table is
u_char mades so no endian needed and the second swap correctly bytes in
LITTLE_ENDIAN. (old version swap half bytes instead of bytes).

 --- fbcon-cfb2.c.orig Fri May 24 10:24:17 2002

      */

 static u_char nibbletab_cfb2[]={
-#if defined(__BIG_ENDIAN)
  0x00,0x03,0x0c,0x0f,
  0x30,0x33,0x3c,0x3f,
  0xc0,0xc3,0xcc,0xcf,
  0xf0,0xf3,0xfc,0xff
-#elif defined(__LITTLE_ENDIAN)
- 0x00,0xc0,0x30,0xf0,
- 0x0c,0xcc,0x3c,0xfc,
- 0x03,0xc3,0x33,0xf3,
- 0x0f,0xcf,0x3f,0xff
-#else
-#error FIXME: No endianness??
-#endif
 };

--- fbcon-cfb4.c.orig Fri May 24 10:24:27 2002

     0xf000,0xf00f,0xf0f0,0xf0ff,
     0xff00,0xff0f,0xfff0,0xffff
 #elif defined(__LITTLE_ENDIAN)
-    0x0000,0xf000,0x0f00,0xff00,
-    0x00f0,0xf0f0,0x0ff0,0xfff0,
-    0x000f,0xf00f,0x0f0f,0xff0f,
-    0x00ff,0xf0ff,0x0fff,0xffff
+    0x0000,0x0f00,0xf000,0xff00,
+    0x000f,0x0f0f,0xf00f,0xff0f,
+    0x00f0,0x0ff0,0xf0f0,0xfff0,
+    0x00ff,0x0fff,0xf0ff,0xffff
 #else
 #error FIXME: No endianness??
 #endif

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

 
 
 

kernel 2.4.18 endianness logical mistakes correction on fbcon-cfb2.c and fbcon-cfb4.c

Post by Russell Kin » Sat, 25 May 2002 19:10:15



> This patchs correct the endianness logical of nibbletab, the first table is
> u_char mades so no endian needed and the second swap correctly bytes in
> LITTLE_ENDIAN. (old version swap half bytes instead of bytes).

A recent discussion on the ARM mailing lists has highlighted that hardware
designers seem to like connecting such things like LCD panels up to devices
in weird and wonderful ways - sometimes with a set of 4 pixels reversed,
sometimes with even weirder connectivity.  I've pointed them at the
framebuffer dev list.

Certainly your fbcon-cfb4 changes will break at least one of my machines
here.

Please talk this over with the framebuffer dev list.


--

             http://www.arm.linux.org.uk/personal/aboutme.html

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

 
 
 

kernel 2.4.18 endianness logical mistakes correction on fbcon-cfb2.c and fbcon-cfb4.c

Post by Geert Uytterhoeve » Sun, 26 May 2002 23:20:15



> DESCRIPTIONS:

> 2 small patchs to apply to:

> drivers\video\fbcon-cfb2.c
> drivers\video\fbcon-cf4.c o

> This patchs correct the endianness logical of nibbletab, the first table is
> u_char mades so no endian needed and the second swap correctly bytes in
> LITTLE_ENDIAN. (old version swap half bytes instead of bytes).

For pixels smaller than a byte, it also depends on what's the order of the
pixels in a byte. So all possibilities are actually possible.

Gr{oetje,eeting}s,

                                                Geert

--

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

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

 
 
 

kernel 2.4.18 endianness logical mistakes correction on fbcon-cfb2.c and fbcon-cfb4.c

Post by Fran?ois Leblan » Tue, 04 Jun 2002 17:30:09


Quote:> > This patchs correct the endianness logical of nibbletab, the first table
is
> > u_char mades so no endian needed and the second swap correctly bytes in
> > LITTLE_ENDIAN. (old version swap half bytes instead of bytes).

> For pixels smaller than a byte, it also depends on what's the order of the
> pixels in a byte. So all possibilities are actually possible.

All is possible but for LITTLE ENDIAN and BIG ENDIAN are clearly defined by
the swap of bytes only and not the order of bytes, you can't use the same
definition LITTLE_ENDIAN for swapping bytes in part of hardware (0xABCD ->
0xCDAB) and swapping bytes orders in overs hardwares parts (0xABCD ->
0xDCBA). I suppose this swap order has been introduced for specifics
hardwares requirements, it's ok but only with another option than LITTLE
ENDIAN, since it's incoherent.

Fran?ois.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

 
 
 

1. friendly kernel 2.4.18 endianness logical mistakes patch correction on fbcon-cfb2.c and fbcon-cfb4.c

DESCRIPTIONS:

SECOND VERSION 2 small patchs to apply to::

drivers\video\fbcon-cfb2.c
drivers\video\fbcon-cf4.c o

This patchs correct the endianness logical of nibbletab, the first table is
u_char mades so no endian needed and the second swap correctly bytes in
LITTLE_ENDIAN. (old version swap half bytes instead of bytes).

Second version, is much more FRIENDLY and don't break current tree but let
the ability to create new option in driver/video/Config.in, option
CONFIG_FBCON_NOSWAP witch reverse and correct tables orders for fbcon-cfb4.c
and fbcon-cfb2.c.
Patchs don't add currently the CONFIG_FBCON_NOSWAP option definition in
Config.in since I use it in other tree so this can be quickly integrated to
linux kernel and defined in other linux kernel tree without too much
unuseful changes. Option will be added in main linux kernel
driver/video/Config.in only if necessary (It supposed not).

--- fbcon-cfb2.c.orig Tue Jun 11 15:27:57 2002

      */

 static u_char nibbletab_cfb2[]={
-#if defined(__BIG_ENDIAN)
+#if defined(__BIG_ENDIAN) || (defined(__LITTLE_ENDIAN) && defined
(CONFIG_FBCON_NOSWAP))
  0x00,0x03,0x0c,0x0f,
  0x30,0x33,0x3c,0x3f,
  0xc0,0xc3,0xcc,0xcf,

--- fbcon-cfb4.c.orig Tue Jun 11 15:27:35 2002

     0x0f00,0x0f0f,0x0ff0,0x0fff,
     0xf000,0xf00f,0xf0f0,0xf0ff,
     0xff00,0xff0f,0xfff0,0xffff
-#elif defined(__LITTLE_ENDIAN)
+#elif defined(__LITTLE_ENDIAN) && defined (CONFIG_FBCON_NOSWAP)
+    0x0000,0x0f00,0xf000,0xff00,
+    0x000f,0x0f0f,0xf00f,0xff0f,
+    0x00f0,0x0ff0,0xf0f0,0xfff0,
+    0x00ff,0x0fff,0xf0ff,0xffff
+#elif defined(__LITTLE_ENDIAN)
     0x0000,0xf000,0x0f00,0xff00,
     0x00f0,0xf0f0,0x0ff0,0xfff0,
     0x000f,0xf00f,0x0f0f,0xff0f,

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

2. bizarre permissions problem

3. kernel 2.4.18 final : SET_PERSONALITY fix in rc4 mistake

4. Modem difficulties and more...

5. Linux Kernel Crash - Vanilla 2.4.18/Redhat 2.4.18-5

6. PAM Problems...?

7. Linux Kernel Crash - Vanilla 2.4.18/Redhat 2.4.18-5 (2nd try =) )

8. News??

9. what is the difference between 2.4.18-14 and 2.4.18-17.8.0

10. sorry mistake: [2.4.18] another oops in smbfs

11. Very High Load on Disk Activity in 2.4.18 (and 2.4.18-pre8)

12. newnat13-and-helpers-2.4.18.gz Failed to patch with linux 2.4.18 kernel?

13. (Correction) 2.4.18 model 0x02 CPU for family 0x0F