summaryrefslogtreecommitdiff
path: root/target/linux/brcm2708/patches-3.10/0167-bcm2708fb-Allow-swapping-of-red-blue-in-24-32-modes.patch
diff options
context:
space:
mode:
authorFlorian Fainelli <florian@openwrt.org>2014-02-28 20:30:08 +0000
committerFlorian Fainelli <florian@openwrt.org>2014-02-28 20:30:08 +0000
commitbb39b8d99aae1f7eb13a97bd874838da91080de6 (patch)
tree3046f53937c0bc5dc13e2b2ab7b688a1932199bf /target/linux/brcm2708/patches-3.10/0167-bcm2708fb-Allow-swapping-of-red-blue-in-24-32-modes.patch
parentc6c0d09f85c211560a1405441925681cfa25e8b1 (diff)
downloadmtk-20170518-bb39b8d99aae1f7eb13a97bd874838da91080de6.zip
mtk-20170518-bb39b8d99aae1f7eb13a97bd874838da91080de6.tar.gz
mtk-20170518-bb39b8d99aae1f7eb13a97bd874838da91080de6.tar.bz2
brcm2708: update against latest rpi-3.10.y branch
Update our copies of the brcm2708 patches to the latest rpi-3.10-y rebased against linux-3.10.y stable (3.10.32). This should hopefully make it easier for us in the future to leverage the raspberry/rpi-* branches. Signed-off-by: Florian Fainelli <florian@openwrt.org> SVN-Revision: 39770
Diffstat (limited to 'target/linux/brcm2708/patches-3.10/0167-bcm2708fb-Allow-swapping-of-red-blue-in-24-32-modes.patch')
-rw-r--r--target/linux/brcm2708/patches-3.10/0167-bcm2708fb-Allow-swapping-of-red-blue-in-24-32-modes.patch57
1 files changed, 57 insertions, 0 deletions
diff --git a/target/linux/brcm2708/patches-3.10/0167-bcm2708fb-Allow-swapping-of-red-blue-in-24-32-modes.patch b/target/linux/brcm2708/patches-3.10/0167-bcm2708fb-Allow-swapping-of-red-blue-in-24-32-modes.patch
new file mode 100644
index 0000000..5636c44
--- /dev/null
+++ b/target/linux/brcm2708/patches-3.10/0167-bcm2708fb-Allow-swapping-of-red-blue-in-24-32-modes.patch
@@ -0,0 +1,57 @@
+From 4e0660161587681630da35f525cacf17bed58795 Mon Sep 17 00:00:00 2001
+From: popcornmix <popcornmix@gmail.com>
+Date: Wed, 12 Feb 2014 12:01:56 +0000
+Subject: [PATCH 167/174] bcm2708fb: Allow swapping of red/blue in 24/32 modes
+
+---
+ drivers/video/bcm2708_fb.c | 14 +++++++++++---
+ 1 file changed, 11 insertions(+), 3 deletions(-)
+
+--- a/drivers/video/bcm2708_fb.c
++++ b/drivers/video/bcm2708_fb.c
+@@ -53,6 +53,7 @@ static u32 dma_busy_wait_threshold = 1<<
+ module_param(dma_busy_wait_threshold, int, 0644);
+ MODULE_PARM_DESC(dma_busy_wait_threshold, "Busy-wait for DMA completion below this area");
+
++static int fbswap = 0; /* module parameter */
+
+ /* this data structure describes each frame buffer device we find */
+
+@@ -185,7 +186,12 @@ static int bcm2708_fb_set_bitfields(stru
+ * encoded in the pixel data. Calculate their position from
+ * the bitfield length defined above.
+ */
+- if (ret == 0 && var->bits_per_pixel >= 24) {
++ if (ret == 0 && var->bits_per_pixel >= 24 && fbswap) {
++ var->blue.offset = 0;
++ var->green.offset = var->blue.offset + var->blue.length;
++ var->red.offset = var->green.offset + var->green.length;
++ var->transp.offset = var->red.offset + var->red.length;
++ } else 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;
+@@ -618,8 +624,8 @@ static int bcm2708_fb_register(struct bc
+
+ fb_set_var(&fb->fb, &fb->fb.var);
+
+- print_debug("BCM2708FB: registering framebuffer (%dx%d@%d)\n", fbwidth,
+- fbheight, fbdepth);
++ print_debug("BCM2708FB: registering framebuffer (%dx%d@%d) (%d)\n", fbwidth
++ fbheight, fbdepth, fbswap);
+
+ ret = register_framebuffer(&fb->fb);
+ print_debug("BCM2708FB: register framebuffer (%d)\n", ret);
+@@ -746,6 +752,7 @@ module_exit(bcm2708_fb_exit);
+ module_param(fbwidth, int, 0644);
+ module_param(fbheight, int, 0644);
+ module_param(fbdepth, int, 0644);
++module_param(fbswap, int, 0644);
+
+ MODULE_DESCRIPTION("BCM2708 framebuffer driver");
+ MODULE_LICENSE("GPL");
+@@ -753,3 +760,4 @@ 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");
++MODULE_PARM_DESC(fbswap, "Swap order of red and blue in 24 and 32 bit modes");