Giter Club home page Giter Club logo

linux-mdss-dsi-panel-driver-generator's Introduction

linux-mdss-dsi-panel-driver-generator (lmdpdg)

The downstream kernel for Qualcomm-based Android devices describes panel properties and initialization sequences in the device tree.
(See DSI Panel Driver Porting for details)

This tool uses the information provided in the device tree to automatically generate a simple DRM panel driver, for use in mainline together with Freedreno. As far as possible, it attempts to generate clean C code, so that only minimal changes are necessary for upstreaming the generated panel driver.

Preparation

Requirements

  • Python 3.7+
  • pylibfdt compiled for Python 3

Extracting device tree blob (DTB)

lmdpdg operates on the compiled device tree blob (dtb), not the original source file from the kernel source. This means that it can be easily used even when the kernel source is not available.

The device tree blob can be easily extracted from a stock boot image (boot.img):

$ tools/unpackbootimg.py boot.img
$ tools/unpackqcdt.py dt.img

This will produce multiple *.dtb files in the correct directory. You will need to try multiple (or all) of them to find the correct one.

Compiling from source .dtsi

If you have only the source .dtsi for the panel, or would like to make changes in it, you can still use it as input for this tool. You just need to pretend to have a full device tree blob by setting up the needed device nodes:

/dts-v1/;

/ {
	mdp {
		compatible = "qcom,mdss_mdp";

		/* Add your panels here */
		dsi_sim_vid: qcom,mdss_dsi_sim_video {
			qcom,mdss-dsi-panel-name = "Simulator video mode dsi panel";
			//qcom,mdss-dsi-panel-controller = <&mdss_dsi0>;
			qcom,mdss-dsi-panel-type = "dsi_video_mode";
			/* ... */
		};
	};
};

Comment out entries that refer to other devices (see above).

Compile it using dtc: dtc -O your.dtb your.dts. That's it! Yay!

Usage

Got the device tree blob? Then you are ready to go:

$ ./lmdpdg.py <dtbs...>

The generator has a couple of command line options that can be used to generate additional code (e.g. to enable a regulator to power on the panel). The script will gladly inform you about available options if you pass --help.

Currently there are 4 files generated:

  • panel-xyz.c: The main (full) panel driver for Linux.
  • panel-simple-xyz.c: A snippet to use for panel-simple.c in Linux. Can be used if the full panel driver is causing problems.
  • panel-xyz.dtsi: An example for the relevant panel setup in the device tree.
  • lk_panel_xyz.h: A panel header for Qualcomm's Little Kernel (LK) bootloader. Can be used to turn the display on for splash screens there.

Making final edits

In most cases, the driver should work as-is, no changes required. If you would like to use it permanently, or even upstream it, here are a few things that you may want to update:

  • The compatible string in the device tree match table
  • MODULE_AUTHOR
  • MODULE_DESCRIPTION (eventually)
  • License header
  • If you have comments in your device tree source file (e.g. for the on/off command sequence), you may want to apply them to the driver to make the code a bit less magic.

Adding it to drivers/gpu/drm/panel, together with adding needed Kconfig and Makefile entries should be straightforward.

Warning

This tool is like a human: it can make mistakes. Nobody knows what will happen to your panel if you send it bad commands or turn it on incorrectly. In most cases it will just refuse to work.

However, this tool is mainly intended as a helping hand when porting new panels. You should verify that its output makes sense before using the generated driver.

Questions?

Feel free to open an issue! :)

linux-mdss-dsi-panel-driver-generator's People

Contributors

flamingradian avatar ichernev avatar konradybcio avatar lujianhua avatar marijns95 avatar mis012 avatar newbytee avatar stephan-gh avatar travmurav avatar wonderfulshrinemaidenofparadise avatar z3ntu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

linux-mdss-dsi-panel-driver-generator's Issues

Generator throws exception on missing panel property qcom,mdss-dsi-off-command-state = "dsi_lp_mode";

Generator throws error when trying to generate driver for panel Xiaomi A2 Lite. This was used for generation driver for ili7807_fhdplus_video (ili7807 fhdplus video mode dsi panel)

Debugged process and there was missing property in dtb qcom,mdss-dsi-off-command-state = "dsi_lp_mode";
How i discovered it and repaired it:
a) Generate DTS, see Reproduce original bug below
b) Patch panel.py by https://github.com/msm8916-mainline/linux-mdss-dsi-panel-driver-generator/pull/6
c) Add qcom,mdss-dsi-off-command-state = "dsi_lp_mode"; to DTS
c) DTS -> DTB
d) Generate driver succesfully

Reproduce original bug:
1, Got boot img from https://forum.xda-developers.com/t/fastboot-daisy-patched-boot-img-for-v11-0-2-0-android-10.4064951/
2, boot.img -> kernel.img python3 tools/unpackbootimg.py boot.img
3, dtbs extract-dtb kernel.img from https://pypi.org/project/extract-dtb/
4, driver generation ./lmdpdg.py dtb/02_dtbdump_Qualcomm_Technologies,_Inc._MSM8953_+_PMI8937_Ext_Codec_MTP.dtb

Original Exception:
WARNING: DCS command ENTER_SLEEP_MODE with incorrect argument count (expected: 0, is: 1). Consider using --dumb-dcs
Parsing: ili7807_fhdplus_video (ili7807 fhdplus video mode dsi panel)
Traceback (most recent call last):
File "/tmp/linux-mdss-dsi-panel-driver-generator/./lmdpdg.py", line 69, in
for panel in Panel.find(fdt):
File "/tmp/linux-mdss-dsi-panel-driver-generator/panel.py", line 288, in find
panel = Panel.parse(fdt, sub)
File "/tmp/linux-mdss-dsi-panel-driver-generator/panel.py", line 282, in parse
return name and Panel(name.as_str(), fdt, node)
File "/tmp/linux-mdss-dsi-panel-driver-generator/panel.py", line 260, in init
'off': CommandSequence(fdt, mode_node, 'off')
File "/tmp/linux-mdss-dsi-panel-driver-generator/panel.py", line 139, in init
self.state = CommandSequence.State(fdt.getprop(node, f'qcom,mdss-dsi-{cmd}-command-state').as_str())
File "/usr/local/lib/python3.9/dist-packages/libfdt.py", line 451, in getprop
pdata = check_err_null(fdt_getprop(self._fdt, nodeoffset, prop_name),
File "/usr/local/lib/python3.9/dist-packages/libfdt.py", line 156, in check_err_null
raise FdtException(val)
libfdt.FdtException: pylibfdt error -1: FDT_ERR_NOTFOUND

Thank you for looking into this.

DTB File:

02_dtbdump_Qualcomm_Technologies,_Inc.MSM8953+_PMI8937_Ext_Codec_MTP.zip
:

Original boot.img:

boot.zip
:

Cannot send DSI commands in unprepare callback

dsi commands in unprepare cause some error message it not cause any serious issue but it seems dsi commands are not allowed in this callback.

[   92.322564] panel-td4320-boeplus c994000.dsi.0: sending command 0x28 failed: -22
[   92.322635] panel-td4320-boeplus c994000.dsi.0: Failed to un-initialize panel: -22

Better describe how to use tool options

Could you please add description and usage, how to use this tool's options with examples?

  • Regulators, how to get their names(from device dtsi/panel section?) like from "arch/arm64/boot/dts/qcom/"
  • When to use option for backlight? How to distinguish if device has extra GPIO.
  • dumb-dcs in what use cases to use it? Any problems it could cause?

And perhaps how to test it(how to compile on device and add it add module, and then "apk fix linux-postmarketos-*" ??). Thank you

libfdt.FdtException: pylibfdt error -9: FDT_ERR_BADMAGIC

Hi
I tried to use lmdpdg.py on both a binary dtb and the decompiled version (I think that's what you mean by dtbs).
I installed pylibfdt first by using this https://github.com/devicetree-org/pylibfdt
This is the output I get:-
$ ./lmdpdg.py rk3566_tablet2.dts Parsing: rk3566_tablet2.dts Traceback (most recent call last): File "./lmdpdg.py", line 72, in <module> fdt = Fdt2(f.read()) File "/usr/local/lib/python3.8/dist-packages/pylibfdt-1.6.1-py3.8-linux-x86_64.egg/libfdt.py", line 174, in __init__ check_err(fdt_check_header(self._fdt)); File "/usr/local/lib/python3.8/dist-packages/pylibfdt-1.6.1-py3.8-linux-x86_64.egg/libfdt.py", line 132, in check_err raise FdtException(val) libfdt.FdtException: pylibfdt error -9: FDT_ERR_BADMAGIC

what did I get wrong please?

dump of xiaomi 11 lite 5g ne found DT_ERR_NOTFOUND

fdt dump of /sys/firmware/fdt
lisa_fdt_dump.zip
:~/source/linux-mdss-dsi-panel-driver-generator# ./lmdpdg.py ../Android_boot_image_editor/build/lisa_dtbo/dt/fdt
Parsing: ../Android_boot_image_editor/build/lisa_dtbo/dt/fdt
ERROR: Failed to get property: qcom,dsi-panel
Traceback (most recent call last):
File "./lmdpdg.py", line 75, in
for offset in Panel.find(fdt):
File "/root/source/linux-mdss-dsi-panel-driver-generator/panel.py", line 333, in find
panel_phandles.add(fdt.getprop(display, 'qcom,dsi-panel').as_uint32())
File "/root/source/linux-mdss-dsi-panel-driver-generator/fdt2.py", line 32, in getprop
return super().getprop(nodeoffset, prop_name, quiet)
File "/usr/local/lib/python3.8/dist-packages/libfdt.py", line 451, in getprop
pdata = check_err_null(fdt_getprop(self._fdt, nodeoffset, prop_name),
File "/usr/local/lib/python3.8/dist-packages/libfdt.py", line 156, in check_err_null
raise FdtException(val)
libfdt.FdtException: pylibfdt error -1: FDT_ERR_NOTFOUND

Parsing dtb file fail at panel node with newer code change-set

With latest code (310f523) no longer work. previously 3e9ac4f can do panel extract.
test did not gone through all resent changes, no bi-sec info.

Parsing: ../dts/v8000/dtbdump_53.dtb
Parsing: sim_video (Simulator video mode dsi panel)
Traceback (most recent call last):
File "./lmdpdg.py", line 71, in
for panel in Panel.find(fdt):
File "/root/source/linux-mdss-dsi-panel-driver-generator/panel.py", line 313, in find
panel = Panel.parse(fdt, sub)
File "/root/source/linux-mdss-dsi-panel-driver-generator/panel.py", line 306, in parse
return name and Panel(name.as_str(), fdt, node)
File "/root/source/linux-mdss-dsi-panel-driver-generator/panel.py", line 284, in init
dsi_ctrl = fdt.node_offset_by_phandle(dsi_ctrl)
File "/usr/local/lib/python3.8/dist-packages/libfdt.py", line 509, in node_offset_by_phandle
return check_err(fdt_node_offset_by_phandle(self._fdt, phandle), quiet)
File "/usr/local/lib/python3.8/dist-packages/libfdt.py", line 132, in check_err
raise FdtException(val)
libfdt.FdtException: pylibfdt error -6: FDT_ERR_BADPHANDLE

the dtc dis-compiled dts node:
qcom,mdss_dsi_sim_video {
qcom,mdss-dsi-panel-name = "Simulator video mode dsi panel";
qcom,mdss-dsi-panel-type = "dsi_video_mode";
qcom,mdss-dsi-panel-framerate = <0x3c>;
qcom,mdss-dsi-virtual-channel-id = <0x0>;
qcom,mdss-dsi-stream = <0x0>;
qcom,mdss-dsi-panel-width = <0x280>;
qcom,mdss-dsi-panel-height = <0x1e0>;
qcom,mdss-dsi-h-front-porch = <0x8>;
qcom,mdss-dsi-h-back-porch = <0x8>;
qcom,mdss-dsi-h-pulse-width = <0x8>;
qcom,mdss-dsi-h-sync-skew = <0x0>;
qcom,mdss-dsi-v-back-porch = <0x6>;
qcom,mdss-dsi-v-front-porch = <0x6>;
qcom,mdss-dsi-v-pulse-width = <0x2>;
qcom,mdss-dsi-h-left-border = <0x0>;
qcom,mdss-dsi-h-right-border = <0x0>;
qcom,mdss-dsi-v-top-border = <0x0>;
qcom,mdss-dsi-v-bottom-border = <0x0>;
qcom,mdss-dsi-bpp = <0x18>;
qcom,mdss-dsi-underflow-color = <0xff>;
qcom,mdss-dsi-border-color = <0x0>;
qcom,mdss-dsi-on-command = [32 01 00 00 00 00 02 00 00];
qcom,mdss-dsi-off-command = [22 01 00 00 00 00 02 00 00];
qcom,mdss-dsi-on-command-state = "dsi_lp_mode";
qcom,mdss-dsi-off-command-state = "dsi_lp_mode";
qcom,mdss-dsi-h-sync-pulse = <0x0>;
qcom,mdss-dsi-traffic-mode = "non_burst_sync_event";
qcom,mdss-dsi-bllp-eof-power-mode;
qcom,mdss-dsi-bllp-power-mode;
qcom,mdss-dsi-lane-0-state;
qcom,mdss-dsi-lane-1-state;
qcom,mdss-dsi-lane-2-state;
qcom,mdss-dsi-lane-3-state;
qcom,mdss-dsi-panel-timings = <0x0 0x0 0x0>;
qcom,mdss-dsi-t-clk-post = <0x4>;
qcom,mdss-dsi-t-clk-pre = <0x1b>;
qcom,mdss-dsi-dma-trigger = "trigger_sw";
qcom,mdss-dsi-mdp-trigger = "none";
qcom,mdss-dsi-reset-sequence = <0x1 0x0 0x0 0x0 0x1 0x0>;
qcom,panel-ack-disabled;
};

here is log for older change-set:
...
Parsing: truly_1080p_cmd (truly 1080p cmd mode dsi panel)
Generating: truly_1080p_cmd (truly 1080p cmd mode dsi panel)
Parsing: truly_1080p_video (truly 1080p video mode dsi panel)
Generating: truly_1080p_video (truly 1080p video mode dsi panel)
Parsing: rm67195_amoled_fhd_cmd (rm67195 amoled fhd cmd mode dsi panel)
Generating: rm67195_amoled_fhd_cmd (rm67195 amoled fhd cmd mode dsi panel)
WARNING: DCS command SET_DISPLAY_OFF with incorrect argument count (expected: 0, is: 1). Consider using --dumb-dcs
WARNING: DCS command SET_DISPLAY_ON with incorrect argument count (expected: 0, is: 1). Consider using --dumb-dcs
WARNING: DCS command NOP with incorrect argument count (expected: 0, is: 1). Consider using --dumb-dcs
WARNING: DCS command SOFT_RESET with incorrect argument count (expected: 0, is: 1). Consider using --dumb-dcs
WARNING: DCS command ENTER_PARTIAL_MODE with incorrect argument count (expected: 0, is: 1). Consider using --dumb-dcs
WARNING: DCS command ENTER_NORMAL_MODE with incorrect argument count (expected: 0, is: 1). Consider using --dumb-dcs
WARNING: DCS command EXIT_INVERT_MODE with incorrect argument count (expected: 0, is: 1). Consider using --dumb-dcs
WARNING: DCS command ENTER_INVERT_MODE with incorrect argument count (expected: 0, is: 1). Consider using --dumb-dcs
Parsing: s6d6ft0_tianma_fhd_video (s6d6ff0 tianma fhd video mode dsi panel)
Generating: s6d6ft0_tianma_fhd_video (s6d6ff0 tianma fhd video mode dsi panel)
WARNING: DCS command WRITE_POWER_SAVE with incorrect argument count (expected: 1, is: 0). Consider using --dumb-dcs
Parsing: td4310_huashi_fhd_video (td4310 huashi fhd video mode dsi panel)
Generating: td4310_huashi_fhd_video (td4310 huashi fhd video mode dsi panel)

dtbdump_53.dtb.gz

Feature request: generate panel orientation code

In case e.g. qcom,mdss-dsi-panel-orientation = "180"; is set for a panel it should generate code for the panel driver to be able to customize the orientation in DTS (and provide the value to set there as well in the example).

On my OnePlus 5 the used qcom,mdss_dsi_samsung_s6e3fa5_1080p_cmd panel is oriented physically upside down and thus the default rendered output is upside down if this isn't accounted for in the panel driver.

FDT: cheeseburger.dtb.zip
Source DTS: https://github.com/LineageOS/android_kernel_oneplus_msm8998/blob/lineage-19.1/arch/arm/boot/dts/qcom/dsi-panel-samsung_s6e3fa5_1080p_cmd.dtsi#L158

For now I've got these related commits in my mainline kernel fork for the panel driver:

htc: parse htc-fmt,mdss-dsi-on-command, htc-fmt,mdss-dsi-off-command

On HTC platforms that use Qualcomm SoCs, mdss_dsi_parse_dcs_cmds is not used to parse the panels init sequence, which is defined with htc-fmt,mdss-dsi-on-command, htc-fmt,mdss-dsi-off-command and htc-fmt,display-on-cmds. Replacing htc-fmt with qcom does not work and causes the following error:

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/valerie/Git/linux-mdss-dsi-panel-driver-generator/./lmdpdg.py", line 77, in <module>
    panel = Panel.parse(fdt, offset)
            ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/valerie/Git/linux-mdss-dsi-panel-driver-generator/panel.py", line 334, in parse
    return name and Panel(name.as_str(), fdt, node)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/valerie/Git/linux-mdss-dsi-panel-driver-generator/panel.py", line 273, in __init__
    'on': CommandSequence(fdt, mode_node, 'on'),
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/valerie/Git/linux-mdss-dsi-panel-driver-generator/panel.py", line 166, in __init__
    payload = bytes(next(itr) for _ in range(0, dlen))
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
RuntimeError: generator raised StopIteration

Here are the properties called: https://github.com/rom4nik/kernel_release-a51ul-3.10.28-g1e0287c/blob/master/drivers/video/msm/mdss/mdss_dsi_panel.c#L1259

Here are the properties parsed: https://github.com/rom4nik/kernel_release-a51ul-3.10.28-g1e0287c/blob/master/drivers/video/msm/mdss/mdss_htc_util.c#L195

And here is the downstream panel DTSI: https://github.com/rom4nik/kernel_release-a51ul-3.10.28-g1e0287c/blob/master/arch/arm/boot/dts/qcom/dsi-panel-a51.dtsi

ValueError: 'bl_ctrl_external' is not a valid BacklightControl

Parsing: oppo19696jdi_nt36672c_1080_2400_90fps_vid (jdi nt36672c fhd ltps tft lcd panel with DSC)
Traceback (most recent call last):
File "/mnt/build/patriot06/dsi/./lmdpdg.py", line 77, in
panel = Panel.parse(fdt, offset)
^^^^^^^^^^^^^^^^^^^^^^^^
File "/mnt/build/patriot06/dsi/panel.py", line 334, in parse
return name and Panel(name.as_str(), fdt, node)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/mnt/build/patriot06/dsi/panel.py", line 234, in init
self.backlight = BacklightControl(backlight.as_str()) if backlight else None
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/enum.py", line 712, in call
return cls.new(cls, value)
^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/enum.py", line 1135, in new
raise ve_exc
ValueError: 'bl_ctrl_external' is not a valid BacklightControl

Help wanted about porting

@stephan-gh i have issue.. i am on a13.. stock boot.img.. unable to extract dtb from boot img..
IMG_20230717_033742

Then i used DumprX https://github.com/DumprX/DumprX for my unpack my device Firmware.. and i received too many my_devices.dtb but when i am trying to take display panel data , i am unable to get error is my_devices.dtb does not contain any usable panel specifications

IMG_20230717_203117

But I have fdt & i compiled it with dtc this is my fdt output
https://raw.githubusercontent.com/Saikatsaha1996/realme-porsche/main/realme-porsche.dts.txt

My display panel kernel cmmdline
msm_drm.dsi_display0=qcom,mdss_dsi_oplus21617samsung_ams662zs01_1080_2400_cmd_dvt: oplus_bsp_tp_custom.dsi_display0=qcom,mdss_dsi_oplus21617samsung_ams662zs01_1080_2400_cmd_dvt:focaltech,ft3658u

I also have my separate display panel dtsi in downstream..

  1. https://github.com/pjgowtham/android_kernel_oneplus_sm8350/blob/54f795570db73477754b92a0af9db149732ca46b/arch/arm64/boot/dts/vendor/oplus/porsche/dsi-panel-oplus21617-samsung-ams662zs01-1080-2400-dvt-dsc-cmd.dtsi

  2. https://github.com/pjgowtham/android_kernel_oneplus_sm8350/blob/54f795570db73477754b92a0af9db149732ca46b/arch/arm64/boot/dts/vendor/oplus/porsche/dsi-panel-oplus21617-samsung-ams662zs01-1080-2400-rev-dsc-cmd.dtsi

  3. https://github.com/pjgowtham/android_kernel_oneplus_sm8350/blob/54f795570db73477754b92a0af9db149732ca46b/arch/arm64/boot/dts/vendor/oplus/porsche/dsi-panel-porsche21617-samsung-1080-2400-dsc-cmd-120hz.dtsi

  4. https://github.com/pjgowtham/android_kernel_oneplus_sm8350/blob/54f795570db73477754b92a0af9db149732ca46b/arch/arm64/boot/dts/vendor/oplus/porsche/dsi-panel-porsche21617-samsung-1080-2400-dsc-cmd-dvt-120hz.dtsi

  5. https://github.com/pjgowtham/android_kernel_oneplus_sm8350/blob/54f795570db73477754b92a0af9db149732ca46b/arch/arm64/boot/dts/vendor/oplus/porsche/dsi-panel-porsche21617-samsung-1080-2400-dsc-cmd.dtsi

And now update i used my fdt .. i compiled fdt and take output dtb

And used like this..

./lmdpdg.py my_fdt_output.dtb

Got to many errors & output also.. inside headers file & c file available like this..
IMG_20230717_052107

I checked.. my error is..
ERROR: failed to get property : qcom-mdss-dsi-on-commnd-state

Screenshot_2023-07-17-04-55-07-59_84d3000e3f4017145260f7618db1d683

My kernel cmmdline was
msm_drm.dsi_display0=qcom,mdss_dsi_oplus21617samsung_ams662zs01_1080_2400_cmd_dvt: oplus_bsp_tp_custom.dsi_display0=qcom,mdss_dsi_oplus21617samsung_ams662zs01_1080_2400_cmd_dvt:focaltech,ft3658u

So i should take this one ?
dsi_oplus21617samsung_ams662zs01_1080_2400_cmd_dvt

for testing i took mdss_dsi_oplus21617samsung_ams662zs01_1080_2400_cmd_dvt.c to drivers/gpu/drm/panel and edited kconfig & makefile like this.. i am not sure if it currect or not..
Can you check which is wrong? Which depends i should add more in kconfig

IMG_20230717_201117
IMG_20230717_201103

And now what should I do?

One more thing I am noob please help.. ๐Ÿค—
Thank you advanced..

Fatal Python error: none_dealloc: deallocating None: bug likely caused by a refcount error in a C extension

$ ./generate.sh
Generating panel drivers...
======== acer-a1-724.sh ========
Parsing: /tmp/linux-panel-drivers/dtb/acer-a1-724.dtb
Parsing: sim_video (Simulator video mode dsi panel)
Generating: sim_video (Simulator video mode dsi panel)
Parsing: hx8394d_720p_video (hx8394d 720p video mode dsi panel)
Generating: hx8394d_720p_video (hx8394d 720p video mode dsi panel)
Fatal Python error: none_dealloc: deallocating None: bug likely caused by a refcount error in a C extension
Python runtime state: finalizing (tstate=0x00007f5e469bd638)

Current thread 0x00007f5e46a99b48 (most recent call first):
  <no Python frame>
./generate.sh: line 38: 172909 Aborted                 "$LMDPDG_DIR/lmdpdg.py" "${OPTIONS[@]}" "$DTB"
$ cat /etc/os-release
NAME="Alpine Linux"
ID=alpine
VERSION_ID=3.18_alpha20230329
PRETTY_NAME="Alpine Linux edge"
HOME_URL="https://alpinelinux.org/"
BUG_REPORT_URL="https://gitlab.alpinelinux.org/alpine/aports/-/issues"
$ apk list -I | grep py3
WARNING: opening /mnt/pmbootstrap-packages: No such file or directory
py3-attrs-22.2.0-r0 x86_64 {py3-attrs} (MIT) [installed]
py3-dt-schema-2023.01-r0 x86_64 {py3-dt-schema} (BSD-2-Clause) [installed]
py3-jsonschema-4.7.2-r3 x86_64 {py3-jsonschema} (MIT) [installed]
py3-libfdt-1.6.1-r6 x86_64 {dtc} (GPL-2.0-or-later) [installed]
py3-pathspec-0.11.1-r0 x86_64 {py3-pathspec} (MPL-2.0) [installed]
py3-pyrsistent-0.19.3-r0 x86_64 {py3-pyrsistent} (MIT) [installed]
py3-rfc3987-1.3.8-r3 x86_64 {py3-rfc3987} (GPL-3.0-or-later) [installed]
py3-ruamel.yaml-0.17.21-r1 x86_64 {py3-ruamel.yaml} (MIT) [installed]
py3-ruamel.yaml.clib-0.2.7-r1 x86_64 {py3-ruamel.yaml.clib} (MIT) [installed]
py3-yaml-6.0-r2 x86_64 {py3-yaml} (MIT) [installed]
$ python -V
Python 3.11.3

dts: Adding device tree for drm panel

Panel: raspberry pi 7-inch display
DSI connection two-lane
Configurable through i2c

My changes:

  1. Adding port in mdss_dsi0 node.
    ` ports {
    port@0 {
    reg = <0>;
    mdss_dsi0_out: endpoint {
    remote-endpoint = <&mdss_dsi0_in>;
    };
    };
    };

2. Adding Panel configuration.&qupv3_se2_i2c {
status = "ok";
qcom,clk-freq-out = <100000>;
rpi-display@45 {
status = "ok";
compatible = "raspberrypi,7inch-touchscreen-panel";
reg = <0x45>;
port {
mdss_dsi0_in: endpoint {
remote-endpoint = <&mdss_dsi0_out>;
};
};
};

    rpi-touchscreen@38 {
            status = "ok";
            compatible = "rpi,ft5406";
            reg = <0x38>;
            touchscreen-size-x = <800>;
            touchscreen-size-y = <480>;
            rotate_180 = <0>;
    };

};
--> Compilation successful without any warning or error. --> Gives runtime error.[ 4.162367] i2c /dev entries driver
[ 4.167272] i2c_geni 4a80000.i2c: Bus frequency is set to 400000Hz
[ 4.175085] i2c_geni 4a88000.i2c: Bus frequency is set to 400000Hz
[ 4.183741] <>[gt1x_ts_probe:614] GTP Driver Version: V1.6<2017/12/11>,slave addr:5dh
[ 4.192537] i2c i2c-1: of_i2c: modalias failure on /soc/i2c@4a88000/rpi-display@45
[ 4.200168] i2c i2c-1: Failed to create I2C device for /soc/i2c@4a88000/rpi-display@45
[ 4.208110] i2c i2c-1: of_i2c: modalias failure on /soc/i2c@4a88000/rpi-touchscreen@38
[ 4.216070] i2c i2c-1: Failed to create I2C device for /soc/i2c@4a88000/rpi-touchscreen@38
`

Let me know possible causes.
Thanks

Can't extract the dtb.img on google-blueline

Hi,
I've attempted to extract the dtb out of the boot.img for google-blueline. I've used the https://mirrorbits.lineageos.org/full/blueline/20230620/boot.img

But after running the following commands I get an error

$ tools/unpackbootimg.py boot.img
$ tools/unpackqcdt.py dt.img
Traceback (most recent call last):
  File "/home/cylon2p0/linux-mdss-dsi-panel-driver-generator/tools/unpackqcdt.py", line 34, in <module>
    magic, version, n = struct.unpack(HEADER_FORMAT, b[:HEADER_SIZE])
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
struct.error: unpack requires a buffer of 12 bytes

Could it be due to the fact google-blueline requires a special hack due to the implementation in the bootloader?
https://gitlab.com/postmarketOS/pmaports/-/merge_requests/3932/diffs?commit_id=152a7d398fa655a8a686c34654ea9370feef2c3f#2a69d86c24b94fa0c238d1653c5b9a03d14271d6

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.