nE0sIghT / android_kernel_xiaomi_msm8953

Xiaomi Redmi Note 4 (mido) LineageOS updated kernel
Other
23 stars 7 forks source link

Panel not work after boot up #5

Closed Nicklas373 closed 4 years ago

Nicklas373 commented 4 years ago

The kernel actually success to boot up, but on my device, display not working and didn't show any interface except a black screen.

Is there anything that need to do on display panel dtb?

Thanks for your hard work sir

nE0sIghT commented 4 years ago

Do you booting Android or Recovery? As for now I was able to successfully boot recovery with display working, but not Android session. See #4

Nicklas373 commented 4 years ago

Android, it passed mi logo then just black until reach home screen. It tell with vibrate when i plug usb to the phone.

On recovery it should work, cause i'm still use older recovery to flash kernel.

I can't take any log after boot, cause that display isn't show up. Is there anyway to take a log?

Thanks for your response

nE0sIghT commented 4 years ago

This kernel is not ready to boot Android session - I experience same problems for now. I see kgsl errors and audioserver crash.

Taking logs is a bit tricky:

  1. You need to add init.msm.usb.configfs.rc file to /vendor/etc/init/hw/
  2. Then you should modify /system/etc/prop.default and change values:
    ro.secure=0
    ro.debuggable=1
    ro.adb.secure=0
    persist.sys.usb.config=mtp,adb
  3. After that you will get adb without authorization. Just do adb shell dmesg and/or adb shell logcat.
Nicklas373 commented 4 years ago

Hmm okay, i'll do it again later. Thanks for your response, already test to several panel, but only boe that partially work. But touchscreen drivers seems not working.

I'll try this way to grab log, didn't see any kgsl when first check console-ramoops. Only see vbmeta error, then i pick your commit to fix it

nE0sIghT commented 4 years ago

already test to several panel, but only boe that partially work. But touchscreen drivers seems not working

nt35532 panel with ft5435 touch works for me in recovery - both Lineage and TWRP.

Kiciuk commented 4 years ago

Hai, I came to tell you that twrp getting display compared to lineage might be due to different panel initialization. There are ways to hook framebuffer from bootloader when it shows continous splash screen. This feature is for example used in LK2ND second stage bootloader for qcom devices.

I have seen some logs from one folk and it seems you might have to update display dtsi due to additional bindings introduced in 4,9 kernel. Here is binding for panel dtsi for 4.9 Kernel: https://github.com/nE0sIghT/android_kernel_xiaomi_msm8953/blob/lineage-16.0-mido-4.9/Documentation/devicetree/bindings/fb/mdss-dsi-panel.txt and here for our eol 3.18: https://github.com/nE0sIghT/android_kernel_xiaomi_msm8953/blob/caf/msm-3.18/Documentation/devicetree/bindings/fb/mdss-dsi-panel.txt

There is also one stuff which got me bit harder:


mdss_dsi_panel_timing_from_dt: found new timing "qcom,mdss_dsi_nt35532_fhd_video" (ffffffc0eb4c8c00)
[    0.448052] mdss_dsi_parse_dcs_cmds: failed, key=qcom,mdss-dsi-post-panel-on-command
[    0.448058] mdss_dsi_parse_dcs_cmds: failed, key=qcom,mdss-dsi-timing-switch-command
[    0.448061] mdss_dsi_panel_get_dsc_cfg_np: cannot find dsc config node:
[    0.448121] mdss_dsi_parse_dcs_cmds: failed, key=qcom,mdss-dsi-idle-on-command
[    0.448126] mdss_dsi_parse_dcs_cmds: failed, key=qcom,mdss-dsi-idle-off-command
[    0.448141] mdss_dsi_parse_panel_features: ulps feature disabled
[    0.448146] mdss_dsi_parse_panel_features: ulps during suspend feature disabled
[    0.448151] mdss_dsi_parse_dms_config: dynamic switch feature enabled: 0
[    0.448184] mdss_dsi_parse_dcs_cmds: failed, key=qcom,mdss-dsi-lp-mode-on
[    0.448189] mdss_dsi_parse_dcs_cmds: failed, key=qcom,mdss-dsi-lp-mode-off
[    0.448217] mdss_dsi_get_dt_vreg_data: error reading ulp load. rc=-22
[    0.448224] mdss_dsi_get_dt_vreg_data: error reading ulp load. rc=-22
[    0.448231] mdss_dsi_get_dt_vreg_data: error reading ulp load. rc=-22
[    0.448239] mdss_dsi_get_dt_vreg_data: error reading ulp load. rc=-22
**[    0.448261] 1a94000.qcom,mdss_dsi_ctrl0 supply vdd not found, using dummy regulator**
[    0.448374] mdss_dsi_parse_ctrl_params:4231 Unable to read qcom,display-id, data=0000000000000000,len=20
[    0.448384] mdss_dsi_parse_gpio_params: bklt_en gpio not specified
[    0.448389] mdss_dsi_parse_gpio_params: ext vdd gpio not specified

https://github.com/nE0sIghT/android_kernel_xiaomi_msm8953/blob/lineage-16.0-mido-4.9/arch/arm64/boot/dts/qcom/msm8953-mdss.dtsi

mdss_dsi0: qcom,mdss_dsi_ctrl0@1a94000 { vdd-supply = <&pm8953_l17>; vddio-supply = <&pm8953_l6>; }

In short regulator for display LDOA-l17 or how its called might be disabled if i read it properly from: https://github.com/nE0sIghT/android_kernel_xiaomi_msm8953/blob/lineage-16.0-mido-4.9/arch/arm64/boot/dts/qcom/pm8953-rpm-regulator.dtsi

take a look at tissot: https://github.com/nE0sIghT/android_kernel_xiaomi_msm8953/blob/lineage-16.0-mido-4.9/arch/arm64/boot/dts/qcom/tissot/msm8953-regulator-tissot.dtsi

and maybe try to introduce it to mido, atleast this l17 as messing with regulators can be deadly for boards. You cannot initialize panel when it has no power-on.

Nicklas373 commented 4 years ago

@nE0sIghT i didn't build recovery from your kernel so far, so i don't know that touchscreen will work or not ;_;

nE0sIghT commented 4 years ago

There is also one stuff which got me bit harder:

I will check it, however same message produced with 3.18.
vdd-regulator is disabled with 3.18 dtb also.

Also panel is not disabled for me - it's just empty, but glowing.

offset1313 commented 4 years ago

Qcom 8953 platform LCD lighting process :

http://www.programmersought.com/article/89221029865/

nE0sIghT commented 4 years ago

Here is dmesg with mdss debug enabled: https://gist.github.com/nE0sIghT/d435fe3808e53fdeed1abf5b84b549f4

nE0sIghT commented 4 years ago

logcat: https://gist.github.com/nE0sIghT/8bc41604d1c19ad27bdba946d5c92d02

Looks suspected:

04-18 13:03:38.892   833   867 W Adreno-GSL: <gsl_ldd_control:548>: ioctl fd 8 code 0x400c0907 (IOCTL_KGSL_DEVICE_WAITTIMESTAMP_CTXTID) failed: errno 35 Resource deadlock would occur
04-18 13:03:38.892   833   867 W Adreno-GSL: <log_gpu_snapshot:457>: panel.gpuSnapshotPath is not set.not generating user snapshot
04-18 13:03:38.892   833   867 W Adreno-GSL: <gsl_ldd_control:548>: ioctl fd 8 code 0xc0200933 (IOCTL_KGSL_TIMESTAMP_EVENT) failed: errno 22 Invalid argument
04-18 13:03:38.892   833   867 W Adreno-GSL: <ioctl_kgsl_syncobj_create:4150>: (9, 4, 4224) fail 22 Invalid argument
04-18 13:03:38.895   925   925 I imsrcsd : Uce Service HAL  is starting up...
04-18 13:03:38.896   925   925 I imsrcsd : getAndroidPropValue : vendor.ims.DATA_DAEMON_STATUS[1]
04-18 13:03:38.902   504   504 I SurfaceFlinger: Enter boot animation
04-18 13:03:38.904   833   867 W Adreno-GSL: <gsl_ldd_control:548>: ioctl fd 8 code 0xc040094a (IOCTL_KGSL_GPU_COMMAND) failed: errno 35 Resource deadlock would occur
04-18 13:03:38.904   833   867 W Adreno-GSL: <log_gpu_snapshot:457>: panel.gpuSnapshotPath is not set.not generating user snapshot
04-18 13:03:38.904   833   867 W Adreno-GSL: <gsl_ldd_control:548>: ioctl fd 8 code 0xc040094a (IOCTL_KGSL_GPU_COMMAND) failed: errno 35 Resource deadlock would occur
04-18 13:03:38.904   833   867 W Adreno-GSL: <log_gpu_snapshot:457>: panel.gpuSnapshotPath is not set.not generating user snapshot

and from dmesg:

[    7.316635] ueventd: firmware: loading 'a530_pm4.fw' for '/devices/platform/soc/1c00000.qcom,kgsl-3d0/kgsl/kgsl-3d0/a530_pm4.fw'
[    7.333569] subsys-pil-tz soc:qcom,kgsl-hyp: a506_zap: loading from 0x000000008f000000 to 0x000000008f002000
[    7.353491] subsys-pil-tz soc:qcom,kgsl-hyp: a506_zap: Brought out of reset
[    8.990674] kgsl kgsl-3d0: |a5xx_cp_hw_err_callback| ringbuffer opcode error | possible opcode=0x00000000
[    8.990771] kgsl kgsl-3d0: |kgsl_iommu_fault_handler| GPU PAGE FAULT: addr = 7FFD62040 pid= 833
[    8.990780] kgsl kgsl-3d0: |kgsl_iommu_fault_handler| context=gfx3d_user TTBR0=0x80000d4a74000 CIDR=0x341 (read translation fault)
[    8.990786] kgsl kgsl-3d0: ---- nearby memory ----
[    8.990800] kgsl kgsl-3d0: [00000007FFD62000 - 00000007FFD66000]   (pid = 833) (command)
[    8.990806] kgsl kgsl-3d0:  <- fault @ 7FFD62040
[    8.990811] kgsl kgsl-3d0: [00000007FFD66000 - 00000007FFD67000]   (pid = 833) (any(0))
[    9.003769] kgsl kgsl-3d0: |adreno_hang_int_callback| MISC: GPU hang detected
[    9.003808] kgsl kgsl-3d0: bootanimation[833]: gpu fault ctx 4 ts 1 status 800001C1 rb 00c0/01c6 ib1 00000007FFD62000/046e ib2 0000000000000000/0000
[    9.003818] kgsl kgsl-3d0: bootanimation[833]: gpu fault rb 2 rb sw r/w 00c0/01c6
[    9.048919] kgsl: kgsl_snapshot_push_object: snapshot: Can't find entry for 0x0000000000000000
[    9.049147] kgsl: adreno_snapshot: GPU snapshot froze 152Kb of GPU buffers
[    9.049158] kgsl kgsl-3d0: |kgsl_device_snapshot| snapshot created at pa 0x00000000eb100000 size 815696
[    9.049462] kgsl kgsl-3d0: |a5xx_cp_hw_err_callback| ringbuffer opcode error | possible opcode=0x00000000
[    9.049553] kgsl kgsl-3d0: |kgsl_iommu_fault_handler| GPU PAGE FAULT: addr = 7FFD632B0 pid= 833
[    9.049560] kgsl kgsl-3d0: |kgsl_iommu_fault_handler| context=gfx3d_user TTBR0=0x80000d4a74000 CIDR=0x341 (read translation fault)
[    9.049566] kgsl kgsl-3d0: ---- nearby memory ----
[    9.049579] kgsl kgsl-3d0: [00000007FFD62000 - 00000007FFD66000]   (pid = 833) (command)
[    9.049583] kgsl kgsl-3d0:  <- fault @ 7FFD632B0
[    9.049588] kgsl kgsl-3d0: [00000007FFD66000 - 00000007FFD67000]   (pid = 833) (any(0))
[    9.062570] kgsl kgsl-3d0: |adreno_hang_int_callback| MISC: GPU hang detected
[    9.062867] kgsl kgsl-3d0: bootanimation[833]: gpu failed ctx 4 ts 2
nE0sIghT commented 4 years ago

Just to be sure - I built 3.18 version of kgsl with 4.9 kernel [1] (fixing compile/compat errors) and got same GPU fault.

I'm sure that this problem is somewhere in the kgsl iommu because of outdated mido bootloader missing some features used in recent arm-smmu (as lack of AARCH64 that break main iommu and framebuffer: 19600e0a).

[1] https://github.com/nE0sIghT/android_kernel_xiaomi_msm8953/tree/lineage-16.0-mido-4.9-kgsl-3.18

Kiciuk commented 4 years ago

LK of marshmallow branch: https://source.codeaurora.org/quic/la/kernel/lk/tree/?h=LA.UM.5.3-06310-89xx.0 LK of nougat branch if xiaomi updated it together: https://source.codeaurora.org/quic/la/kernel/lk/tree/?h=LA.UM.5.6.r1-02100-89xx.0&id=44de6c13b5ce49114517dd1141973b5db06d2011

Personally i think instead of doing 4.9 it might be better to go straight and mainline our device. AOSP can be now booted on mainline kernel what was done already on pocophone.

If you somehow still want to run 4.9 maybe try consider rebase of kernel on newest branch+prepare LK2ND as it should support latest stuff.

nE0sIghT commented 4 years ago

prepare LK2ND

Looks like the problem is in TZ and as I know it is proprietary.

offset1313 commented 4 years ago

While it might not solve the problem at all but testing on latest firmware would be better choice.

On comparison of emmc_appsboot.mbn(aboot) image from 7.1.19 (Nougat first beta) and V11.0.2.0.NCFMIXM(2019.11.07) (last stable) there was difference at about 103332 Bytes clearly indicating at bootloader changes along with different releases.

Nicklas373 commented 4 years ago

While it might not solve the problem at all but testing on latest firmware would be better choice.

On comparison of emmc_appsboot.mbn(aboot) images from 7.1.19 (Nougat first beta) and V11.0.2.0.NCFMIXM 7.0 (last stable) there was difference at about 103332 Bytes clearly indicating at bootloader changes along with different releases.

what could possibility needed changes on emmc itself? does that have any relation with mido current issue?

nE0sIghT commented 4 years ago

Unlikely, but I will check my images now. I usually followed changes in official stable images (tz, modem etc).

nE0sIghT commented 4 years ago

Hello from 1st ever booted almost-functional mido with 4.9 kernel :-) I will rebase and publish new patchset tomorrow.

2H9gI-eArnk

Nicklas373 commented 4 years ago

Great work sir !!!!, Appreciate it !!!, What you did on kgsl to make it work?

offset1313 commented 4 years ago

Ohh great ! Nobody form mido Dev community would believe it.

You can rebase to latest caf tag .

I am astonished!!! Lot of appreciation!!!!

AryanKedare commented 4 years ago

Congratulations for your work sir No one was able to do it in mido community

Massive Respect to you sir

gaganmalvi commented 4 years ago

I didn't believe my eyes at first, but yeah, sincere thanks to you sir for getting 4.9 to beloved mido <3

Massive respect and appreciation for your work sir :')))

smokey18 commented 4 years ago

Kool Sir, Appreciate it!!! Thanks for the Awesome Job...

peru_respect :P

herobuxx commented 4 years ago

Cingartulations bro! Big appreciate for you!

obscenelyvague commented 4 years ago

👀

nE0sIghT commented 4 years ago

What you did on kgsl to make it work?

Actually, my aarch64 patch was incomplete. We should avoid aarch64 ctx format for APPS iommu, but keep it for GPU iommu.

I published patches, so closing this issue. We still need to bring up audio, recheck fingerprint and other stuff.