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_mode_node(fdt: Fdt2, node: int) -> int:
	timings_node = fdt.subnode_or_none(node, "qcom,mdss-dsi-display-timings")
	if timings_node is None:
		return node

	mode_node = None
	for timing in fdt.subnodes(timings_node):
		if mode_node:
			print("WARNING: Multiple display timings are not supported yet, using first!")
			break
		mode_node = timing

	assert mode_node, "No display timings found"
	return mode_node
Beispiel #3
0
	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