def find(fdt: Fdt2) -> Iterator[Panel]: for mdp in fdt.find_by_compatible('qcom,mdss_mdp'): for sub in fdt.subnodes(mdp): panel = Panel.parse(fdt, sub) if panel: yield panel # Newer device trees do not necessarily have panels below MDP, # search for qcom,dsi-display node instead panel_phandles = set() for display in fdt.find_by_compatible('qcom,dsi-display'): # On even newer SoCs there is another node with qcom,dsi-display-list displays = fdt.getprop_or_none(display, 'qcom,dsi-display-list') if displays is None: panel_phandles.add( fdt.getprop(display, 'qcom,dsi-panel').as_uint32()) else: for display_phandle in displays.as_uint32_array(): display = fdt.node_offset_by_phandle(display_phandle) panel_phandles.add( fdt.getprop(display, 'qcom,dsi-panel').as_uint32()) for phandle in panel_phandles: offset = fdt.node_offset_by_phandle(phandle) panel = Panel.parse(fdt, offset) if panel: yield panel
def find(fdt: Fdt2) -> Iterator[Panel]: for mdp in fdt.find_by_compatible('qcom,mdss_mdp'): for sub in fdt.subnodes(mdp): panel = Panel.parse(fdt, sub) if panel: yield panel