Face unlock: screen fill-light for low light; fix Quad-Bayer AE ramp
CI / test (push) Failing after 51s

- Boost the backlight to 90% while enrolling with the light on or while sign-in is scanning, then restore the previous level when that ends or the window closes.
- Add a Light: On/Off toggle (L key) to the Face window; the backdrop turns soft white while the light is on.
- Quad-Bayer AE: compute the low-light gain once and cap it by the highlight limit, so ramp-up and highlight back-off agree.
- Tests: backlight round-trip through the Face window, Quad-Bayer debayer color/low-light/dark-frame cases, and the AE ramp, back-off and restore order.
This commit is contained in:
nandi committed 2026-11-28 18:32:15 -08:00
1 parent c5b96e2c70
commit 40c5d6722c
8 files changed
+266 -12

No files matched your search

+36
View File
@@ -230,3 +230,39 @@ test "face unlock status lines" {
assert_eq(@shell.face_progress("error couldn't see a face clearly"), Some("Couldn't see a face clearly"))
assert_eq(@shell.face_progress("face 1\tDesk\t2026-11-20"), None)
}
///|
test "the Face unlock window: screen fill-light boosts backlight and restores on close" {
let root = "/tmp/chandra-test-face-backlight-" + @sys.getpid().to_string()
let dev = root + "/ae94000.dsi.0"
ignore(@sys.mkdir_p(dev))
assert_eq(@sys.write_file_bytes(dev + "/max_brightness", @utf8.encode("1000\n")), 0)
assert_eq(@sys.write_file_bytes(dev + "/brightness", @utf8.encode("500\n")), 0)
@shell.set_backlight_root(root)
let dir = "/tmp/chandra-face-light-" + @sys.getpid().to_string()
let tool = fake_face_tool(dir)
let comp = new_comp("facelight")
comp.shell.set_face_tool(["/bin/sh", tool])
assert_true(comp.shell.open_settings(Session))
assert_true(face_settle(comp, fn() { face_texts(comp).contains("Desk") }))
face_click(comp, "Add or remove faces…", 10U)
assert_true(face_settle(comp, fn() { comp.shell.face.window.map(w => w.picture != 0U).unwrap_or(false) }))
let w = comp.shell.face.window.unwrap()
assert_true(w.fill_light)
assert_eq(@shell.read_backlight_percent(), 90)
// Pressing L toggles fill-light off and restores previous backlight immediately.
face_key(comp, 38U, 20U)
assert_false(w.fill_light)
assert_eq(@shell.read_backlight_percent(), 50)
// Pressing L again boosts back to 90.
face_key(comp, 38U, 30U)
assert_true(w.fill_light)
assert_eq(@shell.read_backlight_percent(), 90)
// Esc closes window and restores backlight cleanly.
face_key(comp, 1U, 40U)
ignore(comp.compose_frame())
assert_true(comp.shell.face.window is None)
assert_eq(@shell.read_backlight_percent(), 50)
comp.close()
@shell.set_backlight_root("/sys/class/backlight")
}