mcux: sdk-ng: csi: Make the frame buffer queue circular #864
All Vouch review confidence checks passed
Residual risk 0.17 = Change Risk (0.31) × (1 − Review Confidence (0.47)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.31 · 111 lines diff across 1 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Shallow Review Depth
shallow_review_depth
0.344
Diff Size
diff_size
0.282
Real PR Conversation Timeline
1 comments
"Review active on #864"
general
weight: 0.35
zejiang0jason
buf_queue_t appended at tail + 1 and consumed at head, and reused its array only once the queue had drained; "full" was tail at the last index.
A stream started with 4 buffers queued (CSI_TransferStart() takes two) therefore refused the first buffer returned to it with
kStatus_CSI_QueueFullwhile holding two entries, and the application lost that buffer for the rest of the stream.With 3 buffers the queue empties on every frame and the limitation never shows, which is why it went unnoticed since the rework that introduced this queue (commit abc66979c "drivers: csi: Rework to fix the low framerate issue").
Keep the array and index it circularly: head is the oldest entry and count the occupancy, so the queue holds
CSI_DRIVER_QUEUE_SIZEbuffers whatever the history. The range checks on head and tail that guarded the old indices have nothing left to guard.