Repository navigation
hid: add opt-in standard-transport CapImg multitouch - #87
Conversation
|
Hi @avgbob, thanks for splitting this out and being precise about what has and has not been qualified on hardware. The narrow scope and default-off activation are appreciated. I reviewed 1. Small runtime issue: the bridge repeatedly arms standard-liveness logging even when it is disabledAt The worker still selects its policy using An actual-handler/worker host probe with counted kernel endpoints reproduced three successive schedules and three messages: This is misleading repeated logging and unnecessary work, not a demonstrated reset storm or broken touch input. The IRQ baseline is also not initialized by the disabled startup-liveness arm, so those counts do not represent the advertised window. The smallest change seems to be keeping this particular runtime-watchdog arm gated by 2. The new lifecycle tests do not yet exercise the complete DATA pathThe helper C test usefully checks the boolean policies, but its cursor increment models the read rather than executing Two mutation checks made that distinction concrete:
Could we add a small behavioral test around the production DATA handler with counted SPI/HID/tracker endpoints? Useful assertions would be:
That would protect the lifecycle fix much better than adding more source strings. What checked out locally
I also checked the new HID fall-through: report Remaining acceptance checksAs you already note, the earlier Gate5 results should not be treated as physical qualification of this exact extracted revision. Before merge, it would be useful to have the exact tested SHA and results for true cold boot, repeated warm reloads, suspend/resume, and real multitouch/gestures, with frame-drop and unexpected-reset counters. Please also confirm that the default standard profile remains unaffected. The CI run for this head is currently waiting for approval ( One non-blocking hardware question to retain for a labelled run: the old transition cleared Thanks again — this is a focused and reviewable contribution. The small watchdog correction, a real-handler regression test, and exact-revision hardware results would make the acceptance evidence much stronger. |
|
Thanks for the detailed review — I audited this against both the rebased branch and the original Gate5 qualification data and pushed the code/test fixes. Current head: Changes made:
Two hardware/provenance points from the older qualified Gate5 branch are worth recording, but I am not using them as acceptance evidence for this rebased head:
The exact-head physical acceptance items you requested are still genuinely pending: cold boot, repeated reloads, suspend/resume, real multitouch/gestures, drop/reset counters, and a default-standard control on this exact SHA. I’ll keep the PR draft rather than relabel the historical Gate5 run as current evidence. CI is also still |
|
Thanks for the update — I rechecked head One test-only issue remains: Medium: the new production-handler harness fails to compile
The stub does not use Could you reconcile the harness-only diagnostics with the existing host kernel-translation-unit conventions while retaining real production extraction? This is a test-build problem, not evidence of a new device runtime failure. In a separate generated probe relaxing only host warning diagnostics, the actual handler and exact lifecycle helpers pass ASan/UBSan: 4309-byte read, 4304-byte tracker delivery, early ownership/publication controls, no standard-bridge watchdog, and raw watchdog positive control. Six independent behavior mutations are rejected (short read, disabled consumption, missing raw-only gate, lost early ownership, broadened default-standard ownership, premature publication). This supports the logic correction but does not make the shipped failing gate pass. Both modules compile against Debian 6.12.111 headers, BTF disabled; explicit replay target compilation passes. No modules loaded. Exact-head cold boot/reloads/resume/gestures/drop-reset/default-standard checks remain open. The retained SET5 context and spontaneous-reset latch remain hardware questions, not new confirmed defects. CI snapshot is action_required, not a successful run. No source changes made during review. |
…and extracted handler
|
@Syax89 Follow-up to your GCC 14 production-handler harness review: fixed in fork head Fork CI run 38925909979 is green: normal and |
|
Thanks again for the fixes. Here is the focused follow-up verification. Reviewed exact head The corrected extracted-handler test passes unchanged. The default-standard creation-time drain/publication policy remains equivalent to base, and the opt-in tracker/watchdog gates remain scoped as intended. There is, however, a distinct steady-state difference worth stating explicitly: after HID creation, a valid unsolicited DATA report An executable comparison of the exact base/prior/head handlers records HID dispatcher calls 0 / 1 / 1, with no tracker consumption, for that bounded input. Positive report-0x40, insufficient-capacity and HID-creation negative controls behave as expected. This is not caused by the latest test-only correction. Report12 is present in both the captured and hardcoded report descriptors: 16-bit SurfaceSwitch plus 4297 constant bytes. It must not be dismissed as an unknown report, nor equated with an MT contact report. Linux HID can expose such a report through its bound-driver/HIDRAW path; actual userspace effects depend on the live descriptor, binding, claims and readers. The sibling poller already has a forwarding branch, but its activation is raw-mode-only at both pins, so it does not establish unchanged pure-default runtime behavior. I do not have evidence of a clean, no-transition default controller actually emitting this report or of a user-visible hardware regression. Please clarify whether forwarding unsolicited Exact-head hardware qualification remains pending: cold first probe, three warm reloads, two s2idle cycles, real gestures/contact lifecycle, drop/reset deltas and ordinary-standard control. Spontaneous post-DONE reset/re-arm remains NOT EXERCISED unless such a reset actually occurs; reloading the module cannot answer it. Historical Gate5 or experimental mode4 results are not substituted for these checks. |
…t/bridge and raw tracker modes
…0x0c, bridge, raw, and other HID report dispatch
|
@Syax89 Thank you for the exact-head Decision: forwarding unsolicited Report 12 / I've changed the PR head to
All four fork CI jobs passed on this exact head, including the host tests and kernel builds. No physical test or broad compatibility claim is implied by green CI. The prior independent GET6-free mode4 did pass a true cold-power-on + real-gesture + rollback test on kernel |
|
@Syax89 Exact-head physical acceptance update for All three cycles used the same existing-MOK-signed module, SHA256 Local physical evidence: The first attempt was incomplete due to a Still pending for this exact PR SHA: full gesture matrix, two genuine s2idle/resumes, true cold first-HID activation, and default-standard negative control. Spontaneous post-DONE reset/re-arm remains unexercised. Keeping PR draft while these tests are completed. This should not be conflated with the separate GET6-free mode4 coldboot evidence. |
|
@Syax89 Follow-up on the same exact PR #87 source head The two measured Local evidence (not yet uploaded): One operator observation: the separate spoken test helper repeatedly said Still pending before requesting upstream acceptance: exact-head true cold first-HID load, full gesture matrix, and default-standard/opt-out negative control. Previous separate GET6-free mode4 cold-start results are still not being counted as PR87 evidence. |
|
@Syax89 Final exact-head PR #87 physical qualification update for All five defined test categories completed on this one unit:
The physical tests used the same signed exact-PR binary; the module source identity was distinct from installed Gate5. The original raw evdev/kernel journal evidence remains on the tester and has not been independently replayed or uploaded. Full details, hashes, boot IDs, paths and limitations: hardware acceptance record and upstream handoff. These results qualify one device/kernel/revision only, not spontaneous post-DONE reset/rearm, endurance, other hardware, or kernel-mainline integration. Would a particular additional failure-path test or sanitized log excerpt help before deciding whether to take the PR out of draft? |
Summary
Focused extraction of the Gate5 standard-transport work, based directly on current upstream
main/ v1.7.1 (72b3492).This adds an opt-in, default-off standard-transport CapImg multitouch path for the exact hardware ID currently qualified by the field work: MSHW0231.
Activation requires all three conditions:
MSHW0231std_raw_transition=1raw_input_beta=1Otherwise the bridge stays disabled. Existing raw mode remains intact, and ordinary standard mode is unchanged.
Why this transaction order
Controlled A/B testing on my physical SL4 AMD / MSHW0231 unit found:
So this path deliberately writes GET6 without consuming the response body before SET5. That is separate from issue #4's generic HID GET_REPORT path, where standard-mode report 6 is now correctly suppressed by default upstream.
Early-DATA lifecycle fix
SET5 can make the first ~4.3 KiB CapImg DATA frame arrive during HID registration.
The old path could consume the DATA header and then return while
hid_add_device()was still running, leaving the body queued. On my unit that produced a repeatable warm-reload reset roughly 0.5 s later.This PR therefore separates two policies:
hid_input_report()only after HID creation completes.The tracker-specific ownership closes the smaller window where the bridge device exists but
hid_creatinghas not flipped true yet, while plain/default standard HID keeps upstream creation-time behavior.Hardware scope
The standard-transport bridge is intentionally narrower than the general SL4 device match.
MSHW0231: eligible when the two opt-in parameters above are set.MSHW0230: remains supported by the general driver, but this bridge is not enabled.MSHW0162: bridge is not enabled.This avoids extending one-unit hardware evidence to unqualified panels.
Prior hardware evidence
The corresponding Gate5 path was qualified on one physical Surface Laptop 4 AMD / MSHW0231 unit:
Qualification record:
https://github.com/avgbob/SL4A_TouchScreen/blob/main/docs/GATE5-QUALIFICATION.md
That evidence predates this clean rebase. I am not claiming fresh physical qualification of this exact rebased branch yet, so the PR remains draft.
Regression coverage
The PR adds three source-contract tests plus one compiled lifecycle behavior test:
std_capimg_activation_source_test.pystd_capimg_input_source_test.pystd_capimg_data_drain_source_test.pyseq_handle_data()std_capimg_data_policy_test.chid_creatingwindow when the tracker already owns DATAThe new compiled test is wired into
make -C tests test.Deliberately not included
To keep this review independent, this PR does not include:
sl4a-heatThose can be reviewed separately if useful.
This is the standard-transport piece I mentioned in issue #4.
Windows reverse-engineering provenance
This path was not derived from Linux-side trial-and-error alone. The standard-transport work grew out of a Windows reverse-engineering campaign on the same MSHW0231 hardware:
HID\\MSHW0231&Col02 -> TouchPenProcessor0C19.dlland identifies the Heat processor used for this panel.That Windows evidence is what pushed the project toward preserving the real HID transport, reproducing the observed lifecycle/report sequence, and treating
0x0cas the Heat/CapImg data path rather than replacing the transport wholesale.Review follow-up
After Syax89's first review:
stream_watchdogarm inside the DATA path is gated back toraw_mode_active; standard-transport bridge traffic does not arm raw recovery/logging whenstd_liveness_ms=0;seq_handle_data()body with counted SPI/tracker/HID/workqueue endpoints, and compiles the exact DATA lifecycle helpers fromspi-hid-protocol.h;hid_creatingalone does not change default standard-HID behavior.Historical Gate5 evidence was on
58f023102679ab0156ce95210abe7e3e3e6ac412, not this rebased head. That campaign already used retained SET_FEATURE/5 request context after activation and passed cold boot, 3/3 warm reloads, and 2/2 s2idle resumes with zero observed frame drops/unexpected post-DONE resets. I am intentionally not presenting that as exact-head acceptance evidence.Still required before this draft is marked ready: physical qualification of the exact PR head, including the requested cold boot/reloads/resume/real gestures/counters/default-standard control. A spontaneous post-DONE reset that would test whether the one-shot activation must be re-armed in-place was not observed in the historical campaign and remains an open targeted hardware question.