mirror of
https://github.com/NixOS/mobile-nixos.git
synced 2024-12-03 02:44:13 +03:00
a5b9e275ed
Current issues: * Framebuffer colors are wrong. (RGBA → BGRA)
92 lines
2.7 KiB
Diff
92 lines
2.7 KiB
Diff
From 79f928baf4e7b0fa8f36276b2f877da2d46a50d0 Mon Sep 17 00:00:00 2001
|
|
From: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
|
|
Date: Mon, 11 Dec 2017 11:00:24 -0200
|
|
Subject: [PATCH] fix video argb setting
|
|
|
|
---
|
|
drivers/video/msm/msm_fb.c | 34 +++++++++++++++++-----------------
|
|
1 file changed, 17 insertions(+), 17 deletions(-)
|
|
|
|
diff --git a/drivers/video/msm/msm_fb.c b/drivers/video/msm/msm_fb.c
|
|
index 251a5cbb753d..dcd9262a88f4 100644
|
|
--- a/drivers/video/msm/msm_fb.c
|
|
+++ b/drivers/video/msm/msm_fb.c
|
|
@@ -1342,16 +1342,16 @@ static int msm_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;
|
|
@@ -1361,16 +1361,16 @@ static int msm_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;
|
|
@@ -2260,15 +2260,15 @@ static int msm_fb_check_var(struct fb_var_screeninfo *var, struct fb_info *info)
|
|
/* 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;
|
|
@@ -2365,7 +2365,7 @@ static int msm_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.14.1
|
|
|