Skip to content

getprop_or_none acts as getprop #50

@HorizonEmuTeam

Description

@HorizonEmuTeam

I am getting an error because panel.py couldn't find an optional property. Getprop_or_none() is used, but the program returns getprop()'s error and fails. Expected behaviour is getprop_or_none() ignoring the unfound property and just returning nothing.
Log:
Parsing: dsi-panel-oplus-senna-bc-nt37705-1240-2772-dsc-cmd.dtb
Parsing: oplus_senna_bc_nt37705_1240_2772_dsc_cmd (senna ab575 tm nt37705 dsc cmd mode panel)
WARNING: Multiple display timings are not supported yet, using first!
ERROR: Failed to get property: qcom,mdss-dsi-bl-pmic-control-type
Traceback (most recent call last):
File "/home/user/linux-mdss-dsi-panel-driver-generator/lmdpdg.py", line 77, in
panel = Panel.parse(fdt, offset)
^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/user/linux-mdss-dsi-panel-driver-generator/panel.py", line 334, in parse
return name and Panel(name.as_str(), fdt, node)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/user/linux-mdss-dsi-panel-driver-generator/panel.py", line 233, in init
backlight = fdt.getprop_or_none(node, 'qcom,mdss-dsi-bl-pmic-control-type')
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/user/linux-mdss-dsi-panel-driver-generator/fdt2.py", line 38, in getprop_or_none
prop = self.getprop(nodeoffset, prop_name, [FDT_ERR_NOTFOUND])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/user/linux-mdss-dsi-panel-driver-generator/fdt2.py", line 32, in getprop
return super().getprop(nodeoffset, prop_name, quiet)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/user/.local/lib/python3.12/site-packages/libfdt.py", line 454, in getprop
return Property(prop_name, bytearray(pdata[0]))
^^^^^^^^^^^^^^^^^^^
TypeError: cannot convert 'NoneType' object to bytearray
dsi-panel-oplus-senna-bc-nt37705-1240-2772-dsc-cmd.dtb does not contain any usable panel specifications

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions