Commit 3e9ff044 authored by Janusz Krzysztofik's avatar Janusz Krzysztofik Committed by Tomi Valkeinen

omapfb: Fix 12-bit display (RGB444 color mode) handling

Support for RGB444 (12-bit) pixel format has been introduced into omapfb/lcdc
by Mark Underwood on 2006-05-26 (commit
f74edb66) in preparation for Amstrad Delta
(E3) videophone LCD display support.

Before the Amstrad Delta LCD patch by Jonathan McDowell was applied (on
2006-08-04, commit 8d22fb2e), omapfb and lcdc
code was changed substantially (commit
e563dc81 dated 2006-06-26) in a way that broke
Mark's 12-bit display support. Than, a patch by Jonathan, that supposed to
correct the problem, was introduced immediatelly (on 2006-08-04, commit
e10a75b4).

As a result, the Amstrad Delta display was working correctly at boot time,
with fbset reporting:

	geometry 480 320 480 320 16
	...
	rgba 4/8,4/4,4/0,0/0

However, after first framebuffer reinitialization, colors were no longer being
displayed correctly and fbset was reporting:

        rgba 5/11,6/5,5/0,0/0

The patch tries to correct the issue by setting plane->color_mode depending on
panel->bpp, not var->bits_per_pixel.

Created and tested on Amstrad Delta against linux-2.6.33-rc3.
Signed-off-by: default avatarJanusz Krzysztofik <jkrzysz@tis.icnet.pl>
Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@nokia.com>
parent 60596045
......@@ -486,10 +486,11 @@ static int set_color_mode(struct omapfb_plane_struct *plane,
return 0;
case 12:
var->bits_per_pixel = 16;
plane->color_mode = OMAPFB_COLOR_RGB444;
return 0;
case 16:
plane->color_mode = OMAPFB_COLOR_RGB565;
if (plane->fbdev->panel->bpp == 12)
plane->color_mode = OMAPFB_COLOR_RGB444;
else
plane->color_mode = OMAPFB_COLOR_RGB565;
return 0;
default:
return -EINVAL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment