Repository navigation
Cherry-pick to 2.59.1: D401 GMSL dual-RGB SBGGR10P (pBAA) raw color format - #15701
Conversation
…lsenseai#15623) (cherry picked from commit ac1e795)
sysrsbuild-gh-agentic
left a comment
There was a problem hiding this comment.
Auto-generated review by rs-agentic bot.
| rggb::isp_params isp; | ||
| isp.swap_rb = true; // OV9782 is BGGR (driver declares SBGGR8 / SBGGR10P); base | ||
| // demosaic is RGGB-pattern, so swap R<->B to correct it | ||
| return std::make_shared< rggb_converter >( RS2_FORMAT_RGB8, NATIVE_W, rw, rh, isp ); |
There was a problem hiding this comment.
[rs-agentic bot] Potential BUG — rggb_converter is constructed identically for both RS2_FORMAT_RAW8 and RS2_FORMAT_RAW10 sources; src_fmt is not passed to the constructor (it is not captured by [rw, rh]). Packed MIPI RAW10 (pBAA) is 1.25 bytes/pixel while RAW8 is 1 byte/pixel — if rggb_converter doesn't internally detect/dispatch on the input bit-depth it will misinterpret the RAW10 payload and produce corrupt RGB output. Please confirm rggb_converter handles both packed-10 and 8-bit Bayer input, or pass src_fmt to the factory so the correct decoder is instantiated.
| // D401 GMSL dual-RGB (per_stream_color_fn, set only for that path) color is packed MIPI | ||
| // RAW10 (pBAA) but sized at 16 bpp (unpacked) here; copy the packed payload verbatim, | ||
| // the rggb converter unpacks it downstream. | ||
| if( per_stream_color_fn |
There was a problem hiding this comment.
[rs-agentic bot] Note — per_stream_color_fn is used here as a proxy for "this is the D401 GMSL RAW10 color path". The comment says it's set only for that path today, but if it is ever armed for another sensor/color pipeline, this expected_size override will silently apply to unrelated RS2_FORMAT_RAW10 | RS2_STREAM_COLOR streams. Consider a more explicit guard (e.g. a dedicated bool flag or PID/FW check at the call site) to avoid unintended side-effects on future sensors.
Overview: Cherry-pick of #15623 to the 2.59.1 release branch — D401 GMSL dual-RGB support for the SBGGR10P (pBAA) raw color format.
Tracked on [RSDEV-14662]
Why
MIPI driver 1.0.6.10 advertises the D401 GMSL raw dual-RGB color pins as SBGGR10P (pBAA) at 1288x808 instead of SBGGR8 (BA81) at 1612x808. Without this, Color 1 never appears and the SDK crashes on the packed RAW10 payload.
Summary
d400-device.cpp: map pBAA toRS2_FORMAT_RAW10/RS2_STREAM_COLOR; dual-RGB resolver accepts BA81 or pBAA.d400-color.cpp: register the raw debayer as one single-source block per format, so the formats-converter many-to-one guard stops dropping the RGB8 targets.uvc-sensor.cpp: copy the packed RAW10 color payload verbatim —RS2_FORMAT_RAW10is sized 16 bpp, which overran the copy buffer.Clean cherry-pick, diff identical to the merged change on development.
Test plan
🤖 Generated by AI