Skip to content

Commit a516096

Browse files
committed
panel: Don't fail on DCS without max brightness
This is bad but meh, let's not crash because of this.
1 parent 254aff0 commit a516096

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

panel.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,9 +219,13 @@ def __init__(self, name: str, fdt: Fdt2, node: int) -> None:
219219
self.bpp = fdt.getprop(node, 'qcom,mdss-dsi-bpp').as_int32()
220220
self.mode = Mode(fdt.getprop(node, 'qcom,mdss-dsi-panel-type').as_str())
221221
self.traffic_mode = TrafficMode.parse(fdt.getprop(node, 'qcom,mdss-dsi-traffic-mode'))
222+
222223
backlight = fdt.getprop_or_none(node, 'qcom,mdss-dsi-bl-pmic-control-type')
223224
self.backlight = BacklightControl(backlight.as_str()) if backlight else None
224225
self.max_brightness = fdt.getprop_int32(node, 'qcom,mdss-dsi-bl-max-level', None)
226+
if self.backlight == BacklightControl.DCS and self.max_brightness is None:
227+
print("WARNING: DCS backlight without maximum brightness, ignoring...")
228+
self.backlight = None
225229

226230
self.lanes = 0
227231
while fdt.getprop_or_none(node, f'qcom,mdss-dsi-lane-{self.lanes}-state') is not None:

0 commit comments

Comments
 (0)