From da260f46526d3b997b4791a1421d567e8abee3f1 Mon Sep 17 00:00:00 2001 From: Tito Ragusa Date: Sat, 18 May 2019 18:12:44 +0200 Subject: [PATCH] oppo-find-7a: fix display, touchscreen (!369) Make the display work, set virtual_size and add msm-fb-refresher and 0001-fix-video-argb-setting.patch. [ci:skip-build]: already built successfully in CI --- device/device-oppo-find-7a/APKBUILD | 4 +- device/device-oppo-find-7a/initfs-hook.sh | 4 + .../0001-fix-video-argb-setting.patch | 91 +++++++++++++++++++ device/linux-oppo-find-7a/APKBUILD | 6 +- 4 files changed, 101 insertions(+), 4 deletions(-) create mode 100644 device/device-oppo-find-7a/initfs-hook.sh create mode 100644 device/linux-oppo-find-7a/0001-fix-video-argb-setting.patch diff --git a/device/device-oppo-find-7a/APKBUILD b/device/device-oppo-find-7a/APKBUILD index f47ef655a..7f9549d45 100644 --- a/device/device-oppo-find-7a/APKBUILD +++ b/device/device-oppo-find-7a/APKBUILD @@ -2,12 +2,12 @@ pkgname="device-oppo-find-7a" pkgdesc="OPPO Find 7a" pkgver=0.1 -pkgrel=0 +pkgrel=1 url="https://postmarketos.org" license="MIT" arch="armv7" options="!check !archcheck" -depends="postmarketos-base linux-oppo-find-7a mkbootimg mesa-dri-swrast" +depends="postmarketos-base linux-oppo-find-7a mkbootimg mesa-dri-swrast msm-fb-refresher" makedepends="devicepkg-dev" source="deviceinfo" diff --git a/device/device-oppo-find-7a/initfs-hook.sh b/device/device-oppo-find-7a/initfs-hook.sh new file mode 100644 index 000000000..d92f18b7b --- /dev/null +++ b/device/device-oppo-find-7a/initfs-hook.sh @@ -0,0 +1,4 @@ +#!/bin/sh + +# set framebuffer virtual size +echo 1080,3840 > /sys/class/graphics/fb0/virtual_size diff --git a/device/linux-oppo-find-7a/0001-fix-video-argb-setting.patch b/device/linux-oppo-find-7a/0001-fix-video-argb-setting.patch new file mode 100644 index 000000000..68983c505 --- /dev/null +++ b/device/linux-oppo-find-7a/0001-fix-video-argb-setting.patch @@ -0,0 +1,91 @@ +From a23d549c51e38ad9fc481859326a786bc00baad8 Mon Sep 17 00:00:00 2001 +From: Federico Amedeo Izzo +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 + diff --git a/device/linux-oppo-find-7a/APKBUILD b/device/linux-oppo-find-7a/APKBUILD index 6e37ec95a..bbb547bc6 100644 --- a/device/linux-oppo-find-7a/APKBUILD +++ b/device/linux-oppo-find-7a/APKBUILD @@ -3,7 +3,7 @@ pkgname="linux-oppo-find-7a" pkgver=3.4.113 -pkgrel=0 +pkgrel=1 pkgdesc="OPPO Find 7a kernel fork" arch="armv7" _carch="arm" @@ -27,6 +27,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 " builddir="$srcdir/${_repository}-${_commit}" @@ -72,4 +73,5 @@ sha512sums="e3fa1f9ab51a2b6213b9abaa3bb5e010fd2c41e98f572022fcfff66f17fc3639e1b2 30134ad4cbd9cc3c906425847dbc095b4db37011e98d0c200bb7bd4fc8c6bb468f7537b2f77e542ae401c65c75feed9e16abde1d8d9787f83131684c5a52c8bc config-oppo-find-7a.armv7 77eba606a71eafb36c32e9c5fe5e77f5e4746caac292440d9fb720763d766074a964db1c12bc76fe583c5d1a5c864219c59941f5e53adad182dbc70bf2bc14a7 gcc7-give-up-on-ilog2-const-optimizations.patch 197d40a214ada87fcb2dfc0ae4911704b9a93354b75179cd6b4aadbb627a37ec262cf516921c84a8b1806809b70a7b440cdc8310a4a55fca5d2c0baa988e3967 gcc8-fix-put-user.patch -ad0182a483791fc88e058838bc331b2f04a75ba291e763767babdb815efadfc3b4fda97e69e2e3f00a426cabea088e35297a92bd287592597d1e309be68ee92c kernel-use-the-gnu89-standard-explicitly.patch" +ad0182a483791fc88e058838bc331b2f04a75ba291e763767babdb815efadfc3b4fda97e69e2e3f00a426cabea088e35297a92bd287592597d1e309be68ee92c kernel-use-the-gnu89-standard-explicitly.patch +a48336bbfead6ad0c84d2fce0c40a3f5530aebdff356a6835cceaf59a50a6f860d2f8027703a92927955fbb18857ba78788e010d017bf67730f069b36e96fe87 0001-fix-video-argb-setting.patch"