Although the color palette was corrected for little endian by the
commit [e1edf18b: offb: Add palette hack for little endian], the
graphics mode is still shown in psychedelic colors. For fixing this
properly, we rather need to correct the RGB offsets depending on
endianess.
Since the RGB base offsets are corrected, we don't need the hack for
pallette color entries. This patch reverts that, too.
Signed-off-by: Takashi Iwai <redacted>
---
drivers/video/fbdev/offb.c | 51 +++++++++++++++++++++++++++++-----------------
1 file changed, 32 insertions(+), 19 deletions(-)
From: Cedric Le Goater <hidden> Date: 2014-05-14 14:01:37
Hi Iwai-san,
On 05/14/2014 03:21 PM, Takashi Iwai wrote:
Although the color palette was corrected for little endian by the
commit [e1edf18b: offb: Add palette hack for little endian], the
graphics mode is still shown in psychedelic colors.
Are you referring to the linux logo colors ? If so, could you please
try the patch below, it should be a fix.
For fixing this
properly, we rather need to correct the RGB offsets depending on
endianess.
Since the RGB base offsets are corrected, we don't need the hack for
pallette color entries. This patch reverts that, too.
Are you testing using qemu -vga std -vnc :x ? If so, did you try changing
the depth to 8,15,16,32 ? I think the patch might be breaking big endian
too.
Now, I am far from being an expert on frame buffers. It would be glad
to have some insights on that topic.
Thanks,
C.
[PATCH] fb: fix logo palette entries for little endian
The offb_cmap_byteswap() routine helps byteswapping the color map
entries when required. This patch externalizes and renames the helper
routine to adjust the pseudo palette of the logo when running on
little endian.
Signed-off-by: Cédric Le Goater <redacted>
---
drivers/video/fbmem.c | 6 ++++--
drivers/video/offb.c | 11 +----------
include/linux/fb.h | 8 ++++++++
3 files changed, 13 insertions(+), 12 deletions(-)
Index: linux.git/drivers/video/fbmem.c
=================================--- linux.git.orig/drivers/video/fbmem.c
At Wed, 14 May 2014 16:01:17 +0200,
Cedric Le Goater wrote:
Hi Iwai-san,
On 05/14/2014 03:21 PM, Takashi Iwai wrote:
quoted
Although the color palette was corrected for little endian by the
commit [e1edf18b: offb: Add palette hack for little endian], the
graphics mode is still shown in psychedelic colors.
Are you referring to the linux logo colors ? If so, could you please
try the patch below, it should be a fix.
Not only penguin logo but the whole X graphics got strange colors,
too, according to the bug report. I put the original reporter/tester
(Dinar Valeev) to Cc.
I'm merely a person who tries to fix this mess ;)
BTW, did you try to run X on fbdev?
quoted
For fixing this
properly, we rather need to correct the RGB offsets depending on
endianess.
Since the RGB base offsets are corrected, we don't need the hack for
pallette color entries. This patch reverts that, too.
Are you testing using qemu -vga std -vnc :x ? If so, did you try changing
the depth to 8,15,16,32 ?
Yes, it was with qemu -vga std -vnc :x.
About different color depths, Dinar can test / clarify better, I
suppose.
I think the patch might be breaking big endian
too.
Big endian should work as is because my patch uses the original
offsets when fb_be_math() is true. It corrects the RGB offsets if
!fb_be_math().
But, I'm also entirely not sure whether this is 100% correct, either.
Namely, if the RGB offsets were correct for some little endian
machines with offb, my patch would break it, of course. But, then
your previous fix must have already broken it as well, so I took the
same fb_be_math() check.
thanks,
Takashi
I find it very strange you have to touch the generic code in such a way...
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
From: Cedric Le Goater <hidden> Date: 2014-05-14 17:04:19
On 05/14/2014 04:24 PM, Takashi Iwai wrote:
At Wed, 14 May 2014 16:01:17 +0200,
Cedric Le Goater wrote:
quoted
Hi Iwai-san,
On 05/14/2014 03:21 PM, Takashi Iwai wrote:
quoted
Although the color palette was corrected for little endian by the
commit [e1edf18b: offb: Add palette hack for little endian], the
graphics mode is still shown in psychedelic colors.
Are you referring to the linux logo colors ? If so, could you please
try the patch below, it should be a fix.
Not only penguin logo but the whole X graphics got strange colors,
too, according to the bug report. I put the original reporter/tester
(Dinar Valeev) to Cc.
I'm merely a person who tries to fix this mess ;)
BTW, did you try to run X on fbdev?
Not at the time, I was working on the console only, BE and LE.
I just tried fbdev and indeed this is a psychedelic mess :)
Your fix has also issues on BE and console and the patch of mine
below is of no use for fbdev. Damn, this is a nightmare.
C.
quoted
quoted
For fixing this
properly, we rather need to correct the RGB offsets depending on
endianess.
Since the RGB base offsets are corrected, we don't need the hack for
pallette color entries. This patch reverts that, too.
Are you testing using qemu -vga std -vnc :x ? If so, did you try changing
the depth to 8,15,16,32 ?
Yes, it was with qemu -vga std -vnc :x.
About different color depths, Dinar can test / clarify better, I
suppose.
quoted
I think the patch might be breaking big endian
too.
Big endian should work as is because my patch uses the original
offsets when fb_be_math() is true. It corrects the RGB offsets if
!fb_be_math().
But, I'm also entirely not sure whether this is 100% correct, either.
Namely, if the RGB offsets were correct for some little endian
machines with offb, my patch would break it, of course. But, then
your previous fix must have already broken it as well, so I took the
same fb_be_math() check.
thanks,
Takashi
At Wed, 14 May 2014 19:04:00 +0200,
Cedric Le Goater wrote:
On 05/14/2014 04:24 PM, Takashi Iwai wrote:
quoted
At Wed, 14 May 2014 16:01:17 +0200,
Cedric Le Goater wrote:
quoted
Hi Iwai-san,
On 05/14/2014 03:21 PM, Takashi Iwai wrote:
quoted
Although the color palette was corrected for little endian by the
commit [e1edf18b: offb: Add palette hack for little endian], the
graphics mode is still shown in psychedelic colors.
Are you referring to the linux logo colors ? If so, could you please
try the patch below, it should be a fix.
Not only penguin logo but the whole X graphics got strange colors,
too, according to the bug report. I put the original reporter/tester
(Dinar Valeev) to Cc.
I'm merely a person who tries to fix this mess ;)
BTW, did you try to run X on fbdev?
Not at the time, I was working on the console only, BE and LE.
I just tried fbdev and indeed this is a psychedelic mess :)
Your fix has also issues on BE and console and the patch of mine
below is of no use for fbdev. Damn, this is a nightmare.
Hm, so it actually regressed on BE?
It's strange because fb_math_be() should be true and the patch won't
change the values in that case...
Takashi
C.
quoted
quoted
quoted
For fixing this
properly, we rather need to correct the RGB offsets depending on
endianess.
Since the RGB base offsets are corrected, we don't need the hack for
pallette color entries. This patch reverts that, too.
Are you testing using qemu -vga std -vnc :x ? If so, did you try changing
the depth to 8,15,16,32 ?
Yes, it was with qemu -vga std -vnc :x.
About different color depths, Dinar can test / clarify better, I
suppose.
quoted
I think the patch might be breaking big endian
too.
Big endian should work as is because my patch uses the original
offsets when fb_be_math() is true. It corrects the RGB offsets if
!fb_be_math().
But, I'm also entirely not sure whether this is 100% correct, either.
Namely, if the RGB offsets were correct for some little endian
machines with offb, my patch would break it, of course. But, then
your previous fix must have already broken it as well, so I took the
same fb_be_math() check.
thanks,
Takashi
From: Benjamin Herrenschmidt <benh@kernel.crashing.org> Date: 2014-06-16 07:23:36
On Wed, 2014-05-14 at 19:57 +0200, Takashi Iwai wrote:
Hm, so it actually regressed on BE?
It's strange because fb_math_be() should be true and the patch won't
change the values in that case...
Shouldn't the patch be based on foreign endian being set rather than
just "be" anyway ?
IE. If the fb is LE and the host is LE we *also* don't want to change
the ordering, which will be the case when we fix qemu...
Cheers,
Ben.
From: Benjamin Herrenschmidt <benh@kernel.crashing.org> Date: 2014-06-16 07:32:38
On Wed, 2014-05-14 at 19:57 +0200, Takashi Iwai wrote:
Hm, so it actually regressed on BE?
It's strange because fb_math_be() should be true and the patch won't
change the values in that case...
Shouldn't the patch be based on foreign endian being set rather than
just "be" anyway ?
IE. If the fb is LE and the host is LE we *also* don't want to change
the ordering, which will be the case when we fix qemu...
Cheers,
Ben.
I somewhat doubt that this (and 5:5:5) actually work, do they ? the
green gets split into two separate fields, which we can't express
properly here...
Cheers,
Ben.
From: Benjamin Herrenschmidt <benh@kernel.crashing.org> Date: 2014-06-16 23:54:28
On Mon, 2014-06-16 at 17:35 +1000, Benjamin Herrenschmidt wrote:
I somewhat doubt that this (and 5:5:5) actually work, do they ? the
green gets split into two separate fields, which we can't express
properly here...
So the conclusion of further investigation is:
- The right fix is to fix qemu to flip endian
- There's an open discussion as to whether qemu could do it
automatically when the guest endian changes on powerpc as a quick fix,
the long run approach is to have a register to control it, I'm working
on it. offb can then "learn" to flick it like it does the palette hack
today.
- If we want to ever support foreign endian offb with X, we need to do
things a bit differently based on the foreign endian bit that is already
there.
- We must revert the existing cmap swap patch from the kernel, it's
broken and will break things when we fix qemu (and breaks with real HW
in LE mode). I've sent a revert request to Linus and CC'ed stable.
Cheers,
Ben.
At Tue, 17 Jun 2014 09:54:07 +1000,
Benjamin Herrenschmidt wrote:
On Mon, 2014-06-16 at 17:35 +1000, Benjamin Herrenschmidt wrote:
quoted
I somewhat doubt that this (and 5:5:5) actually work, do they ? the
green gets split into two separate fields, which we can't express
properly here...
So the conclusion of further investigation is:
- The right fix is to fix qemu to flip endian
- There's an open discussion as to whether qemu could do it
automatically when the guest endian changes on powerpc as a quick fix,
the long run approach is to have a register to control it, I'm working
on it. offb can then "learn" to flick it like it does the palette hack
today.
- If we want to ever support foreign endian offb with X, we need to do
things a bit differently based on the foreign endian bit that is already
there.
- We must revert the existing cmap swap patch from the kernel, it's
broken and will break things when we fix qemu (and breaks with real HW
in LE mode). I've sent a revert request to Linus and CC'ed stable.
Yeah, I agree. Both the current palette fix and my patch are really
wrong band-aiding.
(Though, the issue in X is rather a problem of X itself. X should
work with the tweaked RGB offsets.)
thanks,
Takashi