forked from unom/punktfunk
fix(host): hdr-p010-selftest silently ignored its size argument
`args` starts AT the subcommand (main builds it with `env::args().skip(1)`), so a subcommand's own optional arguments begin at index 1 — cf. `args.get(1)` in the `service` arm. This arm read `skip(2)`, swallowing the first optional argument. The documented invocation `hdr-p010-selftest 1920x1080 nvidia` therefore picked up the vendor (it is in the second slot) and ran at the 64x64 DEFAULT. A size-only `hdr-p010-selftest 1920x1080` parsed nothing whatsoever and still printed PASS. Nothing warned, because an unrecognised token is the only thing that errors and no token was ever inspected. The size is the entire point of the flag: the arm's own comment says heights like 1080 are not 16-aligned and exercise a different driver path. So the self-test has only ever validated the one geometry that exercises the least, and the sweep's W7 gate — 1920x1080 and 5120x2880 on the RTX box — could not actually run as written. Found by running that gate: both sizes printed "HDR P010 self-test (64x64 ...)" with byte-identical plane layouts (row_pitch=128, expected_total=12288 — those are 64x64's). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -338,7 +338,15 @@ fn real_main() -> Result<()> {
|
||||
// adapter, which may not be the one that encodes).
|
||||
let mut size = (64u32, 64u32);
|
||||
let mut vendor = None;
|
||||
for a in args.iter().skip(2) {
|
||||
// `args` starts AT the subcommand (main builds it with `env::args().skip(1)`), so the
|
||||
// optional arguments begin at index 1 — cf. `args.get(1)` in the `service` arm. This
|
||||
// read `skip(2)` and so silently swallowed the first optional argument: the documented
|
||||
// `hdr-p010-selftest 1920x1080 nvidia` picked up the vendor but ran at the 64x64
|
||||
// DEFAULT, and a size-only invocation parsed nothing at all and still printed PASS.
|
||||
// The size is the whole point of the flag — 1080 is not 16-aligned and takes a
|
||||
// different driver path — so the self-test was passing on the one geometry that
|
||||
// exercises the least.
|
||||
for a in args.iter().skip(1) {
|
||||
match a.as_str() {
|
||||
"intel" => vendor = Some(0x8086),
|
||||
"nvidia" => vendor = Some(0x10de),
|
||||
|
||||
Reference in New Issue
Block a user