samsung-klte: fix swapped red and blue (!291)

The problem behind swapped red and blue is inverted byte order in
framebuffer driver pixel format.
This patch sets the correct byte order in the framebuffer driver,
solving the swapped red and blue problem.

[ci:skip-build]: already built successfully in CI
This commit is contained in:
Federico Amedeo Izzo 2019-03-29 07:23:27 +00:00 committed by Oliver Smith
parent e3b1796552
commit 1ee8db41db
2 changed files with 95 additions and 2 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

@ -5,7 +5,7 @@
pkgname="linux-samsung-klte"
pkgver=3.4.113
pkgrel=1
pkgrel=2
pkgdesc="Samsung Galaxy S5 kernel fork"
arch="armv7"
_carch="arm"
@ -32,6 +32,7 @@ source="
00_fix_return_address.patch
01_gpu-msm-fix-gcc5-compile.patch
02-Reduce-battery-and-touchscreen-log-spam.patch
0001-fix-video-argb-setting.patch
"
builddir="$srcdir/${_repository}-${_commit}"
@ -83,4 +84,5 @@ sha512sums="a0ed01d4beb4fd1b304ea1409e4e3d7ff60662de34999dcdb2901cb10eef217a6679
fef4b697b2af03f750016e521ac36f68e1e383b4900c9e55dc275ab9be802fb1095fc5c4bcb50d24d2983ed4675b3f1c659086c1f5c38f9d58b55453ac5ae6ad config-samsung-klte.armv7
3b4913415bcfe0ff222969f993890c656c7e12b6ee06532bded485d5201c9855b2c87996c5b63423702b89b6b0ca214b5aceeb402571d9c5af084093c157ccb4 00_fix_return_address.patch
0fc4b1782dfd3bd94fa9ae8ab74b19713f25e9f4a48dcf830072634f247aa3dd8847f001a3e87e9728e057657efd4ae751510e7c408d9b960c907665ca64e61f 01_gpu-msm-fix-gcc5-compile.patch
b55fc9ab3e21bc85d66ee08d7e1cd7fdc3b236249212fbcd0055e60ed3e6cef3e4d2b8058a4b7d70c78b2bbc7a11111b55d4d82490b4e3579b8e61657806ac09 02-Reduce-battery-and-touchscreen-log-spam.patch"
b55fc9ab3e21bc85d66ee08d7e1cd7fdc3b236249212fbcd0055e60ed3e6cef3e4d2b8058a4b7d70c78b2bbc7a11111b55d4d82490b4e3579b8e61657806ac09 02-Reduce-battery-and-touchscreen-log-spam.patch
a48336bbfead6ad0c84d2fce0c40a3f5530aebdff356a6835cceaf59a50a6f860d2f8027703a92927955fbb18857ba78788e010d017bf67730f069b36e96fe87 0001-fix-video-argb-setting.patch"