Backlight: port ANA38401 smart-dimming (5-level snap, washed-out lows, glitches) #12
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The panel backlight has three related defects, all from the same root cause: our
ana38401driver hardcodes 5 factory gamma anchors and snaps to the nearest, instead of computing per-level gamma the way Android does.Symptoms (all observed)
Root cause
This DDI has no DCS brightness command (0x51). Android drives it with a smart-dimming engine that, for every brightness level, computes a fresh 33-byte gamma table + AOR + ELVSS by interpolating between a few MTP-calibrated anchor points:
drivers/gpu/drm/msm/samsung/ANA38401_AMSA05RB06/ss_dsi_smart_dimming_*.c(~2283 lines — the gamma math).../ss_dsi_interpolation_*.c(~606 lines — interpolation between anchors).../ss_dsi_panel_*.c(~855 lines)Our
panel-samsung-ana38401.chasana38401_br_levels[]with 5 entries;ana38401_bl_update_status()picks the nearest. So:(3) is separable and smaller
ana38401_send_brightness()sends the update as a sequence of DCS writes (AID0x90, seven0xb0/0xb2mid pairs, ELVSS, 34-byte0x83gamma,0xb2key) with no frame sync, no TE gate, no lock. Dragging the slider fires this repeatedly, async to refresh, so the panel latches partial gamma mid-frame → glitches. Downstream gates brightness onss_event_frame_update(frame boundary). Frame-syncing / serialising the update is a much smaller fix that would kill the glitch even before smart dimming lands — worth doing first.Plan (Option B — the proper fix, chosen 2026-08-21)
ss_dsi_smart_dimming+ss_dsi_interpolationinto the DRM panel driver. It reads the panel MTP (factory gamma) and computes gamma/AOR/ELVSS per level. Expose a full 0–255 (or finer) backlight.Risk / handling
~3000-line port of gamma math on a historically fragile panel; a wrong table can black the screen. Do it with the U-Boot serial console reachable (
gts6l-reboot console) and SD autoboot in place so a bad build is a reboot, not a brick — same rule as #10. Multi-session.(Pragmatic Option A — interpolate only AOR+ELVSS between the 5 anchors, ~50 lines — was considered and rejected in favour of B, because it wouldn't fix the washed-out lows, which are a gamma-accuracy problem.)
Related: #10 (panel blanking) touches the same driver and the same
ss_event_frame_updateordering.