diff --git a/packages/linux/patches/linux-3.1.10-602-framebuffer.patch b/packages/linux/patches/linux-3.1.10-602-framebuffer.patch new file mode 100644 index 0000000000..57b797672c --- /dev/null +++ b/packages/linux/patches/linux-3.1.10-602-framebuffer.patch @@ -0,0 +1,70 @@ +From 42119badef15de0033da6452c0d0a2eb95a59b40 Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Wed, 2 May 2012 22:13:14 +0100 +Subject: [PATCH] Swap Red and Blue over in 32bpp framebuffer mode + +--- + drivers/video/bcm2708_fb.c | 16 ++++++++++++---- + 1 file changed, 12 insertions(+), 4 deletions(-) + +diff --git a/drivers/video/bcm2708_fb.c b/drivers/video/bcm2708_fb.c +index 5b27287..ff1fffc 100644 +--- a/drivers/video/bcm2708_fb.c ++++ b/drivers/video/bcm2708_fb.c +@@ -113,7 +113,12 @@ static int bcm2708_fb_set_bitfields(struct fb_var_screeninfo *var) + * encoded in the pixel data. Calculate their position from + * the bitfield length defined above. + */ +- if (ret == 0 && var->bits_per_pixel >= 16) { ++ if (ret == 0 && var->bits_per_pixel >= 24) { ++ var->red.offset = 0; ++ var->green.offset = var->red.offset + var->red.length; ++ var->blue.offset = var->green.offset + var->green.length; ++ var->transp.offset = var->blue.offset + var->blue.length; ++ } else if (ret == 0 && var->bits_per_pixel >= 16) { + var->blue.offset = 0; + var->green.offset = var->blue.offset + var->blue.length; + var->red.offset = var->green.offset + var->green.length; +@@ -312,6 +317,7 @@ static void bcm2708_fb_imageblit(struct fb_info *info, + + static int fbwidth = 800; /* module parameter */ + static int fbheight = 480; /* module parameter */ ++static int fbdepth = 16; /* module parameter */ + + static int bcm2708_fb_register(struct bcm2708_fb *fb) + { +@@ -346,7 +352,7 @@ static int bcm2708_fb_register(struct bcm2708_fb *fb) + fb->fb.var.yres = fbheight; + fb->fb.var.xres_virtual = fbwidth; + fb->fb.var.yres_virtual = fbheight; +- fb->fb.var.bits_per_pixel = 16; ++ fb->fb.var.bits_per_pixel = fbdepth; + fb->fb.var.vmode = FB_VMODE_NONINTERLACED; + fb->fb.var.activate = FB_ACTIVATE_NOW; + fb->fb.var.nonstd = 0; +@@ -369,8 +375,8 @@ static int bcm2708_fb_register(struct bcm2708_fb *fb) + + fb_set_var(&fb->fb, &fb->fb.var); + +- pr_info("BCM2708FB: registering framebuffer (%d, %d)\n", fbwidth, +- fbheight); ++ pr_info("BCM2708FB: registering framebuffer (%dx%d@%d)\n", fbwidth, ++ fbheight, fbdepth); + + ret = register_framebuffer(&fb->fb); + pr_info("BCM2708FB: register framebuffer (%d)\n", ret); +@@ -453,9 +459,11 @@ static void __exit bcm2708_fb_exit(void) + + module_param(fbwidth, int, 0644); + module_param(fbheight, int, 0644); ++module_param(fbdepth, int, 0644); + + MODULE_DESCRIPTION("BCM2708 framebuffer driver"); + MODULE_LICENSE("GPL"); + + MODULE_PARM_DESC(fbwidth, "Width of ARM Framebuffer"); + MODULE_PARM_DESC(fbheight, "Height of ARM Framebuffer"); ++MODULE_PARM_DESC(fbdepth, "Bit depth of ARM Framebuffer"); +-- +1.7.10 +