public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] kernel 2.4.18 endianness logical mistakes correction on fbcon-cfb2.c and fbcon-cfb4.c
@ 2002-05-24  9:55  François Leblanc
  2002-05-24 10:06 ` Russell King
  2002-05-25 13:45 ` Geert Uytterhoeven
  0 siblings, 2 replies; 4+ messages in thread
From:  François Leblanc @ 2002-05-24  9:55 UTC (permalink / raw)
  To: linux-kernel

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
+++ fbcon-cfb2.c Fri May 24 10:29:30 2002
@@ -32,19 +32,10 @@
      */

 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
+++ fbcon-cfb4.c Fri May 24 10:25:43 2002
@@ -38,10 +38,10 @@
     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



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

* Re: [PATCH] kernel 2.4.18 endianness logical mistakes correction on fbcon-cfb2.c and fbcon-cfb4.c
  2002-05-24  9:55 [PATCH] kernel 2.4.18 endianness logical mistakes correction on fbcon-cfb2.c and fbcon-cfb4.c  François Leblanc
@ 2002-05-24 10:06 ` Russell King
  2002-05-25 13:45 ` Geert Uytterhoeven
  1 sibling, 0 replies; 4+ messages in thread
From: Russell King @ 2002-05-24 10:06 UTC (permalink / raw)
  To: François Leblanc; +Cc: linux-kernel

On Fri, May 24, 2002 at 11:55:38AM +0200,  François Leblanc wrote:
> 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.

	linux-fbdev-devel@lists.sourceforge.net

-- 
Russell King (rmk@arm.linux.org.uk)                The developer of ARM Linux
             http://www.arm.linux.org.uk/personal/aboutme.html


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

* Re: [PATCH] kernel 2.4.18 endianness logical mistakes correction on fbcon-cfb2.c and fbcon-cfb4.c
  2002-05-24  9:55 [PATCH] kernel 2.4.18 endianness logical mistakes correction on fbcon-cfb2.c and fbcon-cfb4.c  François Leblanc
  2002-05-24 10:06 ` Russell King
@ 2002-05-25 13:45 ` Geert Uytterhoeven
  2002-06-03  8:26   ` [PATCH] kernel 2.4.18 endianness logical mistakes correction onfbcon-cfb2.c "  François Leblanc
  1 sibling, 1 reply; 4+ messages in thread
From: Geert Uytterhoeven @ 2002-05-25 13:45 UTC (permalink / raw)
  To:  François Leblanc; +Cc: Linux Kernel Development

On Fri, 24 May 2002, =?ISO-8859-1?Q? Fran=E7ois?= Leblanc wrote:
> 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

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

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


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

* Re: [PATCH] kernel 2.4.18 endianness logical mistakes correction onfbcon-cfb2.c and fbcon-cfb4.c
  2002-05-25 13:45 ` Geert Uytterhoeven
@ 2002-06-03  8:26   `  François Leblanc
  0 siblings, 0 replies; 4+ messages in thread
From:  François Leblanc @ 2002-06-03  8:26 UTC (permalink / raw)
  To: Geert Uytterhoeven; +Cc: Linux Kernel Development

> > 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.



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

end of thread, other threads:[~2002-06-03  8:27 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-05-24  9:55 [PATCH] kernel 2.4.18 endianness logical mistakes correction on fbcon-cfb2.c and fbcon-cfb4.c  François Leblanc
2002-05-24 10:06 ` Russell King
2002-05-25 13:45 ` Geert Uytterhoeven
2002-06-03  8:26   ` [PATCH] kernel 2.4.18 endianness logical mistakes correction onfbcon-cfb2.c "  François Leblanc

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