sm501fb: RGB offsets are reversed in 16bpp modes
authorVille Syrjala <syrjala@sci.fi>
Tue, 4 Mar 2008 22:28:47 +0000 (14:28 -0800)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Wed, 5 Mar 2008 00:35:13 +0000 (16:35 -0800)
The RGB offsets were reversed in 16bpp modes.  Simply trying to reverse the
offsets when endianness differs is clearly the wrong thing to do but that is
an issue for another patch.

Signed-off-by: Ville Syrjala <syrjala@sci.fi>
Acked-by: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/video/sm501fb.c

index 6e7810d914ccd75c5837ab9cef2fd76609a6ba52..3a98d5a86af1e6d33d0adb6fa4181f6e3f7c5c4b 100644 (file)
@@ -286,13 +286,13 @@ static int sm501fb_check_var(struct fb_var_screeninfo *var,
 
        case 16:
                if (sm->pdata->flags & SM501_FBPD_SWAP_FB_ENDIAN) {
-                       var->red.offset         = 11;
-                       var->green.offset       = 5;
-                       var->blue.offset        = 0;
-               } else {
                        var->blue.offset        = 11;
                        var->green.offset       = 5;
                        var->red.offset         = 0;
+               } else {
+                       var->red.offset         = 11;
+                       var->green.offset       = 5;
+                       var->blue.offset        = 0;
                }
 
                var->red.length         = 5;