pmaports/device/testing/linux-motorola-payton/99_framebuffer.patch
Dyna 7e2554714a
motorola-payton: new device (Motorola Moto X4) (MR 1301)
What works:
- Booting
- Display
- Touch
- USB Ethernet

What doesn't:
- Sound
- Wi-Fi
- Modem
- Camera

(NOTE: If the display doesn't work, try flashing your phone back to stock, then trying again.)
2020-06-15 09:44:49 +02:00

42 lines
1.2 KiB
Diff

This is needed for the display to display colors correctly.
---
diff --git a/drivers/video/msm/mdss/mdss_fb.c b/drivers/video/msm/mdss/mdss_fb.c
index 075ee8a3880..b4531f66a06 100644
--- a/drivers/video/fbdev/msm/mdss_fb.c
+++ b/drivers/video/fbdev/msm/mdss_fb.c
@@ -868,7 +868,8 @@ static int mdss_fb_probe(struct platform_device *pdev)
mfd->bl_scale = 1024;
mfd->bl_min_lvl = 30;
mfd->ad_bl_level = 0;
- mfd->fb_imgType = MDP_RGBA_8888;
+ // Default framebuffer format.
+ mfd->fb_imgType = MDP_BGRA_8888;
mfd->calib_mode_bl = 0;
if (mfd->panel.type == MIPI_VIDEO_PANEL ||
@@ -2143,6 +2144,25 @@ static int mdss_fb_register(struct msm_fb_data_type *mfd)
bpp = 4;
break;
+ case MDP_BGRA_8888:
+ fix->type = FB_TYPE_PACKED_PIXELS;
+ 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.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.length = 8;
+ bpp = 4;
+ break;
+
case MDP_YCRYCB_H2V1:
fix->type = FB_TYPE_INTERLEAVED_PLANES;
fix->xpanstep = 2;