fairphone-fp2: fix swapped red and blue (!292)

Fixes the problem described in #211
This commit is contained in:
Luca Weiss 2019-03-28 15:06:54 +00:00 committed by Martijn Braam
parent 95198e12e9
commit 874a309eed
2 changed files with 94 additions and 1 deletions

View file

@ -0,0 +1,91 @@
From a23d549c51e38ad9fc481859326a786bc00baad8 Mon Sep 17 00:00:00 2001
From: Federico Amedeo Izzo <federico.izzo42@gmail.com>
Date: Fri, 22 Mar 2019 19:37:07 +0100
Subject: [PATCH] fix video argb setting
---
drivers/video/msm/mdss/mdss_fb.c | 34 ++++++++++++++++----------------
1 file changed, 17 insertions(+), 17 deletions(-)
diff --git a/drivers/video/msm/mdss/mdss_fb.c b/drivers/video/msm/mdss/mdss_fb.c
index 835f6fc9687..a598cbd72dc 100644
--- a/drivers/video/msm/mdss/mdss_fb.c
+++ b/drivers/video/msm/mdss/mdss_fb.c
@@ -1767,16 +1767,16 @@ static int mdss_fb_register(struct msm_fb_data_type *mfd)
fix->xpanstep = 1;
fix->ypanstep = 1;
var->vmode = FB_VMODE_NONINTERLACED;
- var->blue.offset = 0;
- var->green.offset = 8;
- var->red.offset = 16;
+ var->blue.offset = 24;
+ var->green.offset = 16;
+ var->red.offset = 8;
var->blue.length = 8;
var->green.length = 8;
var->red.length = 8;
var->blue.msb_right = 0;
var->green.msb_right = 0;
var->red.msb_right = 0;
- var->transp.offset = 24;
+ var->transp.offset = 0;
var->transp.length = 8;
bpp = 4;
break;
@@ -1786,16 +1786,16 @@ static int mdss_fb_register(struct msm_fb_data_type *mfd)
fix->xpanstep = 1;
fix->ypanstep = 1;
var->vmode = FB_VMODE_NONINTERLACED;
- var->blue.offset = 8;
- var->green.offset = 16;
- var->red.offset = 24;
+ var->blue.offset = 16;
+ var->green.offset = 8;
+ var->red.offset = 0;
var->blue.length = 8;
var->green.length = 8;
var->red.length = 8;
var->blue.msb_right = 0;
var->green.msb_right = 0;
var->red.msb_right = 0;
- var->transp.offset = 0;
+ var->transp.offset = 24;
var->transp.length = 8;
bpp = 4;
break;
@@ -2723,15 +2723,15 @@ static int mdss_fb_check_var(struct fb_var_screeninfo *var,
/* Figure out if the user meant RGBA or ARGB
and verify the position of the RGB components */
- if (var->transp.offset == 24) {
- if ((var->blue.offset != 0) ||
- (var->green.offset != 8) ||
- (var->red.offset != 16))
- return -EINVAL;
- } else if (var->transp.offset == 0) {
- if ((var->blue.offset != 8) ||
+ if (var->transp.offset == 0) {
+ if ((var->blue.offset != 24) ||
(var->green.offset != 16) ||
- (var->red.offset != 24))
+ (var->red.offset != 8))
+ return -EINVAL;
+ } else if (var->transp.offset == 24) {
+ if ((var->blue.offset != 16) ||
+ (var->green.offset != 8) ||
+ (var->red.offset != 0))
return -EINVAL;
} else
return -EINVAL;
@@ -2821,7 +2821,7 @@ static int mdss_fb_set_par(struct fb_info *info)
break;
case 32:
- if (var->transp.offset == 24)
+ if (var->transp.offset == 0)
mfd->fb_imgType = MDP_ARGB_8888;
else
mfd->fb_imgType = MDP_RGBA_8888;
--
2.21.0

View file

@ -3,7 +3,7 @@
pkgname="linux-fairphone-fp2"
pkgver=3.4.0
pkgrel=9
pkgrel=10
pkgdesc="Fairphone 2 kernel fork"
arch="armv7"
_carch="arm"
@ -30,6 +30,7 @@ source="
gcc7-give-up-on-ilog2-const-optimizations.patch
gcc8-fix-put-user.patch
kernel-use-the-gnu89-standard-explicitly.patch
0001-fix-video-argb-setting.patch
0003-Fix-includes.patch
0004-msm-fix-trace.patch
"
@ -78,5 +79,6 @@ dafe4a3f2b6e8415c6114df20acc9619791fe80b3f2e772e4da685a80b8fe856f77f8bb038c99255
77eba606a71eafb36c32e9c5fe5e77f5e4746caac292440d9fb720763d766074a964db1c12bc76fe583c5d1a5c864219c59941f5e53adad182dbc70bf2bc14a7 gcc7-give-up-on-ilog2-const-optimizations.patch
197d40a214ada87fcb2dfc0ae4911704b9a93354b75179cd6b4aadbb627a37ec262cf516921c84a8b1806809b70a7b440cdc8310a4a55fca5d2c0baa988e3967 gcc8-fix-put-user.patch
ad0182a483791fc88e058838bc331b2f04a75ba291e763767babdb815efadfc3b4fda97e69e2e3f00a426cabea088e35297a92bd287592597d1e309be68ee92c kernel-use-the-gnu89-standard-explicitly.patch
a48336bbfead6ad0c84d2fce0c40a3f5530aebdff356a6835cceaf59a50a6f860d2f8027703a92927955fbb18857ba78788e010d017bf67730f069b36e96fe87 0001-fix-video-argb-setting.patch
403d4999e98ddf73e083076c130a7c9de265096b7abeaabe1ba4305403202e651289a538d104cb37adf783fcecea009f3ed2b722d8640d8d3f12e6cbb8ebe97d 0003-Fix-includes.patch
432099f87fbcd66fa801ecaedb06715754198761c709cbb40b0dc8ffef14a6d6d5f0df27823229b731b18438c705c60c0ce44728b192d8e0f20c285bf761b7f3 0004-msm-fix-trace.patch"