Skip to content

Cherry-pick to 2.59.1: D401 GMSL dual-RGB SBGGR10P (pBAA) raw color format - #15701

Merged
Nir-Az merged 1 commit into
realsenseai:r/2.59.1from
Nir-Az:cp-d401-pbaa-2591
Sep 22, 2026
Merged

Nir-Az merged 1 commit into
realsenseai:r/2.59.1from
Nir-Az:cp-d401-pbaa-2591

Conversation

@Nir-Az

@Nir-Az Nir-Az commented Sep 22, 2026

Copy link
Copy Markdown
Collaborator

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 to RS2_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_RAW10 is sized 16 bpp, which overran the copy buffer.

Clean cherry-pick, diff identical to the merged change on development.

Test plan


🤖 Generated by AI

@sysrsbuild-gh-agentic sysrsbuild-gh-agentic left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 );

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[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.

Comment thread src/uvc-sensor.cpp
// 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

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[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.

@Nir-Az
Nir-Az requested a review from ashrafk93 September 22, 2026 13:52
@Nir-Az
Nir-Az merged commit 6de7608 into realsenseai:r/2.59.1 Sep 22, 2026
30 checks passed
@Nir-Az
Nir-Az deleted the cp-d401-pbaa-2591 branch September 22, 2026 16:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants