samsung-j3nxlte: port improvements (MR 1787)

Changes:
- Depends on soc-sprd-audio-sc8830 package for audio support
- Includes fixes for X11 and color mode
- Switches to dtbtool-sprd

[ci:skip-build] Already built fine on CI in a MR
This commit is contained in:
HenriDellal 2020-12-04 21:10:19 +03:00 committed by Alexey Min
parent e5004e6356
commit d6eeae1ee4
No known key found for this signature in database
GPG key ID: EBF5ECFFFEE34DED
5 changed files with 49 additions and 86 deletions

View file

@ -2,12 +2,12 @@
pkgname=device-samsung-j3nxlte
pkgdesc="Samsung Galaxy J3"
pkgver=0.1
pkgrel=4
pkgrel=5
url="https://postmarketos.org"
license="MIT"
arch="armv7"
options="!check !archcheck"
depends="postmarketos-base linux-samsung-j3nxlte mkbootimg mesa-dri-swrast"
depends="postmarketos-base linux-samsung-j3nxlte mkbootimg mesa-dri-swrast mdss-fb-init-hack soc-sprd-audio-sc8830"
makedepends="devicepkg-dev"
source="deviceinfo"

View file

@ -3,7 +3,7 @@
pkgname=linux-samsung-j3nxlte
pkgver=3.10.100
pkgrel=1
pkgrel=2
pkgdesc="Samsung Galaxy J3 kernel fork"
arch="armv7"
_carch="arm"
@ -11,7 +11,7 @@ _flavor="samsung-j3nxlte"
url="https://kernel.org"
license="GPL-2.0-only"
options="!strip !check !tracedeps pmb:cross-native"
makedepends="mkbootimg perl sed installkernel bash gmp-dev bc linux-headers elfutils-dev devicepkg-dev dtbtool"
makedepends="mkbootimg perl sed installkernel bash gmp-dev bc linux-headers elfutils-dev devicepkg-dev dtbtool-sprd"
# Source
_repository="android_kernel_samsung_sharkls"
@ -24,8 +24,9 @@ source="
gcc8-fix-put-user.patch
gcc10-extern_YYLOC_global_declaration.patch
fix_recordmcount.patch
qcom,msm-id_fix.patch
fix_touchscreen.patch
sprdfb-check-for-buffering.patch
sprdfb-fix-swapped-colors.patch
"
builddir="$srcdir/$_repository-$_commit"
@ -40,7 +41,7 @@ build() {
KBUILD_BUILD_VERSION="$((pkgrel + 1 ))-postmarketOS"
# Generate master DTB (deviceinfo_bootimg_qcdt)
dtbTool -s 2048 -p "scripts/dtc/" -o "arch/arm/boot/dt.img" "arch/arm/boot/"
dtbTool-sprd -p scripts/dtc/ -o "arch/arm/boot/dt.img" "arch/arm/boot/dts/"
}
package() {
@ -57,5 +58,6 @@ fd2938deffd68ec451139193c8cb9383bdd8455358e6ee8fc5d8174e4857d6c55887e41b3201b088
197d40a214ada87fcb2dfc0ae4911704b9a93354b75179cd6b4aadbb627a37ec262cf516921c84a8b1806809b70a7b440cdc8310a4a55fca5d2c0baa988e3967 gcc8-fix-put-user.patch
2b48f1bf0e3f70703d2cdafc47d5e615cc7c56c70bec56b2e3297d3fa4a7a1321d649a8679614553dde8fe52ff1051dae38d5990e3744c9ca986d92187dcdbeb gcc10-extern_YYLOC_global_declaration.patch
6aa11a75f422ac5c20cddfce23bff81940e61e65bc86fe1070c60714a6ccf631b2da70bff20e2b88e723706f0f233eb03540a8d9389adffd495592e8ab6bd82a fix_recordmcount.patch
dd6e3113ad7d87da76e92d5a656a683e735e1b18e6217c1beb4238ad60f48b1bc429c9e62dc9752b7242201610e95990dafc13f499aa09c74a26079022ae17ec qcom,msm-id_fix.patch
54eb205043b9e1b12f4f88d8163611e6769a702490045f5704483c92b17c9297250fde7d257b6d0e82d0cdbaed88d52d85137aeafcd4c4b138cecfffc921857e fix_touchscreen.patch"
54eb205043b9e1b12f4f88d8163611e6769a702490045f5704483c92b17c9297250fde7d257b6d0e82d0cdbaed88d52d85137aeafcd4c4b138cecfffc921857e fix_touchscreen.patch
e33ed12de874c1c8bc9231aea3b0389b18ee0ff804e39c0f47d9cbf657ea19015370d6114846c2d142fbdb88f472f0e65811c53b9b335feb8ae2f30dffdf4846 sprdfb-check-for-buffering.patch
6836001b24508d413a059f19b0c6f6f547037f68886c22159ad51be91d1a089e3d1d9ed79c3c62724648df7f810cd81d96a83f4a34368b373524b649e5539656 sprdfb-fix-swapped-colors.patch"

View file

@ -1,78 +0,0 @@
diff --git a/arch/arm/boot/dts/sprd-scx35l_sharkls_j3xnlte_rev00.dts b/arch/arm/boot/dts/sprd-scx35l_sharkls_j3xnlte_rev00.dts
index 6d277064..ffad458c 100755
--- a/arch/arm/boot/dts/sprd-scx35l_sharkls_j3xnlte_rev00.dts
+++ b/arch/arm/boot/dts/sprd-scx35l_sharkls_j3xnlte_rev00.dts
@@ -34,7 +34,7 @@
/ {
model = "Spreadtrum SP8835EB board";
compatible = "sprd,sp8835eb";
- sprd,sc-id = <9830 0 0x20000>;
+ qcom,msm-id = <9830 0 0x20000>;
#address-cells = <1>;
#size-cells = <1>;
interrupt-parent = <&gic>;
diff --git a/arch/arm/boot/dts/sprd-scx35l_sharkls_j3xnlte_rev01.dts b/arch/arm/boot/dts/sprd-scx35l_sharkls_j3xnlte_rev01.dts
index 45b86b00..4f0e95ba 100755
--- a/arch/arm/boot/dts/sprd-scx35l_sharkls_j3xnlte_rev01.dts
+++ b/arch/arm/boot/dts/sprd-scx35l_sharkls_j3xnlte_rev01.dts
@@ -34,7 +34,7 @@
/ {
model = "Spreadtrum SP8835EB board";
compatible = "sprd,sp8835eb";
- sprd,sc-id = <9830 1 0x20000>;
+ qcom,msm-id = <9830 1 0x20000>;
#address-cells = <1>;
#size-cells = <1>;
interrupt-parent = <&gic>;
diff --git a/arch/arm/boot/dts/sprd-scx35l_sharkls_j3xnlte_rev02.dts b/arch/arm/boot/dts/sprd-scx35l_sharkls_j3xnlte_rev02.dts
index cd10c56c..e2d50b43 100755
--- a/arch/arm/boot/dts/sprd-scx35l_sharkls_j3xnlte_rev02.dts
+++ b/arch/arm/boot/dts/sprd-scx35l_sharkls_j3xnlte_rev02.dts
@@ -34,7 +34,7 @@
/ {
model = "Spreadtrum SP8835EB board";
compatible = "sprd,sp8835eb";
- sprd,sc-id = <9830 2 0x20000>;
+ qcom,msm-id = <9830 2 0x20000>;
#address-cells = <1>;
#size-cells = <1>;
interrupt-parent = <&gic>;
diff --git a/arch/arm/boot/dts/sprd-scx35l_sharkls_j3xnlte_rev03.dts b/arch/arm/boot/dts/sprd-scx35l_sharkls_j3xnlte_rev03.dts
index b38713ce..3bf64b03 100755
--- a/arch/arm/boot/dts/sprd-scx35l_sharkls_j3xnlte_rev03.dts
+++ b/arch/arm/boot/dts/sprd-scx35l_sharkls_j3xnlte_rev03.dts
@@ -34,7 +34,7 @@
/ {
model = "Spreadtrum SP8835EB board";
compatible = "sprd,sp8835eb";
- sprd,sc-id = <9830 3 0x20000>;
+ qcom,msm-id = <9830 3 0x20000>;
#address-cells = <1>;
#size-cells = <1>;
interrupt-parent = <&gic>;
diff --git a/arch/arm/boot/dts/sprd-scx35l_sharkls_j3xnlte_rev04.dts b/arch/arm/boot/dts/sprd-scx35l_sharkls_j3xnlte_rev04.dts
index 393d2db1..c339ceae 100755
--- a/arch/arm/boot/dts/sprd-scx35l_sharkls_j3xnlte_rev04.dts
+++ b/arch/arm/boot/dts/sprd-scx35l_sharkls_j3xnlte_rev04.dts
@@ -34,7 +34,7 @@
/ {
model = "Spreadtrum SP8835EB board";
compatible = "sprd,sp8835eb";
- sprd,sc-id = <9830 4 0x20000>;
+ qcom,msm-id = <9830 4 0x20000>;
#address-cells = <1>;
#size-cells = <1>;
interrupt-parent = <&gic>;
diff --git a/arch/arm/boot/dts/sprd-scx35l_sharkls_j3xnlte_rev05.dts b/arch/arm/boot/dts/sprd-scx35l_sharkls_j3xnlte_rev05.dts
index 5611b8bb..bb1d2d3a 100755
--- a/arch/arm/boot/dts/sprd-scx35l_sharkls_j3xnlte_rev05.dts
+++ b/arch/arm/boot/dts/sprd-scx35l_sharkls_j3xnlte_rev05.dts
@@ -34,7 +34,7 @@
/ {
model = "Spreadtrum SP8835EB board";
compatible = "sprd,sp8835eb";
- sprd,sc-id = <9830 5 0x20000>;
+ qcom,msm-id = <9830 5 0x20000>;
#address-cells = <1>;
#size-cells = <1>;
interrupt-parent = <&gic>;

View file

@ -0,0 +1,24 @@
sprdfb_check_var() has two problems:
I) it is not buffering-aware, which all Spreadtrum devices use;
II) it checks values that are already in yres_virtual, not those that we
are trying to overwrite.
Those problems stop X11 and charging-sdl from working properly.
X11 error:
(EE) FBDEV(0): FBIOPUT_VSCREENINFO: Invalid argument
This patch fixes first problem, however, the correct way is fixing
the second one, as this might have less side effects.
diff --git a/drivers/video/sprdfb/sprdfb_main.c b/drivers/video/sprdfb/sprdfb_main.c
index 43876285..751616a1 100644
--- a/drivers/video/sprdfb/sprdfb_main.c
+++ b/drivers/video/sprdfb/sprdfb_main.c
@@ -531,7 +531,8 @@ static int sprdfb_check_var(struct fb_var_screeninfo *var, struct fb_info *fb)
if ((var->xres != fb->var.xres) ||
(var->yres != fb->var.yres) ||
(var->xres_virtual != fb->var.xres_virtual) ||
- (var->yres_virtual != fb->var.yres_virtual) ||
+ // (var->yres_virtual != fb->var.yres_virtual) ||
+ (fb->var.yres_virtual % var->yres_virtual != 0) ||
(var->xoffset != fb->var.xoffset) ||
#ifndef BIT_PER_PIXEL_SURPPORT
(var->bits_per_pixel != fb->var.bits_per_pixel) ||

View file

@ -0,0 +1,15 @@
By default, color channels on Spreadtrum devices are swapped. This patch makes kernel use BGR565, which has normal color channels.
diff --git a/drivers/video/sprdfb/sprdfb_main.c b/drivers/video/sprdfb/sprdfb_main.c
index 3e6c70d..80fceb9 100644
--- a/drivers/video/sprdfb/sprdfb_main.c
+++ b/drivers/video/sprdfb/sprdfb_main.c
@@ -51,7 +51,7 @@ enum{
SPRD_IN_DATA_TYPE_LIMIT
};
-#define SPRDFB_IN_DATA_TYPE SPRD_IN_DATA_TYPE_ABGR888
+#define SPRDFB_IN_DATA_TYPE SPRD_IN_DATA_TYPE_BGR565
#ifdef CONFIG_FB_TRIPLE_FRAMEBUFFER
#define FRAMEBUFFER_NR (3)